Skip to content

fix(action): keep the Nix CPython and uv pins on NixOS runners - #1363

Merged
c-vigo merged 2 commits into
devfrom
bugfix/1360-nixos-runner-python-path
Aug 7, 2026
Merged

c-vigo merged 2 commits into
devfrom
bugfix/1360-nixos-runner-python-path

Conversation

@c-vigo

@c-vigo c-vigo commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The direnv-mode setup-devkit-toolchain PATH filter (#1028) drops the bare Nix CPython whenever pyproject.toml is present — unconditionally. On hosted FHS runners that is correct (uv builds the venv from a downloaded manylinux CPython). On a NixOS self-hosted runner it is wrong by construction: a manylinux CPython cannot execute there, and after #1353 the UV_PYTHON/UV_PYTHON_DOWNLOADS pins that used to accidentally mask this no longer reach CI. No current consumer hits the combination — this defuses the landmine before the first Python consumer targets a NixOS runner.

The step now probes the runner host once (/etc/NIXOS, the probe mkProjectShell's own shellHook already uses; DEVKIT_NIXOS_MARKER overrides it solely for the test harness) and branches:

  • NixOS runner: the CPython exclusion is skipped (the store interpreter is the only one that can run) AND the UV_PYTHON/UV_PYTHON_DOWNLOADS forwards are allowed (the mkProjectShell pins are exactly correct there). Both halves are needed — keeping the interpreter on PATH alone is not enough, since uv's python-preference can still pick a managed download.
  • FHS runner: byte-identical to today, pinned by a new regression-bar test (the [BUG] setup-devkit-toolchain applies python/uv CI env unconditionally on non-python consumers #1028 exclusion previously had no test at all).

Test plan

  • Stub dev-shell PATH now carries a python3-3.14.6/bin store dir; harness gained pyproject/nixos knobs.
  • New tests: FHS drops exactly the CPython dir and nothing else (green throughout — the regression bar); NixOS keeps it (RED→GREEN); NixOS forwards both uv pins (RED→GREEN). RED run: exactly the two NixOS tests failed.
  • Hermeticity: the harness always pins DEVKIT_NIXOS_MARKER to a per-test path whose existence is the switch. This machine IS NixOS, and the pin was proven load-bearing: removing it flips 4 FHS-branch tests red (including the pre-existing fix(action): shellHook env forward ships UV_PYTHON to CI, defeating the bare-CPython exclusion #1353 denial tests, which would otherwise silently test the wrong branch on any NixOS host).
  • Full tests/test_setup_toolchain_env.py + renovate-preset file: 45/45 green (verified independently by reviewer); rendered-workflow actionlint bats 5/5; prek run --all-files green.

Refs: #1360

@c-vigo c-vigo added this to the 1.6.1 milestone Aug 7, 2026
@c-vigo
c-vigo merged commit b7b4bbb into dev Aug 7, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/1360-nixos-runner-python-path branch August 7, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant