From 4e61c2e270a665700d53e4bbb5d6eade3e6eb611 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Sat, 16 Jan 2021 22:50:54 +0100 Subject: [PATCH 1/3] wasmtime: 0.21.0 -> 0.35.2 --- pkgs/development/interpreters/wasmtime/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/development/interpreters/wasmtime/default.nix index 816b854b99eb2..b3938240e3914 100644 --- a/pkgs/development/interpreters/wasmtime/default.nix +++ b/pkgs/development/interpreters/wasmtime/default.nix @@ -1,24 +1,28 @@ -{ rustPlatform, fetchFromGitHub, lib, python3, cmake, llvmPackages, clang, stdenv, darwin }: +{ rustPlatform, fetchFromGitHub, lib, v8 }: rustPlatform.buildRustPackage rec { pname = "wasmtime"; - version = "0.21.0"; + version = "0.35.2"; src = fetchFromGitHub { owner = "bytecodealliance"; repo = pname; rev = "v${version}"; - sha256 = "0q7wsnq5zdskxwzsxwm98jfnv2frnwca1dkhwndcn9yyz2gyw57m"; + sha256 = "sha256-4oZglk7MInLIsvbeCfs4InAcmSmzZp16XL5+8eoYXJk="; fetchSubmodules = true; }; - cargoSha256 = "1wlig9gls7s1k1swxwhl82vfga30bady8286livxc4y2zp0vb18w"; + cargoSha256 = "sha256-IqFOw9bGdM3IEoMeqDlxKfLnZvR80PSnwP9kr1tI/h0="; nativeBuildInputs = [ python3 cmake clang ]; buildInputs = [ llvmPackages.libclang ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; + configurePhase = '' + export HOME=$TMP; + ''; + doCheck = true; meta = with lib; { From 92442af7da1650713237058155423806fb7ed989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez=20L=C3=B3pez?= Date: Thu, 31 Mar 2022 19:42:34 +0300 Subject: [PATCH 2/3] Fix wasmtime build Provide a specific path for the v8 project, so `wasmtime` dependency `rusty_v8` can find it and does not need to download the static library, what would break build hermetism. --- .../interpreters/wasmtime/default.nix | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/development/interpreters/wasmtime/default.nix index b3938240e3914..33f40eda2ea73 100644 --- a/pkgs/development/interpreters/wasmtime/default.nix +++ b/pkgs/development/interpreters/wasmtime/default.nix @@ -14,16 +14,22 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-IqFOw9bGdM3IEoMeqDlxKfLnZvR80PSnwP9kr1tI/h0="; - nativeBuildInputs = [ python3 cmake clang ]; - buildInputs = [ llvmPackages.libclang ] ++ - lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; - LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; - - configurePhase = '' - export HOME=$TMP; - ''; + # This environment variable is required so that when wasmtime tries + # to run tests by using the rusty_v8 crate, it does not try to + # download a static v8 build from the Internet, what would break + # build hermetism. + RUSTY_V8_ARCHIVE = "${v8}/lib/libv8.a"; doCheck = true; + checkFlags = [ + "--skip=cli_tests::run_cwasm" + "--skip=commands::compile::test::test_successful_compile" + "--skip=commands::compile::test::test_aarch64_flags_compile" + "--skip=commands::compile::test::test_unsupported_flags_compile" + "--skip=commands::compile::test::test_x64_flags_compile" + "--skip=commands::compile::test::test_x64_presets_compile" + "--skip=traps::parse_dwarf_info" + ]; meta = with lib; { description = "Standalone JIT-style runtime for WebAssembly, using Cranelift"; From 78fb28c182983b0119099330164cc7722dcd2978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez=20L=C3=B3pez?= Date: Sun, 3 Apr 2022 13:08:44 +0300 Subject: [PATCH 3/3] wasmtime: make derivation available only on linux for now --- pkgs/development/interpreters/wasmtime/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/development/interpreters/wasmtime/default.nix index 33f40eda2ea73..7f00faa76476b 100644 --- a/pkgs/development/interpreters/wasmtime/default.nix +++ b/pkgs/development/interpreters/wasmtime/default.nix @@ -36,6 +36,6 @@ rustPlatform.buildRustPackage rec { homepage = "https://github.com/bytecodealliance/wasmtime"; license = licenses.asl20; maintainers = [ maintainers.matthewbauer ]; - platforms = platforms.unix; + platforms = platforms.linux; }; }