Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error on M1 #82

Open
cavemanloverboy opened this issue Nov 10, 2022 · 6 comments
Open

Compilation error on M1 #82

cavemanloverboy opened this issue Nov 10, 2022 · 6 comments

Comments

@cavemanloverboy
Copy link

I'm running trunk serve on a fresh clone and I get

  Compiling web-sys v0.3.59
   Compiling wasm-bindgen-futures v0.4.32
   Compiling tracing-wasm v0.2.1
   Compiling emath v0.19.0
   Compiling ron v0.8.0
error: linking with `rust-lld` failed: exit status: 1
  |
  = note: "rust-lld" "-flavor" "wasm" "--rsp-quoting=posix" "--export" "__wbindgen_describe___wbg_log_02e20a3c32305fb7" "--export" "__wbindgen_describe___wbg_log_5c7513aa8c164502" "--export" "__wbindgen_describe___wbg_log_944a2253906cc04f" "--export" "__wbindgen_describe___wbg_log_9f01e2baa8742293" "--export" "__wbindgen_describe___wbg_mark_abc7631bdced64f0" "--export" "__wbindgen_describe___wbg_measure_c528ff64085b7146" "--export" "__externref_drop_slice" "--export" "__externref_heap_live_count" "--export" "__externref_table_alloc" "--export" "__externref_table_dealloc" "--export" "__wbindgen_exn_store" "--export" "__wbindgen_free" "--export" "__wbindgen_malloc" "--export" "__wbindgen_realloc" "--export=__heap_base" "--export=__data_end" "-z" "stack-size=1048576" "--stack-first" "--allow-undefined" "--fatal-warnings" "--no-demangle" "--no-entry" "--export-dynamic" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.0.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.1.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.10.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.11.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.12.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.13.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.14.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.15.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.2.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.3.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.4.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.5.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.6.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.7.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.8.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.tracing_wasm.a2341e97-cgu.9.rcgu.o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.33emkghic0x4u5ds.rcgu.o" "-L" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps" "-L" "/Users/alvarozamora/site/target/debug/deps" "-L" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/libwasm_bindgen-7381d90e69dfdc8d.rlib" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/libtracing_subscriber-fdd614a5d7fa6eb6.rlib" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/libthread_local-7bcd2b0078c0e51f.rlib" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/libsharded_slab-429288038bbbb0b2.rlib" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/liblazy_static-066ad0656a44cc96.rlib" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/libtracing-9e4cca10b848066a.rlib" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/libcfg_if-58b9d426f806ffd6.rlib" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/libpin_project_lite-f9e39787deda2239.rlib" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/libtracing_core-80d3d1745941828c.rlib" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/libonce_cell-a102fc9aea60d6b5.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libstd-6e4506c3bd4e06a6.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libpanic_abort-50ac03b727648902.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libdlmalloc-158cb6a12317ab51.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/librustc_demangle-bdf1206d3f8ae6ef.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libstd_detect-397d76d8bd3f3d7e.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libhashbrown-959ca68b71c716c5.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libminiz_oxide-ad68ab0ba60287e9.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libadler-9507aab8973c69a2.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/librustc_std_workspace_alloc-2b254a2ed0d53204.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libunwind-43d8b49759ddb512.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libcfg_if-44d429d5b4e07ccb.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/liblibc-f12e412d1fc09ff8.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/liballoc-8c154691168d0cf2.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/librustc_std_workspace_core-ec4bdf0d7fe4b487.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libcore-011f61430b3e691f.rlib" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libcompiler_builtins-8f04c8042c958fbc.rlib" "-L" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib" "-L" "/Users/alvarozamora/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/self-contained" "-o" "/Users/alvarozamora/site/target/wasm32-unknown-unknown/debug/deps/tracing_wasm-de3c7e6ece2dba72.wasm" "--gc-sections" "--no-entry" "-O2" "-Wl,-undefined,dynamic_lookup"
  = note: rust-lld: error: unknown argument: -Wl,-undefined,dynamic_lookup
          

error: could not compile `tracing-wasm` due to previous error
warning: build failed, waiting for other jobs to finish...
2022-11-08T00:47:03.146144Z ERROR ❌ error
error from HTML pipeline

Caused by:
    0: error from asset pipeline
    1: error during cargo build execution
    2: cargo call returned a bad status
2022-11-08T00:47:03.151156Z  INFO 📡 serving static assets at -> /
2022-11-08T00:47:03.151520Z  INFO 📡 server listening at http://127.0.0.1:8080

So, I get a compilation error with rust-lld: error: unknown argument: -Wl,-undefined,dynamic_lookup and despite this trunk serve continues. I am able to get rid of tracing-wasm but then it happens again (same flags) with the main binary.

@emilk
Copy link
Owner

emilk commented Nov 10, 2022

I am using an M1 mac with no problems.

What is your cargo --version?

You can try

rustup set default-host aarch64-apple-darwin && rustup default 1.65

and see if it helps

@cavemanloverboy
Copy link
Author

I tried this (I was on stable-x86_64-apple-darwin) and got the same error. I am on

% cargo --version
cargo 1.65.0 (4bc8f24d3 2022-10-20)

@cavemanloverboy
Copy link
Author

cavemanloverboy commented Nov 11, 2022

what version of trunk are you on?
edit: nvm i dont think thats it

@cavemanloverboy
Copy link
Author

I'm able to build the native app, and i'm able to trunk serve on a linux machine. I will develop using the native app and then try it out on the linux machine. However, I would love to fix this so that i can do it all on one machine

@seclerp
Copy link

seclerp commented Mar 24, 2023

The same issue on M1

@seclerp
Copy link

seclerp commented Mar 24, 2023

Seems like I found the missing stuff that should be done to be able to run trunk serve:

  1. rustup set default-host aarch64-apple-darwin && rustup default 1.68, thanks @emilk for pointing it above
  2. rustup target add wasm32-unknown-unknown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants