Repository navigation
fix(action): deny UV_PYTHON in the shellHook env forward - #1357
Merged
Merged
Conversation
This was referenced Aug 7, 2026
fix(action): shellHook env forward ships UV_PYTHON to CI, defeating the bare-CPython exclusion
#1353
Closed
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
Two correct mechanisms in the direnv-mode
setup-devkit-toolchaincancelled out. The step drops the bare Nix CPython from the exported PATH and forwardsUV_PYTHON_DOWNLOADS_JSON_URLsouv syncbuilds the runner venv from a downloaded manylinux CPython (#698/#703/#729) — but the shellHook env forward (#1180) diffs the dev-shell env against the ambient env and shipped every added var, includingmkProjectShell'sUV_PYTHONstore-path pin.UV_PYTHONbeats PATH resolution, so the CI venv was built on the Nix interpreter anyway and any C-extension wheel failed under the Nix loader on Ubuntu (ImportError: libstdc++.so.6). First live hit: exo-pet/playground-carlos#9 (numpy 2.4.4, run 31163316165); existing direnv Python consumers were green only because their test deps are pure-Python.UV_PYTHONandUV_PYTHON_DOWNLOADSare now denied by name in the forward's denylist. The second is required for the first: forwarded on its own,UV_PYTHON_DOWNLOADS=never(also set bymkProjectShell) would forbid the very managed-CPython download the JSON-URL forward exists to enable, turning the wheel ImportError into "no interpreter found". Patterns are exact matches, so the deliberateUV_PYTHON_DOWNLOADS_JSON_URLforward is untouched — and now pinned by a test.Denylist audit (per the issue)
Everything else
mkProjectShellsets was reviewed:BATS_LIB_PATHkept (the store is realized on the runner in direnv mode),NVIM_APPNAMEkept (portable),LD_LIBRARY_PATHkept (exported only behind the shellHook's own/etc/NIXOSguard, never reaches a hosted runner).UV_PROJECT_ENVIRONMENT/UV_PYTHON_PREFERENCE/LOCALE_ARCHIVEare image-path-only, not dev-shell exports. Pre-existing leaks outside this issue's scope (PYTHONPATHstore components,IN_NIX_SHELL, missed stdenv machinery likedoCheck/CC/LD) → follow-up issue.Test plan
_DEVSHELL_ENVnow carries all three uv vars;UV_PYTHON+UV_PYTHON_DOWNLOADSadded to the parametrized denylist test (RED before the fix:3 failed, 25 passed, withUV_PYTHONvisibly landing in GITHUB_ENV).test_uv_interpreter_pins_do_not_defeat_the_manylinux_path: both pins absent ANDUV_PYTHON_DOWNLOADS_JSON_URLstill forwarded — the survival assertion did not exist before.nix develop, which made one parametrize case pass spuriously via the unchanged-var filter).tests/test_setup_toolchain_env.py: 28/28 green (verified independently by reviewer);test_renovate_preset_managed_exclusion.py31/31;prek run --all-filesgreen.Refs: #1353