-
Notifications
You must be signed in to change notification settings - Fork 19
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
Bug: doesn't compile on Apple M1? #41
Comments
I have a near identical issue with M1 chip on Sonoma |
You need to manually set
Also make sure to run |
Thank you. This worked. |
Except now I'm getting this error, which seems to be related... error: failed to run custom build command for --- stdout --- stderr |
After the ring update I'm still getting a similar error as posted above. Using a Mac m1 chip. warning: [email protected]: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"' error: failed to run custom build command for |
@roachj9 Sorry, but I can't reproduce this issue. Everything compiles fine for me using rustc 1.71.0 (8ede3aae2 2023-07-12) on M1 running macOS 13.6.1 (22G313) |
Documenting my experience. On M1 Pro, MacOS 12.5.1 Initially I had the same error as @roachj9. Now, after setting the flags and cleaning, I'm stuck on:
This is with a repo that has nothing but cargo init and adding this git repo by URL with, in Cargo.toml:
Maybe it's unrelated to being on M1, though I do notice it's the same |
Hi all, The issue can still be reproduced on an M3 Pro.
With homebrew installed LLVM seems to have fixed the issue. There is a weird side-effect where it no longer caches Any solutions to this would be much appreciated! |
I'm on windows 10 facing the same issue. Works fine on linux. Steps to reproduce (assuming you have rust installed):
cargo install cargo-leptos
cargo leptos new --git https://github.com/leptos-rs/start-axum
[package]
name = "my-web"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
axum = { version = "0.7", optional = true }
chrono = "0.4.38"
console_error_panic_hook = "0.1"
http = "1"
leptos = { version = "0.7.0" }
leptos_axum = { version = "0.7.0", optional = true }
leptos_meta = { version = "0.7.0" }
leptos_router = { version = "0.7.0" }
# extra dependency, same error with just surrealdb = "2.1.3"
surrealdb = { version = "2.1.3", default-features = false, features = ["protocol-ws"], package = "surrealdb-nightly" }
thiserror = "1"
tokio = { version = "1", features = ["rt-multi-thread"], optional = true }
tower = { version = "0.4", optional = true }
tower-http = { version = "0.5", features = ["fs"], optional = true }
wasm-bindgen = "=0.2.99"
[features]
hydrate = ["leptos/hydrate"]
ssr = [
"dep:axum",
"dep:tokio",
"dep:tower",
"dep:tower-http",
"dep:leptos_axum",
"leptos/ssr",
"leptos_meta/ssr",
"leptos_router/ssr",
]
# Defines a size-optimized profile for the WASM bundle in release mode
[profile.wasm-release]
inherits = "release"
opt-level = 'z'
lto = true
codegen-units = 1
panic = "abort"
...
The following warnings were emitted during compilation:
warning: [email protected]: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
warning: [email protected]: 1 error generated.
error: failed to run custom build command for `ring v0.17.8`
Caused by:
process didn't exit successfully: `C:\Users\.....\my-web\target\front\debug\build\ring-661c2665f5b6d7a3\build-script-build` (exit code: 1)
--- stdout
cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_8_
OPT_LEVEL = Some(0)
OUT_DIR = Some(C:\Users\.....\my-web\target\front\wasm32-unknown-unknown\debug\build\ring-8ae652aa7f608cc2\out)
TARGET = Some(wasm32-unknown-unknown)
HOST = Some(x86_64-pc-windows-msvc)
cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
CC_wasm32-unknown-unknown = None
cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
CC_wasm32_unknown_unknown = None
cargo:rerun-if-env-changed=TARGET_CC
TARGET_CC = None
cargo:rerun-if-env-changed=CC
CC = None
cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
RUSTC_WRAPPER = None
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some(true)
cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
CFLAGS_wasm32-unknown-unknown = None
cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
CFLAGS_wasm32_unknown_unknown = None
cargo:rerun-if-env-changed=TARGET_CFLAGS
TARGET_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
CARGO_ENCODED_RUSTFLAGS = Some()
cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
cargo:warning=1 error generated.
--- stderr
error occurred in cc-rs: Command "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fno-exceptions" "-g" "-fno-omit-frame-pointer" "--target=wasm32-unknown-unknown" "-I" "include" "-I" "C:\\Users\\.....\\my-web\\target\\front\\wasm32-unknown-unknown\\debug\\build\\ring-8ae652aa7f608cc2\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-nostdlibinc" "-DNDEBUG" "-DRING_CORE_NOSTDLIBINC=1" "-o" "C:\\Users\\.....\\my-web\\target\\front\\wasm32-unknown-unknown\\debug\\build\\ring-8ae652aa7f608cc2\\out\\172e8fe49fe517e0-curve25519.o" "-c" "crypto/curve25519/curve25519.c" with args clang did not execute successfully (status code exit code: 1).
warning: build failed, waiting for other jobs to finish...
Notify watching paths src, style, public
Leptos ctrl-c received |
In case it helps anyone: for my use case I can just serve the app from wsl |
Describe the bug
After running compilation on rust level, that can be ivoced also by
npm run build
command after downloading sources from git, I get:`...
Compiling cipher v0.4.4
error: failed to build archive: 'wasm32.o': section too large
The following warnings were emitted during compilation:
warning: warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: archive library: /Users/(...)/surrealdb.wasm/target/wasm32-unknown-unknown/release/build/psm-e7fd6e39c2c90a79/out/libpsm_s.a the table of contents is empty (no object file members in the library define global symbols)
error: could not compile
psm
(lib) due to previous errorwarning: build failed, waiting for other jobs to finish...
Error: Compiling your crate to WebAssembly failed
Caused by: Compiling your crate to WebAssembly failed
Caused by: failed to execute
cargo build
: exited with exit status: 101full command: cd "/Users/pedropuchalski/Documents/praca/FirmaNext/sceneMgm/surrealdb.wasm" && "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown" "--no-default-features" "--features" "protocol-ws,protocol-http,kv-indxdb,kv-mem,rustls"`
Steps to reproduce
Try to compile on Apple MacBook Air with M1, Ventura.
Expected behaviour
Compiled *.wasm file.
SurrealDB version
"1.0.0", default-features = false
Contact Details
[email protected]
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: