Repository navigation
fix(action): strip store paths and stdenv machinery from the env forward - #1361
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to the #1353 denylist audit: the shellHook env forward (#1180) still shipped Nix-host state to
GITHUB_ENV. Three leaks closed:PYTHONPATHstore components are stripped, not blanket-denied. The nixpkgs python setup hook fillsPYTHONPATHwith store site-packages dirs; forwarded to CI they land on the sys.path of the downloaded manylinux CPython — same ABI tag, importable, exactly the mixed-loader shape behind fix(action): shellHook env forward ships UV_PYTHON to CI, defeating the bare-CPython exclusion #1353'sImportError: libstdc++.so.6. The forward loop now splits the value on:, drops/nix/store/*components, forwards the remainder, and skips the var when nothing is left — so the legitimateexport PYTHONPATH=$PWD/srcshellHook use case survives verbatim. PYTHONPATH only, by design; the pattern is noted as reusable._PYTHON_HOST_PLATFORM,_PYTHON_SYSCONFIGDATA_NAME,DETERMINISTIC_BUILD,CONFIG_SHELL,do[A-Z]*(the symmetric partner of the existingdont*), and the cc/binutils hook namesAR AS CC CXX LD NM OBJCOPY OBJDUMP RANLIB READELF SIZE STRINGS STRIP. stdenv sets those in every dev shell as bare names (CC=gcc); inside dev-shell context the wrapped toolchain already wins via PATH (fix(action): setup-devkit-toolchain GITHUB_PATH export reverses dev-shell PATH order #1351), while for steps running outside it a forwardedCCrecreates the mixed-toolchain hazard. Two known collisions, both assessed and accepted: the pre-fix(action): setup-devkit-toolchain GITHUB_PATH export reverses dev-shell PATH order #1351 h5v CC/CXX shellHook workaround (superseded — fix(action): setup-devkit-toolchain GITHUB_PATH export reverses dev-shell PATH order #1351 removed the need) and thenativecapability module'sCC=cc/CXX=c++exports (those generic names exist precisely so build backends fall back to PATH discovery, whichGITHUB_PATHalready provides on CI).IN_NIX_SHELL— no CI step should claim to run inside a nix shell. The.githooksguard that reads it is local-only (no scaffold workflow commits through it).The NixOS-self-hosted PATH-filter gap found in the same audit is split out as #1360 and untouched here, as are the
UV_PYTHON*entries (#1353) and theGITHUB_PATHwrite (#1351).Test plan
10 failed, 29 passed, each var visibly landing in GITHUB_ENV.nix develop, where stdenv exportsCC,CONFIG_SHELL,PYTHONPATH,IN_NIX_SHELL, … ambiently — the step's unchanged-var filter would have masked the denylist under test. The subprocess env scrub is now derived from the fixture list instead of a hand-kept 3-var set.tests/test_setup_toolchain_env.py+test_renovate_preset_managed_exclusion.py: 42/42 green (verified independently by reviewer); rendered-workflow actionlint bats 5/5;prek run --all-filesgreen.Follow-up candidate
docs/MIGRATION.mdenumerates the denylist in prose and is now stale for both #1353 and #1358 — left untouched per minimal-diff scope; happy to file a docs issue.Refs: #1358