Repository navigation
fix(tools): make the scripts that start with a shebang executable - #9547
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The fix is narrowly scoped and the new mode regression is registered. I verified all four files are 100644 with a shebang on current main; in an isolated Git-index fixture the new test fails listing all four, then passes after they are staged as 100755. All four scripts execute from the PR snapshot. The current-main ancestry check passes and the branch overlap scan reports no duplicate tool changes. However, it cannot compare old-base #6044’s root CMakeLists.txt. Manual diff inspection shows #6044 rewrites the exact adjacent add_test(NAME trace_digest...) and add_test(NAME conventions_bom_shebang...) entries where this PR inserts tool_script_modes; the pairwise merge reports a root CMake conflict. The repository requires author coordination and a Depends on entry when shared lines need ordering. Please coordinate with #6044’s author and record the agreed order; if #9547 follows #6044, declare that dependency and ensure the test uses the final registration convention. I’m requesting changes for that missing order record only. Eligibility, conventions, intake and labels pass; relinker CI is still running, and platform product jobs are skipped. I ran the focused mode test in a temporary Git fixture, not the full project build.
|
CI update: the relinker run 39705282984 has now completed successfully on Ubuntu, Windows, macOS arm64 and macOS x86_64, including the ASAN coverage job. The platform product-build jobs were skipped by the repository workflow. My requested author coordination and |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
I reran the mode regression locally from the PR snapshot staged into an isolated Git index: |
MarcZX10
left a comment
There was a problem hiding this comment.
The focused tests pass locally: the PR snapshot test passes 1/1, the script-registration unit suite passes 40/40, and all four scripts launch with --help; conventions and diff-check also pass. Two repository requirements remain: coordinate the conflicting root CMake registration hunk with open #6044 and record the order/Depends on if required; and update this branch to current upstream/main 4777cac (it is 1 ahead/119 behind, merge base a6dcea9), then rerun checks. Product builds were not run.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
8ee787d to
680c143
Compare
|
@MarcZX10 thanks, I updated the branch to current On the order with #6044: #9547 stays Proposed order: this PR first. The new entry comes along as a plain @TaymKal, as the author of #6044: does this order work for you? If #9547 is merged before your rebase, please include AI-assisted (Claude Code). |
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed 680c14387173 against author merge base 83462cc57dde. No actionable findings in this focused review.
Source review: The four shebang scripts change only their tracked modes from 100644 to 100755; Git confirms unchanged script blobs. The new test checks index modes rather than Windows filesystem permissions, and its CMake registration preserves a 20-second timeout. Python-interpreter invocation remains unchanged.
Validation: Windows x64 / CPython 3.11: the mode test passes without skips. Grafting it onto the baseline index fails one assertion listing precisely the four non-executable scripts. All four Python --help smoke checks return zero. Conventions, whitespace and script registration pass. Effective hosted relinker matrix/ASan and conventions jobs succeed; product jobs are skipped.
Scope: Local evidence establishes tracked modes, unchanged contents and CLI compatibility. Direct POSIX shebang execution was not independently run locally; no full application build is claimed.
|
Both points of the review of 22 October are resolved:
Run on that merge result, on Windows 10 with Python 3.12.10: Not run: a product build (the change and its test touch only Python scripts and file modes), and nothing was rerun on Linux or macOS on this merge result. The head has an approving review since 24 October. Could you re-review the current head? I can rebase onto AI-assisted (Claude Code). |
jotitadev
left a comment
There was a problem hiding this comment.
The new test fails once this branch is merged with current main.
Head 680c143871 merged (--no-commit) onto main abed035468, clean merge. python3 -I tools/tests/test_tool_script_modes.py (Apple M2 Max, macOS 27.2, /usr/bin/python3 3.9.6):
AssertionError: Lists differ: ['tools/annotate_module.py has a shebang but mode 100644'] != []
tools/annotate_module.py arrived on main after this branch's base (added in 72f397a374, last touched in d1ac8d9117). It starts with #!/usr/bin/env python3 and is tracked as 100644, so it needs the same 100755 mode as the other four. The green CI run on this PR predates it, so main would go red on tool_script_modes after the merge.
With annotate_module.py also staged as 100755 (git update-index --chmod=+x), the test passes on the merged tree.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
tools/annotate_module.py starts with a shebang and was added to main after this branch was cut, so tool_script_modes fails on the merged tree with "tools/annotate_module.py has a shebang but mode 100644". Staging it as 100755 like the four scripts of the first commit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
As jotitadev reported, the new AI-assisted (Claude Code). |
jotitadev
left a comment
There was a problem hiding this comment.
Re-checked head c3db7f2e92 as asked: fixed.
Apple M2 Max, macOS 27.2, /usr/bin/python3 3.9.6. Head merged (--no-commit, clean) onto current main 2812b2987b, which is 274 commits past the 09f9a63f6b you merged.
python3 -I tools/tests/test_tool_script_modes.py: OK. No other shebang script undertools/is tracked as100644on the merged tree.- Red control: with
tools/annotate_module.pystaged back to100644, the test fails with the same message as before (tools/annotate_module.py has a shebang but mode 100644). - Relinker-only Release build, arm64, full suite: 357/357, including
tool_script_modes(mainalone: 356/356).
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed c3db7f2e929c0f2ba19f2c7d5c7b97e20cda487e against 09f9a63f6b85aec9f36ce5d0d46f41c37cbd86fd.
Re-reviewed the updated executable-mode change. All five changed tool scripts now have tracked mode 100755; each script blob is identical to its author-base blob. The regression reads Git index modes, so Windows filesystem permission emulation does not weaken this check. The CMake entry retains a 20-second timeout. No actionable finding.
Windows/Python 3.11: the mode regression passes without skips, and all five scripts' Python --help invocations exit 0. Independently checked the mode/blob pairs with git ls-tree. This verifies tracked executable flags and interpreter invocation; direct POSIX shebang execution was not independently rerun locally.
MarcZX10
left a comment
There was a problem hiding this comment.
Re-reviewed exact head c3db7f2e929c0f2ba19f2c7d5c7b97e20cda487e against current main aaccd0ba39. The merge preview is clean; its effective change against current main is limited to the five executable mode bits, the tool_script_modes test, and its CMake registration. The test checks Git-index modes for tracked Python tools with shebangs, which avoids relying on Windows permission emulation. The author and other reviewers report the focused regression passing on Windows and macOS, including a negative control for annotate_module.py; the hosted relinker jobs pass on this head. I did not run the Python test locally. No product build is applicable to this mode-and-test change.
|
Thanks for the hint. Before the new commit, on the merge with #21454, opened on 16 November, sets the same six modes; whichever of the two is merged first leaves the other with nothing to change. Could you re-review the new head? AI-assisted (Claude Code). |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the change makes the shebang tools executable and adds a test that guards their tracked modes.
What I ran
Reviewed head 71dec9824466ec464b1894c146accd7e114b53ab and the prepared diff. No commands or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed code | passed | Mode changes and test registration reviewed |
| Tests | not run | Only author-reported results are available |
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests were run. Author-reported Windows and WSL2 results were not independently verified. The full text of these changed files was not read because their changes only alter file modes: tools/annotate_module.py, tools/check_compile.py, tools/export_gap.py, tools/nid_names.py, tools/stubgen.py, and tools/unwrap_self.py. All changed files are listed as included in the manifest; no exclusions were listed.
To get this to a good state
Nothing is required.
What
tools/check_compile.py,tools/nid_names.py,tools/stubgen.pyandtools/unwrap_self.pystart with#!/usr/bin/env python3but were committed with mode 100644, so running them directly on Linux fails withPermission denied(exit code 126). They now have mode 100755. A new test,tool_script_modes, reads the index withgit ls-files -sand fails for any trackedtools/*.pythat has a shebang and a mode other than 100755 (it skips outside a Git checkout). The docs call the tools throughpython3, which is unaffected.Tested
Windows 10, Python 3.12:
python -I tools/tests/test_tool_script_modes.pyfails onmainwith the four files listed (mode 100644) and passes with the change;test_test_registration.pypasses andtools/check_test_registration.py --scriptsaccepts the newadd_test(171 test scripts).tools/check_conventions.py --base upstream/mainpasses. Linux (WSL2, Ubuntu 24.04, a virtualised kernel, not bare-metal Linux):./tools/<name>.py --helpreturns 126 onmainand 0 for all four with the change; the new test passes. Not tested: macOS.Order
Order with #6044: #6044 was closed on 24 October without being merged, so there is nothing to coordinate.
mainstill registers these tests with plainadd_test.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)AI-assisted (Claude Code).