Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(test): don't write through seeded uname symlink in prereq-parity tests (unblock CI)#1143

Merged
thinmintdev merged 1 commit into
mainfrom
fix/prereq-parity-symlink-write
Jul 6, 2026
Merged

fix(test): don't write through seeded uname symlink in prereq-parity tests (unblock CI)#1143
thinmintdev merged 1 commit into
mainfrom
fix/prereq-parity-symlink-write

Conversation

@thinmintdev

Copy link
Copy Markdown
Contributor

tests/installer/test_bootstrap_prereq_parity.py::TestNonLinuxHost fails on the GitHub runner with PermissionError: [Errno 13] ... /bin/uname — currently red on main (regression from #1098/#1139, which merged green off a box-local run).

Cause: full_bin_dir seeds PATH tools as symlinks to the real binaries; _fake_uname_write_exe used write_text(), which follows the symlink and rewrites the host's /usr/bin/uname. Denied on a locked-down runner; on a root box it silently mutates the real binary.

Fix: _write_exe unlinks the path first, replacing the seeded symlink with a regular file.

Verified: pytest tests/installer/test_bootstrap_prereq_parity.py → 15 passed; ruff clean. Test-only.

🤖 Generated with Claude Code

…ity tests

full_bin_dir seeds PATH tools as symlinks to the real binaries; _fake_uname
then overwrote `uname` via write_text(), which FOLLOWS the symlink and
rewrites the host's /usr/bin/uname → PermissionError on the CI runner
(TestNonLinuxHost::test_darwin_is_rejected / test_linux_is_accepted), or
silent mutation of the real binary when the suite runs as root. _write_exe
now unlinks first so it replaces the symlink with a regular file.

Unblocks CI on main (regression from #1098/#1139 merged green off a
box-local run where /usr/bin/uname was writable).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@thinmintdev thinmintdev merged commit 004f7da into main Jul 6, 2026
3 checks passed
@thinmintdev thinmintdev deleted the fix/prereq-parity-symlink-write branch July 6, 2026 06:59
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