rusty-kaspa icon indicating copy to clipboard operation
rusty-kaspa copied to clipboard

Building WASM framework failed

Open Ligang9 opened this issue 1 year ago • 2 comments

My computer is MacOS ./build-web Compiling secp256k1-sys v0.6.1 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 secp256k1-sys v0.6.1

Caused by: process didn't exit successfully: /Users/ligang/rusty-kaspa/target/release/build/secp256k1-sys-c339f6fad88f0367/build-script-build (exit status: 1)

Ligang9 avatar Apr 21 '24 07:04 Ligang9

You are not following either clang (llvm) or rustup target installation steps. Make sure your clang is up to date. Follow the steps in Building on Mac OS / Install llvm in the README; Make sure your environment variables are available in the process/terminal (by default, Mac OS can have an older clang installed, which will try to compile but doesn't have the required target available; when installing latest clang on MacOS it comes bundled with wasm32 target needed to build C sources of the secp256k1 crate). When installing the new version of the llvm using brew, if exports (env vars) are not set correctly, it won't see the newly installed version.

Also, check the info on the pre-built development releases at https://aspectron.org/en/projects/kaspa-wasm.html and https://github.com/aspectron/rusty-kaspa/blob/typescript/wasm/README.md

aspect avatar Apr 22 '24 06:04 aspect

Once your clang issues are resolved, please use this if building from source: https://github.com/kaspanet/rusty-kaspa/pull/459

aspect avatar Apr 22 '24 19:04 aspect