Repository navigation
Fix #1007: doctor.sh's below-floor FAIL Python line now names the floor - #1062
Merged
Merged
Conversation
detect-tools.sh's FATAL text for every-candidate-below-floor named each rejected candidate's version but never the floor those versions were measured against. doctor.sh relayed that text unchanged in its "FAIL Python:" line, so neither surface told a user which version to install. detect-tools.sh cannot grow the message itself -- it is inlined into every compiled hook and #1005 left only 37 bytes of budget under the compiled session-start-hook.sh size cap (#1006). doctor.sh is not inlined, so the fix lives there instead: it re-sources detect-tools.sh in lazy mode (skips the candidate probe and its `exit 1`, needing only the floor constants that file sets as plain variables) to recover the floor and append "need Python X.Y+ -- install a newer Python." to the FAIL line, the same convention as doctor's existing below-floor WARN for the cache-hit backstop (#1003). Co-Authored-By: Claude Sonnet 5 <[email protected]>
The self-review of f11dddd flagged two comment blocks in detect-tools.sh (the USAGE header and the "Lazy mode (#662)" block) that enumerated which sourcers set _REMEMBER_LAZY_PYTHON=1 and said only session-start-hook.sh does -- no longer true, since doctor.sh's new FAIL-path floor lookup also sets it, inside its own throwaway `$(...)` subshell. Note both spots that doctor.sh's main execution still uses the real, eager probe, and that the new use is a second, unrelated purpose scoped to that subshell alone. Co-Authored-By: Claude Sonnet 5 <[email protected]>
tests/test_doctor_fatal_floor_1007.py (added in f11dddd) carries a module-level pytest.mark.skipif(sys.platform == "win32", ...), the pattern docs/windows-skip-triage.md requires a row for in the same commit as the convention it violated. Caught by the audit's platform-band check plus tests/test_windows_skip_triage_497.py itself, which already fails without this row. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up from the review of #1005 (fixes #1003): when every Python on PATH is
below the supported floor,
scripts/detect-tools.sh'sFATAL: below the floor this plugin supports:text names each rejected candidate's version but never the floorthose versions were measured against, and
scripts/doctor.shrelayed that textunchanged in its
FAIL Python:line -- so a user reading either one could not tellwhich version to install without reading the source.
detect-tools.shitself is left unchanged (beyond two stale comments fixed inself-review, see below): it is inlined into every compiled hook, and #1005 left only
37 bytes of budget under the 122,880-byte compiled-hook-script cap (#1006), so growing
its own FATAL message was not an option.
doctor.shis not inlined, so the fix livesthere instead: on the FAIL path it now re-sources
detect-tools.shin lazy mode(
REMEMBER_LAZY_PYTHON=1) inside a throwaway$(...)subshell purely to recover the_REMEMBER_PY_FLOOR_MAJOR/_MINORconstants, then appends" need Python X.Y+ -- install a newer Python." under the existing FAIL line, once a
^[0-9]+\.[0-9]+$regex confirms the recovered value looks like a real floor.Closes #1007
Verified
.github/scripts/build_release_tree.py, then ran.github/scripts/check_release_tree.pyagainst it --session-start-hook.shisexactly 122843 bytes (unchanged from the documented pre-detect-tools FATAL for a below-floor Python does not name the floor (3.9) #1007 baseline), no FAIL
line for it. Comment-only changes to
detect-tools.share fully stripped by thereal build pipeline.
1 failed, 1 passedwith the doctor.sh fix stashed out -- the failurenamed the exact missing floor/install text), green (
2 passed in 0.93s), plusadjacent regression (
tests/test_detect_tools_floor_1003.py+tests/test_doctor_consolidation_1003.py+ the new file together:15 passed).python3 .oss/assemble_changelog.py --checkpasses.Self-review
Two commits beyond the core fix, both from spawned self-review:
scripts/detect-tools.shthat wrongly claimed only
session-start-hook.shever sets_REMEMBER_LAZY_PYTHON=1-- made false by this fix's own FAIL-path lookup. Fixed.win32skip was not yet triaged indocs/windows-skip-triage.mdper this repo'sown convention. Fixed by adding the row.
tests/test_doctor_*.pyfiles carry a blanket win32 skip even thoughwindows-latest CI legs run
shell: bash) that is out of this one-issue diff'sfootprint and is left for its own issue/PR rather than fixed here.
Test plan
python3 -m pytest tests/test_doctor_fatal_floor_1007.py -q --no-cov(red thengreen, both reproduced by a reviewer independently welcome)
python3 -m pytest tests/test_detect_tools_floor_1003.py tests/test_doctor_consolidation_1003.py tests/test_doctor_fatal_floor_1007.py -q --no-cov(no regression)python3 -m pytest tests/test_windows_skip_triage_497.py -q --no-covCI is the gate)
🤖 Generated with Claude Code
[AI-generated]