From 76836deefd06ee4e9427617fa7a1de0ad895aa87 Mon Sep 17 00:00:00 2001 From: Rafael Fernández López Date: Tue, 9 May 2023 13:29:59 +0200 Subject: wasmtime: run tests depending on the platform features Run tests depending on the platform features reported by stdenv. --- pkgs/development/interpreters/wasmtime/default.nix | 23 ++++++++-------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'pkgs/development/interpreters/wasmtime') diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/development/interpreters/wasmtime/default.nix index 4103741dacef..16abba6087d0 100644 --- a/pkgs/development/interpreters/wasmtime/default.nix +++ b/pkgs/development/interpreters/wasmtime/default.nix @@ -14,23 +14,15 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-A2JhjRFKPltHubiJYHBXj2H4cdU43Y2x6UjEpRGPX7U="; - cargoBuildFlags = [ - "--package wasmtime-cli" - "--package wasmtime-c-api" - ]; + cargoBuildFlags = [ "--package" "wasmtime-cli" "--package" "wasmtime-c-api" ]; outputs = [ "out" "dev" ]; - # We disable tests on x86_64-darwin because Hydra runners do not - # support SSE3, SSSE3, SSE4.1 and SSE4.2 at this time. This is - # required by wasmtime. Given this is very specific to Hydra - # runners, just disable tests on this platform, so we don't get - # false positives of this package being broken due to failed runs on - # Hydra (e.g. https://hydra.nixos.org/build/187667794/) - doCheck = (stdenv.system != "x86_64-darwin"); - cargoTestFlags = [ - "--package wasmtime-runtime" - ]; + # SIMD tests are only executed on platforms that support all + # required processor features (e.g. SSE3, SSSE3, SSE4.1 and SSE4.2 on x86_64): + # https://github.com/bytecodealliance/wasmtime/blob/207cd1ce15ecc504dafaec490c5eae801cac4691/cranelift/codegen/src/isa/x64/mod.rs#L228 + doCheck = with stdenv.buildPlatform; (isx86_64 -> sse3Support && ssse3Support && sse4_1Support && sse4_2Support); + cargoTestFlags = ["--package" "wasmtime-runtime"]; postInstall = '' # move libs from out to dev @@ -45,7 +37,8 @@ rustPlatform.buildRustPackage rec { ''; meta = with lib; { - description = "Standalone JIT-style runtime for WebAssembly, using Cranelift"; + description = + "Standalone JIT-style runtime for WebAssembly, using Cranelift"; homepage = "https://github.com/bytecodealliance/wasmtime"; license = licenses.asl20; maintainers = with maintainers; [ ereslibre matthewbauer ]; -- cgit 1.4.1