Skip to content

fix(action): write store bin dirs to GITHUB_PATH in reverse order - #1356

Merged
c-vigo merged 2 commits into
devfrom
bugfix/1351-github-path-order
Aug 7, 2026
Merged

c-vigo merged 2 commits into
devfrom
bugfix/1351-github-path-order

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Summary

The direnv-mode setup-devkit-toolchain step extracts the consumer dev-shell $PATH, filters the /nix/store bin dirs, and wrote them to GITHUB_PATH highest-priority-first. The Actions runner prepends every GITHUB_PATH line in file order (the prepend list is joined reversed when composing the next step's PATH), so following steps ran with the dev-shell PATH exactly reversed.

Invisible while one tool means one store path — which is why every Python/TS consumer stayed green — but fatal for a stdenv toolchain: raw gcc shadowed gcc-wrapper (likewise binutils) and C builds failed with the unwrapped-compiler signature ld.bfd: cannot find Scrt1.o / cannot find -lc, while the same build was green locally under nix develop. First live hit: vig-os/h5v#2 (vendored HDF5 cmake build, run 31160809242).

The store bin dirs are now piped through tac before the write, so the runner's per-line prepend rebuilds the dev-shell order verbatim. Bare-mode's single-line uv tool dir --bin write is unaffected; the env-forward denylist is untouched (that's #1353).

Test plan

  • New test test_devshell_path_priority_survives_github_path: the fake dev-shell PATH now carries a gcc-wrapper-13/bin → gcc-13/bin pair; a _runner_path helper replays the runner's per-line prepend and the test asserts the wrapper precedes the raw compiler AND the full store-bin subsequence equals the dev-shell order — semantics-pinned, no coupling to tac. RED on the old code with the whole order inverted, exactly the issue shape.
  • Full tests/test_setup_toolchain_env.py: 25/25 green (verified independently by reviewer).
  • tests/bats/init-workspace.bats (renders + actionlints the scaffold): 280/280 green.
  • prek run --all-files green.

Refs: #1351

@c-vigo
c-vigo merged commit 474843f into dev Aug 7, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/1351-github-path-order branch August 7, 2026 09:53
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