Repository navigation
fix(tools): reject unmodeled save-temps modes in syntax checks - #11868
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
I reviewed exact head fe80227fce02056fefbcbacaaa9aaec4cf823517. The new guard rejects unsupported joined -save-temps= / --save-temps= values before invoking the compiler, while the exact supported cwd and obj forms remain handled by DROP. The regression checks both spellings and several invalid values with a compiler marker to prove no compiler invocation or output file occurs.
I ran python3 -m unittest tools.tests.test_check_compile tools.tests.test_check_compile_modes from this head: 77 tests passed, 14 skipped. The new regression ran and passed. The open #11522 change also edits syntax_arguments; a three-way merge preview against its current head is clean, and the edits apply at separate locations.
Hosted policy checks and ASan pass. Linux, Windows and both macOS relinker jobs are still pending; the full 361-case hosted suite has not completed yet. I found no actionable code issue in this review, but I am leaving this as a comment until the platform jobs finish.
|
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
The previously pending Ubuntu, Windows, both macOS relinker jobs, and ASan checks have now completed successfully. The 77 focused Python tests (14 skipped) passed in the reviewed head, including the new regression; the merge preview against #11522 was clean. I found no actionable issue in the exact reviewed diff. Product-level Linux/Windows jobs are skipped by repository policy, so this approval covers the tooling change and checks listed above.
|
Windows run of this head
AI-assisted: yes (Claude Code) |
What
A recorded compile command can carry
-save-temps=<value>with a value other than the strippedcwdandobjmodes. The syntax check passes such a joined form to the compiler, assuming an unknown mode is rejected there (6229cd07ebmade the test skip whenever a compiler accepts unknown modes). Newer Clang builds do accept them: any value is taken as an output prefix, so on Apple clang 21.0.0 the commandexits 0 and writes
t.iieven under-fsyntax-only(with-cit also writest.bc,t.s,t.o). GCC instead fails on the same option, so the outcome of the check is toolchain-dependent: a silent file write on one compiler, a failure on another.Reject
-save-temps=and--save-temps=values other than the four already-stripped forms before the compiler runs, like the forwarded-action and-Wprejections: the rewritten test no longer probes the compiler and no longer skips, and asserts the mode is reported, the compiler is never invoked and no output appears. The new scope is recorded indocs/dev/TechnicalDebt.md.The rejection is placed after the
-Wp,handling with an explicitnot in DROPguard, so it does not touch the option-stripping block that #11522 extends; both changes merge in either order.Tested
macOS 26.2, Apple M5 (arm64), Apple clang 21.0.0 (clang-2100.1.1.101), CMake/Ninja,
ANYPS5_RELINKER_ONLY=ON,BUILD_TESTING=ON(Python 3.13). Base:801d5b9bc1(upstream/main), tested head:fe80227fce.-fsyntax-only -save-temps=invalidand-save-temps=diagexit 0 and writet.ii(shown above); joined-oforms write nothing, so they stay untouched.test_unmodeled_saved_temporary_modes_are_rejected_before_the_compiler_runs: five modes (invalid,diagin both spellings,CWD, empty) each fail with the new usage error before the compiler runs; it needs no compiler and skips nowhere. The strippedcwd/objcoverage intest_saved_temporaries_do_not_rewrite_files_or_hide_compiler_errorsis unchanged and passes.tools/tests/test_check_compile.py46 tests OK (2 skipped: Windows/GCC-only),test_check_compile_modes.py31 OK (1 skip).ctest -j 8).python3 tools/check_conventions.py --base upstream/main: all conventions checks passed.python3 tools/pr_overlap.py --branch fix/check-compile-save-temps-modes-v2: no conflicting pull requests; the unresolved shared-file notes are the ancient open PRs fix(agc): color compare emulation: review follow-up to #668 #907/feat(agc): retain and refresh sampled depth array storage #1368/feat(ngs2): add experimental I3DL2 reverb #1384/feat(agc): add experimental depth clear and copy recognition #1395/fix(avplayer): keep handed-out video frames until later frames are handed out #1601/feat(aot): discuss native ARM64 compiler architecture and integration #1835/fix(libkernel): keep the signal mask per thread #3986/feat(aot): consolidate native ARM64 compiler, runtime and consumers #5021/docs: fix Pages workflow link and separate library technical debt #6039, which touch other entries ofdocs/dev/TechnicalDebt.md.Host-only change to the Python tool; no title, GPU or console involved. No performance claim.
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)