Repository navigation
feat(tools): inventory saved compilation databases without tools - #13375
Conversation
|
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.
|
malekaifa
left a comment
There was a problem hiding this comment.
Reviewed exact head 7f1064d. The focused suite passes 2/2 on Windows/Python 3.12; py_compile, conventions, git diff --check and current-main merge-tree checks are clean.
One blocking data-loss case remains in the new inventory format. A JSON compilation database may carry the optional output field specifically to distinguish different processing modes of the same input. compilation_database() preserves that field, but compile_database_inventory.py discards it and retains only arguments/command. With two valid entries for the same directory/file and identical arguments but outputs a.o and b.o, the tool currently emits variants: 2 followed by two byte-for-byte identical records, so the inventory cannot tell what made the compile actions distinct.
Please preserve output in each emitted record when present (and add a regression with same directory/file/arguments but different outputs). That also makes the variants count interpretable for this standard case. The existing arguments-over-command precedence can stay.
AI-assisted review.
|
@malekaifa Fixed at Each emitted compile record now retains output whenever present, so identical directory/file/arguments with a.o versus b.o remain distinguishable. Arguments-over-command precedence and raw record order are unchanged. The Clang format specification explicitly identifies this optional field as distinguishing processing modes. The new real-CLI regression asserts the complete inventory for those two outputs, command-form/Unicode output, both command forms together, and missing versus explicitly empty output. It also verifies input bytes/mtime and directory contents are unchanged, with empty PATH and nonexistent compiler names. Registered tools_compdb_inventory CTest: 3/3 methods pass on Windows/Linux with Python 3.12/3.14, zero skips in all four configurations. Removing only output retention makes the new record-equality assertion fail on both OSes and both interpreters; no import/setup failure is counted. Both original methods remain unchanged. Conventions with the full body, whitespace, Python 3.9 grammar, registration and skip-policy checks pass. Hosted checks at 2026-10-30T16:14:54+00:00 (UTC): 3 pending; no failures. Current-head checks. These are Python/tool tests, without a native/full build or compiler execution claim. Please re-review this exact fixed head. AI-assisted: yes. |
malekaifa
left a comment
There was a problem hiding this comment.
Reviewed fixed exact head eeb2480 independently on Windows 11 / Python 3.12.
The requested blocking case is resolved: records now retain the optional compilation-database output field whenever present while preserving arguments-over-command precedence. The added regression covers identical directory/file/arguments with distinct a.o and b.o outputs, command-form output, Unicode output, missing output, and explicitly empty output.
Validation on this exact head: tools/tests/test_compile_database_inventory.py 3/3 OK; py_compile, conventions and git diff --check pass. Current-main merge-tree check is clean. I also checked the newer main history for tools/check_compile.py, tools/compile_database_inventory.py, and its test: there is no net source/test delta that changes this reviewed behavior.
Hosted relinker/Windows jobs are still queued at this review time, so this approval does not claim them. No native/title/GPU validation is applicable to the Python inventory behavior reviewed here.
AI-assisted review.
|
Checked that records now keep the optional |
What
Inventory saved compilation databases as JSON grouped by raw directory/file strings, without invoking a compiler, Ninja, CMake or Git.
Address the output-loss review: preserve the optional output field whenever it is present in a compile record. Two otherwise identical actions producing a.o and b.o now remain distinguishable in the emitted inventory. Keep arguments-over-command precedence, raw record order, optional-field absence and an explicitly empty output value. The shared compilation_database parser is reused unchanged.
The Clang compilation database specification describes output as optional metadata distinguishing processing modes. A new real-CLI regression covers identical arguments with different outputs, command-form output, Unicode, both command forms, missing/empty output, and unchanged input bytes/mtime with empty PATH and nonexistent compiler names.
Paths remain raw strings rather than normalized aliases. variants counts raw records, not semantically deduplicated invocations. No command is parsed as a shell program or executed, and unknown metadata is outside this inventory's reported fields.
Tested
Exact tested head
eeb248013b42624cc036dc3c6472d7a2f4e93578on recorded main9f748f4d8e36ce3714f3b95f3386316e110a9b22; previous published head7f1064d3231879102362ba4b51a478e146499905. Both are ancestors. The two original regression methods remain unchanged.Windows 11 / Python 3.14.3 and 3.12.14 / CMake 4.3.1 / MinGW GCC 15.2 configuration, and Ubuntu 26.04 / WSL / Python 3.14.4 and isolated 3.12.16 / CMake 4.2.3 / GCC 15.2 configuration. Linux uses exact committed source archives.
ctest --test-dir <build> -R '^tools_compdb_inventory$' -V: 1 registered CTest / 3 methods pass in each of the four OS/interpreter configurations, zero skips.These are focused Python/tool tests; CMake configuration is not a native build. No actual Python 3.9/3.11, local macOS, full product build, title/PS5/GPU or compiler execution is claimed. New-head hosted CI starts after publication; prior-head results are not substituted.
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)