diff options
author | Bas van Dijk <bas@van.dijk.ch> | 2024-05-25 00:12:37 +0200 |
---|---|---|
committer | Bas van Dijk <bas@van.dijk.ch> | 2024-05-25 00:12:37 +0200 |
commit | cca07f139dc2b01fee4f241d43b450a8df4b2e89 (patch) | |
tree | 0e6378621512731f2a8ff805074482503e6c95ea /pkgs/development | |
parent | 87d61d1ff5bf5fbd038a06fc14b4e4981c3b7f92 (diff) | |
download | nixlib-cca07f139dc2b01fee4f241d43b450a8df4b2e89.tar nixlib-cca07f139dc2b01fee4f241d43b450a8df4b2e89.tar.gz nixlib-cca07f139dc2b01fee4f241d43b450a8df4b2e89.tar.bz2 nixlib-cca07f139dc2b01fee4f241d43b450a8df4b2e89.tar.lz nixlib-cca07f139dc2b01fee4f241d43b450a8df4b2e89.tar.xz nixlib-cca07f139dc2b01fee4f241d43b450a8df4b2e89.tar.zst nixlib-cca07f139dc2b01fee4f241d43b450a8df4b2e89.zip |
wasmtime: fix build on aarch64-darwin
The check phase fails on aarch64-darwin because of: ``` $ nix-build -A wasmtime ... buildPhase completed in 1 minutes 41 seconds Running phase: checkPhase Executing cargoCheckHook ++ cargo test -j 10 --profile release --target aarch64-apple-darwin --frozen -- --test-threads=10 ... > error: linker `rust-lld` not found > | > = note: No such file or directory (os error 2) > > error: could not compile `wasi-preview1-component-adapter` (lib) due to 1 previous error ``` I tried to bring `lld` into scope and set `RUSTFLAGS = "-C linker=lld` but I couldn't get the tests to build. So I just disabled them on aarch64-darwin.
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/interpreters/wasmtime/default.nix | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/development/interpreters/wasmtime/default.nix index afa65741892c..06bff777ddbf 100644 --- a/pkgs/development/interpreters/wasmtime/default.nix +++ b/pkgs/development/interpreters/wasmtime/default.nix @@ -1,4 +1,4 @@ -{ rustPlatform, fetchFromGitHub, Security, lib, stdenv }: +{ rustPlatform, rustfmt, fetchFromGitHub, Security, lib, stdenv }: rustPlatform.buildRustPackage rec { pname = "wasmtime"; @@ -21,11 +21,20 @@ rustPlatform.buildRustPackage rec { buildInputs = lib.optional stdenv.isDarwin Security; - # SIMD tests are only executed on platforms that support all - # required processor features (e.g. SSE3, SSSE3 and SSE4.1 on x86_64): - # https://github.com/bytecodealliance/wasmtime/blob/v9.0.0/cranelift/codegen/src/isa/x64/mod.rs#L220 - doCheck = with stdenv.buildPlatform; (isx86_64 -> sse3Support && ssse3Support && sse4_1Support); - cargoTestFlags = ["--package" "wasmtime-runtime"]; + # rustfmt is brought into scope to fix the following + # warning: cranelift-codegen@0.108.0: + # Failed to run `rustfmt` on ISLE-generated code: Os + # { code: 2, kind: NotFound, message: "No such file or directory" } + nativeBuildInputs = [ rustfmt ]; + + doCheck = with stdenv.buildPlatform; + # SIMD tests are only executed on platforms that support all + # required processor features (e.g. SSE3, SSSE3 and SSE4.1 on x86_64): + # https://github.com/bytecodealliance/wasmtime/blob/v9.0.0/cranelift/codegen/src/isa/x64/mod.rs#L220 + (isx86_64 -> sse3Support && ssse3Support && sse4_1Support) && + # The dependency `wasi-preview1-component-adapter` fails to build because of: + # error: linker `rust-lld` not found + !(isAarch64 && stdenv.isDarwin); postInstall = '' # move libs from out to dev |