You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Downstream mkProjectShell dev-shell omits bare python/python3 and pre-commit (image has them) #729
When a downstream project consumes the toolchain via the flake-input / direnv path (vigos.lib.mkProjectShell, nix develop), the resulting dev-shell does not expose bare python / python3 or pre-commit on PATH, even though the OCI image provides all three. python is reachable only via uv run python.
This is a dev-shell ↔ image parity gap for the downstream shell (mkProjectShell), distinct from the testinfra parity work in #666.
Steps to Reproduce
Scaffold a direnv stub into a consumer (install.sh --mode direnv ...).
uv run python --version → works (CPython 3.14.4 from the store)
Expected Behavior
The downstream dev-shell exposes the same core tools as the image (at minimum python3 and pre-commit), or this asymmetry is documented as intentional (uv-first Python, per-project pre-commit).
Actual Behavior
Image: python, python3, pre-commit all present.
Downstream mkProjectShell dev-shell: none of the three on PATH; Python only via uv run.
Image Version/Tag: dev (built from feature/625-nix-claude-migration)
Architecture: AMD64
Additional Context
Found live-testing the direnv/flake-input mode vs commit-action. Related: #640 (downstream flake stub), #666 (image toolchain parity), #625 (master).
Possible Solution
Either add python3 + pre-commit to mkProjectShell's base packages, or document the intended way to invoke them (uv run, project-local pre-commit) in docs/NIX.md.
Reopening: PR #733's implementation (exposing the Nix store python3 on the dev-shell PATH) regressed #698/#700 on FHS hosts — pre-commit then builds the pymarkdown hook env with the Nix interpreter, whose manylinux pyjson5 wheel can't resolve libstdc++ (the #700LD_LIBRARY_PATH rescue is NixOS-gated per #703). Reverted on feature/625-nix-claude-migration (commit 8f778f5) to restore CI; a host-safe re-implementation is in progress.
Deferring: scoped fix is unsound; needs a dedicated rework
The first implementation (PR #733, exposing the Nix store python3 + pre-commit on the dev-shell PATH) regressed #698/#700 on FHS hosts and has been reverted on feature/625-nix-claude-migration (commit 8f778f5). CI is green again. Findings so a future fix doesn't repeat the dead ends:
Root cause
On the FHS CI runner, pre-commit's manylinux-wheel hooks (pymarkdown → pyjson5, a C-extension needing libstdc++.so.6) are meant to run under a uv-downloaded, FHS-compatible CPython (see the UV_PYTHON_DOWNLOADS_JSON_URL / #632/#683 comment in flake.nix). Adding the Nix store python3 to the dev-shell PATH made pre-commit pick that interpreter instead. The Nix python uses the Nix ld-linux (no /etc/ld.so.cache), so the manylinux wheel can't find libstdc++ — and #700's LD_LIBRARY_PATH rescue is NixOS-gated (#703 forbids a global FHS export, which leaks the Nix libstdc++/libm into host just/bash → GLIBC_ABI_DT_X86_64_PLT crashes).
Why a "scoped wrapper" cannot work (verified)
Wrapping the interpreter (makeWrapper python --prefix LD_LIBRARY_PATH): a venv built from the wrapper symlinks venv/bin/python3 → python3.14 → the real binary, bypassing the wrapper. Confirmed locally: LD_LIBRARY_PATH is unset inside the venv. pre-commit's hook venv runs the real interpreter, not the wrapper.
RPATH-patching the interpreter: pyjson5.so is dlopen'd and DT_RUNPATH is non-transitive, so the interpreter's RPATH is not consulted when resolving the extension's libstdc++.
Decouple pre-commit's hook interpreter from the dev-shell PATH python — keep exposing python3 for users, but ensure pre-commit's manylinux hooks still use the uv-downloaded/FHS CPython (e.g. pin the hook interpreter, or keep the store python off the name pre-commit resolves). Preferred; FHS-only-verifiable.
Partial: expose only pre-commit (does not add a store python3 to PATH, so it won't hijack pre-commit's interpreter on CI) and document Python access via uv run. Caveat: a downstream FHS user invoking the Nixpre-commit directly (not uv run pre-commit) would still hit the libstdc++ issue.
Activity
chore(changelog): merge feature branch, resolve CHANGELOG conflict
fix(devshell): expose python3 and pre-commit on dev-shell PATH (#729) (…
chore(changelog): re-sync workspace CHANGELOG mirror
c-vigo commentedon Jun 29, 2026
Reopening: PR #733's implementation (exposing the Nix store
python3on the dev-shell PATH) regressed #698/#700 on FHS hosts — pre-commit then builds thepymarkdownhook env with the Nix interpreter, whose manylinuxpyjson5wheel can't resolvelibstdc++(the #700LD_LIBRARY_PATHrescue is NixOS-gated per #703). Reverted onfeature/625-nix-claude-migration(commit 8f778f5) to restore CI; a host-safe re-implementation is in progress.revert(devshell): drop python3/pre-commit from dev-shell PATH
c-vigo commentedon Jun 29, 2026
Deferring: scoped fix is unsound; needs a dedicated rework
The first implementation (PR #733, exposing the Nix store
python3+pre-commiton the dev-shell PATH) regressed #698/#700 on FHS hosts and has been reverted onfeature/625-nix-claude-migration(commit 8f778f5). CI is green again. Findings so a future fix doesn't repeat the dead ends:Root cause
On the FHS CI runner, pre-commit's manylinux-wheel hooks (
pymarkdown→pyjson5, a C-extension needinglibstdc++.so.6) are meant to run under a uv-downloaded, FHS-compatible CPython (see theUV_PYTHON_DOWNLOADS_JSON_URL/ #632/#683 comment inflake.nix). Adding the Nix storepython3to the dev-shell PATH made pre-commit pick that interpreter instead. The Nix python uses the Nixld-linux(no/etc/ld.so.cache), so the manylinux wheel can't findlibstdc++— and #700'sLD_LIBRARY_PATHrescue is NixOS-gated (#703 forbids a global FHS export, which leaks the Nixlibstdc++/libminto hostjust/bash →GLIBC_ABI_DT_X86_64_PLTcrashes).Why a "scoped wrapper" cannot work (verified)
makeWrapper python --prefix LD_LIBRARY_PATH): a venv built from the wrapper symlinksvenv/bin/python3 → python3.14 → the real binary, bypassing the wrapper. Confirmed locally:LD_LIBRARY_PATHis unset inside the venv. pre-commit's hook venv runs the real interpreter, not the wrapper.pyjson5.soisdlopen'd andDT_RUNPATHis non-transitive, so the interpreter's RPATH is not consulted when resolving the extension'slibstdc++.libstdc++to the hook process isLD_LIBRARY_PATHin its environment — i.e. a global/ancestor export, which is exactly the Nix dev-shell leaks the Nix C++ runtime onto LD_LIBRARY_PATH, breakingjuston non-NixOS hosts #703 leak. There is no clean per-process scoping.Viable directions for a dedicated fix
python3for users, but ensure pre-commit's manylinux hooks still use the uv-downloaded/FHS CPython (e.g. pin the hook interpreter, or keep the store python off the name pre-commit resolves). Preferred; FHS-only-verifiable.pre-commit(does not add a storepython3to PATH, so it won't hijack pre-commit's interpreter on CI) and document Python access viauv run. Caveat: a downstream FHS user invoking the Nixpre-commitdirectly (notuv run pre-commit) would still hit the libstdc++ issue.pymarkdowna non-manylinux hook (the [BUG] pre-commit: source binary hooks (ruff, ruff-format, typos) from the flake for NixOS compatibility #697language: systempattern) so nopyjson5wheel is built — blocked today because pymarkdown isn't in nixpkgs (per the build(nix): expose libstdc++ in dev-shell so pymarkdown runs on NixOS #700 comment).Any fix must be verified on the FHS CI runner (the failure does not reproduce on a NixOS host, where the #700 NixOS-gated injection masks it).
fix(devshell): expose python3 + pre-commit on dev-shell PATH (CI-safe) (
docs: consolidate the migration CHANGELOG + add/ship MIGRATION.md (#751)
c-vigo commentedon Jun 30, 2026
Resolved by #747 (a2f0e54) on the Nix-migration branch (epic #625, PR #670). Closing as part of post-merge backlog hygiene (#677).
chore: release 0.4.0 (#195)
chore: release 0.4.0 (#813)
fix: let extraPackages python env win python3 on PATH (#1246)
fix(action): deny UV_PYTHON in the shellHook env forward (#1357)
chore: release 1.7.0 (#1385)
test: share scaffold fixtures and consolidate nix invocations (#1420)