From 0dfb439b0e866a51741478dbe7a26b913ae934f9 Mon Sep 17 00:00:00 2001 From: Dom Rodriguez Date: Fri, 18 Sep 2026 22:45:45 +0100 Subject: [PATCH 1/4] buildstream: re-enable tests fixed upstream test_fixed_cas_import, test_random_cas_import, and test_source_pull_partial_fallback_fetch were previously disabled but now pass cleanly against buildstream 2.8.0. Confirmed via a full nix build .#buildstream -L test run. Assisted-by: Claude Code (claude-sonnet-5) --- pkgs/by-name/bu/buildstream/package.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pkgs/by-name/bu/buildstream/package.nix b/pkgs/by-name/bu/buildstream/package.nix index 43f55b73362e..4fac8d5fdf28 100644 --- a/pkgs/by-name/bu/buildstream/package.nix +++ b/pkgs/by-name/bu/buildstream/package.nix @@ -92,18 +92,11 @@ python3Packages.buildPythonApplication (finalAttrs: { # Error loading project: project.conf [line 37 column 2]: Failed to load source-mirror plugin 'mirror': No package metadata was found for sample-plugins "test_source_mirror_plugin" - # AssertionError: assert '1a5528cad211...0bbe5ee314c14' == '2ccfee62a657...52dbc47203a88' - "test_fixed_cas_import" - "test_random_cas_import" - # Runtime error: The FUSE stager child process unexpectedly died with exit code 2 "test_patch_sources_cached_1" "test_patch_sources_cached_2" "test_source_cache_key" "test_custom_transform_source" - - # Blob not found in the local CAS - "test_source_pull_partial_fallback_fetch" ]; disabledTestPaths = [ From 82468e01a35b4ad6624e9ceb2d96ff6f86032d2c Mon Sep 17 00:00:00 2001 From: Dom Rodriguez Date: Fri, 18 Sep 2026 22:46:05 +0100 Subject: [PATCH 2/4] buildstream: fix tests/internals/cascache.py sandbox shebang The dummy buildbox-casd scripts these tests spawn use a `#!/usr/bin/env sh` shebang. `/usr/bin/env` doesn't exist inside the Nix build sandbox (no FHS paths), so exec of the script fails with FileNotFoundError before it ever runs. Rewrite the shebang to an absolute store path via runtimeShell in postPatch, and drop the disabledTestPaths exclusion for the whole file now that all four tests pass. Assisted-by: Claude Code (claude-sonnet-5) --- pkgs/by-name/bu/buildstream/package.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/bu/buildstream/package.nix b/pkgs/by-name/bu/buildstream/package.nix index 4fac8d5fdf28..686fcc2d5f73 100644 --- a/pkgs/by-name/bu/buildstream/package.nix +++ b/pkgs/by-name/bu/buildstream/package.nix @@ -3,6 +3,7 @@ python3Packages, fetchFromGitHub, gitUpdater, + runtimeShell, # buildInputs buildbox, @@ -72,6 +73,13 @@ python3Packages.buildPythonApplication (finalAttrs: { patch ]; + # The dummy buildbox-casd scripts spawned by tests/internals/cascache.py use + # an `/usr/bin/env sh` shebang, which doesn't exist in the Nix build sandbox. + postPatch = '' + substituteInPlace tests/internals/cascache.py \ + --replace-fail '#!/usr/bin/env sh' '#!${runtimeShell}' + ''; + pythonImportsCheck = [ "buildstream" ]; nativeCheckInputs = [ @@ -99,11 +107,6 @@ python3Packages.buildPythonApplication (finalAttrs: { "test_custom_transform_source" ]; - disabledTestPaths = [ - # FileNotFoundError: [Errno 2] No such file or directory: '/build/source/tmp/popen-gw1/test_report_when_cascache_exit0/buildbox-casd' - "tests/internals/cascache.py" - ]; - postInstall = '' installShellCompletion --cmd bst \ --bash src/buildstream/data/bst \ From 559968897f162beef3f61776d97bdace8b65b3c2 Mon Sep 17 00:00:00 2001 From: Dom Rodriguez Date: Fri, 18 Sep 2026 22:46:21 +0100 Subject: [PATCH 3/4] buildstream: install sample-plugins fixture for pip mirror test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_source_mirror_plugin[pip] loads a source-mirror plugin via a `pip` origin, which resolves the plugin package through importlib.metadata. Build the `sample-plugins` test fixture package (shipped in buildstream's own tests/plugins/sample-plugins) and add it to nativeCheckInputs so its entry-point metadata is visible. Note: pyproject = true; build-system = [ setuptools ]; is required here even though the fixture only has a setup.py — setuptools synthesizes the PEP 517 backend for legacy projects. pyproject = false without a Makefile silently no-ops the build and install phases, producing an empty package. Assisted-by: Claude Code (claude-sonnet-5) --- pkgs/by-name/bu/buildstream/package.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/bu/buildstream/package.nix b/pkgs/by-name/bu/buildstream/package.nix index 686fcc2d5f73..11bc1d1e7f59 100644 --- a/pkgs/by-name/bu/buildstream/package.nix +++ b/pkgs/by-name/bu/buildstream/package.nix @@ -94,12 +94,20 @@ python3Packages.buildPythonApplication (finalAttrs: { python3Packages.pytest-xdist python3Packages.pytestCheckHook versionCheckHook + + # Test fixture plugin package used by test_source_mirror_plugin[pip]; upstream + # normally installs this via tox before running the pip-origin plugin loading test. + (python3Packages.buildPythonPackage { + pname = "sample-plugins"; + version = "1.2.3"; + pyproject = true; + build-system = [ python3Packages.setuptools ]; + src = "${finalAttrs.src}/tests/plugins/sample-plugins"; + dontCheck = true; + }) ]; disabledTests = [ - # Error loading project: project.conf [line 37 column 2]: Failed to load source-mirror plugin 'mirror': No package metadata was found for sample-plugins - "test_source_mirror_plugin" - # Runtime error: The FUSE stager child process unexpectedly died with exit code 2 "test_patch_sources_cached_1" "test_patch_sources_cached_2" From 31855cbdfa38faddced5c020a9ce343f926d9b06 Mon Sep 17 00:00:00 2001 From: Dom Rodriguez Date: Fri, 18 Sep 2026 23:03:06 +0100 Subject: [PATCH 4/4] buildstream: avoid FUSE in checkPhase, force hardlink/copy staging /dev/fuse is not available inside the Nix build sandbox, so buildbox-casd's default staging strategy (FUSE, preferred whenever the buildbox-fuse binary is present) crashes at runtime with "The FUSE stager child process unexpectedly died with exit code 2" the moment a test actually stages a CAS directory. buildbox-casd supports a BUILDBOX_STAGER environment variable (casd/buildboxcasd_server.cpp in the buildbox source) that selects the staging backend explicitly; BUILDBOX_STAGER=copy-or-link forces the always-available hardlink/copy stager and skips FUSE entirely. This is a real, supported staging mode, not a workaround. Exporting it in preCheck fixes all four previously-disabled tests (test_patch_sources_cached_1, test_patch_sources_cached_2, test_source_cache_key, test_custom_transform_source), so the disabledTests exclusion for them is removed. The full test suite now passes with zero exclusions. Assisted-by: Claude Code (claude-sonnet-5) --- pkgs/by-name/bu/buildstream/package.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/bu/buildstream/package.nix b/pkgs/by-name/bu/buildstream/package.nix index 11bc1d1e7f59..d4da8b03c5be 100644 --- a/pkgs/by-name/bu/buildstream/package.nix +++ b/pkgs/by-name/bu/buildstream/package.nix @@ -80,6 +80,14 @@ python3Packages.buildPythonApplication (finalAttrs: { --replace-fail '#!/usr/bin/env sh' '#!${runtimeShell}' ''; + # /dev/fuse is not available inside the Nix build sandbox, so buildbox-casd's + # default FUSE-based staging strategy cannot work here. Force the hardlink/copy + # stager instead (this is a real, supported buildbox-casd staging mode, not a + # workaround: https://gitlab.com/BuildGrid/buildbox/buildbox/-/blob/main/casd/buildboxcasd_server.cpp). + preCheck = '' + export BUILDBOX_STAGER=copy-or-link + ''; + pythonImportsCheck = [ "buildstream" ]; nativeCheckInputs = [ @@ -107,14 +115,6 @@ python3Packages.buildPythonApplication (finalAttrs: { }) ]; - disabledTests = [ - # Runtime error: The FUSE stager child process unexpectedly died with exit code 2 - "test_patch_sources_cached_1" - "test_patch_sources_cached_2" - "test_source_cache_key" - "test_custom_transform_source" - ]; - postInstall = '' installShellCompletion --cmd bst \ --bash src/buildstream/data/bst \