Skip to content

Add regression test for install_cargo_config PermissionError path#312

Open
dwoz wants to merge 2 commits into
mainfrom
regression-test-issue-252
Open

Add regression test for install_cargo_config PermissionError path#312
dwoz wants to merge 2 commits into
mainfrom
regression-test-issue-252

Conversation

@dwoz

@dwoz dwoz commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

install_cargo_config catches PermissionError from get_toolchain — that error surfaces on non-root installs where the process can't create DATA_DIR (e.g. salt-master running as the salt user against a /opt/saltstack/salt install). A prior refactor lost the toolchain = None initializer before the try/except, so the subsequent if not toolchain: check fired UnboundLocalError instead of degrading quietly. Commit d0df0af ("Fix missing toolchain variable") restored the initializer but landed without a test to keep future refactors honest.

Add a stubbed test that forces get_toolchain to raise PermissionError and asserts install_cargo_config returns cleanly without writing a cargo config. Verified the test fails on the pre-d0df0af code with the exact error from the reporter's traceback
(#252 (comment)), and passes on current main.

dwoz added 2 commits July 6, 2026 23:02
install_cargo_config catches PermissionError from get_toolchain — that
error surfaces on non-root installs where the process can't create
DATA_DIR (e.g. salt-master running as the salt user against a
/opt/saltstack/salt install).  A prior refactor lost the
`toolchain = None` initializer before the try/except, so the
subsequent `if not toolchain:` check fired UnboundLocalError instead
of degrading quietly.  Commit d0df0af ("Fix missing toolchain
variable") restored the initializer but landed without a test to keep
future refactors honest.

Add a stubbed test that forces get_toolchain to raise PermissionError
and asserts install_cargo_config returns cleanly without writing a
cargo config.  Verified the test fails on the pre-d0df0af code with
the exact error from the reporter's traceback
(#252 (comment)),
and passes on current main.
pyzmq 26.2.0's pyproject.toml uses `cmake.targets = ["pyzmq"]`, which
scikit-build-core renamed to `build.targets` starting in 1.0.0 (released
2026-07-06).  pyzmq 26.2.0 leaves scikit-build-core unpinned in
build-system.requires, so `pip install pyzmq==26.2.0` on any host that
resolves scikit-build-core >= 1.0.0 aborts at "Getting requirements to
build wheel" with:

    ERROR: Use build.targets instead of cmake.targets for
    scikit-build-core >= 0.10

That break landed on 2026-07-06 and broke every "Verify Linux" matrix
entry on the next CI run (2026-07-07).  macOS and Windows already xfail
this parametrization for unrelated pre-existing reasons, which is why
only the Linux jobs turned red.  pyzmq 26.4.0 already uses
`build.targets`, so leaving the other three parametrizations green
preserves the coverage the test was providing.

Match the shape of the surrounding xfail block and pin the reason to
the upstream cause so a follow-up bump (pyzmq >= 26.4 in the parametrize
list) can drop this guard cleanly.
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