From 1bf8828bc7d52d27c6e1da89903f7d7db77a49b8 Mon Sep 17 00:00:00 2001 From: Will Cohen Date: Sat, 18 Apr 2026 13:44:54 -0400 Subject: [PATCH] binaryen: patch lld.py to match '64' on basename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scripts/test/lld.py adds --enable-memory64 --bigint when '64' appears anywhere in the input path. The full Nix build directory is included, and its nonce digits can contain '64' — non-deterministically triggering the memory64 flags on unrelated tests (e.g. lld/duplicate_imports.wat) and causing output mismatches. Match on basename instead. --- pkgs/development/compilers/binaryen/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/compilers/binaryen/default.nix b/pkgs/development/compilers/binaryen/default.nix index d521ff984c1c..c6c86cecc7a8 100644 --- a/pkgs/development/compilers/binaryen/default.nix +++ b/pkgs/development/compilers/binaryen/default.nix @@ -41,6 +41,12 @@ stdenv.mkDerivation rec { sed -i '/gtest/d' third_party/CMakeLists.txt rmdir test/spec/testsuite ln -s ${testsuite} test/spec/testsuite + # scripts/test/lld.py checks `'64' in input_path` to enable the + # memory64/bigint flags; the full Nix build path leaks digits that + # can accidentally contain "64", wrongly triggering those flags for + # non-memory64 tests (e.g. duplicate_imports.wat). Match on basename. + substituteInPlace scripts/test/lld.py \ + --replace-fail "'64' in input_path" "'64' in os.path.basename(input_path)" else cmakeFlagsArray=($cmakeFlagsArray -DBUILD_TESTS=0) fi