Commit 76836dee authored by Rafael Fernández López's avatar Rafael Fernández López Committed by Alyssa Ross
Browse files

wasmtime: run tests depending on the platform features

Run tests depending on the platform features reported by stdenv.
parent 8a4c408a
Loading
Loading
Loading
Loading
+8 −15
Original line number Diff line number Diff line
@@ -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 ];