From e8cb30b11c6221a55135ec929106f54aa60de52c Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sat, 28 Feb 2026 13:19:13 +0100 Subject: [PATCH] testing: fix f2 NIX_BIN_DIR determination from meson `nix.full_path()` is the *built* path, not the *installed* path. in the sandbox this point to a location that contains *only* `nix`, not any of the old-cli symlinks. any test that needs them in path would thus fail. Change-Id: Ia651db8d1151a84f8d1b52e8993f6db61b0fe104 --- package.nix | 4 +++- tests/functional2/meson.build | 2 +- tests/functional2/store/test_local_store.py | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.nix b/package.nix index 23cb95a12..094182fe7 100644 --- a/package.nix +++ b/package.nix @@ -606,8 +606,10 @@ stdenv.mkDerivation (finalAttrs: { mkdir -p $out/nix-support echo "doc internal-api-docs $out/share/doc/nix/internal-api/html" >> "$out/nix-support/hydra-build-products" '' - + '' + + lib.optionalString (sanitize == null) '' # Drop all references to libstd++ include files due to `__FILE__` leaking in libstd++ assertions. + # we do NOT want to do this during asan builds because it breaks the test suite! but as we do not + # actually want to ship asan builds in any reasonable capacity the leak will not matter that much find "$out" -type f -exec remove-references-to -t ${stdenv.cc.cc.stdenv.cc.cc} '{}' + ''; diff --git a/tests/functional2/meson.build b/tests/functional2/meson.build index 13ad95187..cf5519976 100644 --- a/tests/functional2/meson.build +++ b/tests/functional2/meson.build @@ -14,7 +14,7 @@ xdist_opts = [ functional2_env = environment() # set the bin dir for us to know where to find the lix binaries for our declarative path # without leaking all of PATH or env -functional2_env.set('NIX_BIN_DIR', fs.parent(nix.full_path())) +functional2_env.set('NIX_BIN_DIR', bindir) if build_test_shell != '' functional2_env.set('BUILD_TEST_SHELL', build_test_shell) endif diff --git a/tests/functional2/store/test_local_store.py b/tests/functional2/store/test_local_store.py index 00af28142..35ac0495b 100644 --- a/tests/functional2/store/test_local_store.py +++ b/tests/functional2/store/test_local_store.py @@ -40,6 +40,5 @@ class TestLocalStore: assert info["trusted"] def test_doctor_shows_trust(self, nix: Nix): - # doctor wants nix-env on path, and the profile lookup test will *always* fail - result = nix.nix(["--store", "./x", "doctor"]).run().expect(2) + result = nix.nix(["--store", "./x", "doctor"]).run().ok() assert "You are trusted by" in result.stderr_plain