fix(parsing): recover export-macro-hidden type definitions (#1989) - #2005
Conversation
|
Holding note, because you are owed one before any review verdict. On #1989 you asked two direct questions:
Nobody answered. You did the right thing by asking, waited, and then built it anyway rather than letting the report rot — but this PR's description calls it "the agreed option 1", and I want to be straight with you: it was never agreed, because we never replied. That is our failure, not a liberty you took. I have put the direction question — heuristic shape versus config-driven defines versus both — in front of the maintainer now, and I will bring you a real answer rather than letting it sit again. Two things I can say already, having read the diff rather than the summary: The report is exemplary. Naming UBT's And the implementation is careful in the places that are easy to get wrong. None of that decides the direction question, which is genuinely the maintainer's. But it does mean that if the answer is yes, this is in good shape. Thank you for the patience, and sorry it took a PR to get a reply. |
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thanks for the clarification. I may be interpreting the timeline differently, so I checked the issue history. Before opening this PR, I asked whether to pursue the heuristic option 1 or the config-driven option 2, and whether to combine them. The reply on #1989 explicitly asked me to "open a focused PR for option 1 only" and specified the candidate cap, negative controls, no user-configured define plumbing, and the class/struct/enum/free-function test boundary: #1989 (comment) I used that as the scope for this PR. I agree that the exact regex was not approved character-for-character; the implementation made the candidate filter deliberately conservative and bounded. If the exact filter or any other part of the scope should change, I am happy to adjust it. I just wanted to clarify that the option-1 direction and scope were discussed in the issue before implementation. |
|
You are right, and thank you for correcting the record. The maintainer reply on #1989 did explicitly ask for a focused PR implementing option 1 with the bounded candidate scan and the stated negative controls. Our earlier comment here saying that the direction had never been agreed was wrong. I am sorry: you followed the scope we gave you. The option-1 direction therefore remains the approved scope. The exact candidate filter and implementation still receive normal review on their merits, but you do not need to re-litigate why this PR exists. Thank you for responding with the thread reference and keeping the correction factual. |
256b3d3 to
ec28e66
Compare
|
Rebased onto the latest main (2f9828d) and resolved the conflict in tests/test_extraction.c by preserving both the upstream extraction tests and the #1989 regression coverage. The PR remains a single commit and still changes only the four intended files. The rebased files pass single-file compilation and clang-format checks locally. The full sanitizer test runner cannot be linked in the local MinGW environment because its sanitizer runtime/spec file is unavailable; the refreshed CI matrix is running now. |
|
Direction settled — thank you for building this, and apologies that the two questions on #1989 went unanswered before you did. That was on us, and the answer was yes. The zero-config shape rule (option 1) is accepted as the default: the candidate collection is bounded and lexically careful, the recovered definitions go through the line-mapping / visibility / qualified-name gates before they replace anything, and explicitly configured defines keep priority. That is the right layer and the right amount of caution. Two things so you know what happens next:
|
…1989) Collect a bounded set of conventional export macro candidates and inject empty definitions into the existing C/C++ preprocessing second pass without overriding explicit caller definitions. Conservatively reconcile remapped definitions to recover hidden classes, structs, enums, free functions, and inline methods while suppressing matching base-class phantom callables. Add focused regression coverage for supported suffixes, ordinary all-caps negative controls, candidate limits, comments, strings, raw strings, overlong names, explicit define priority, and C/C++ extraction. Rebase onto main 92abefa and route the temporary superseded-definition bitmap through the extraction memory class to comply with the current allocation contract. Preserve the error-region dropped counter initialization. Signed-off-by: XIYBHK <xiybhk@163.com>
ec28e66 to
fcf451c
Compare
Reuse the existing request-string cleanup for cross-repository mode and index-policy load failures. Preserve short-circuit policy loading and the raw string allocator ownership while avoiding duplicate free sites. This addresses the memory-core lint regression in main 92abefa that blocked the test matrix for PR DeusData#2005. No lint baseline is relaxed. Signed-off-by: XIYBHK <xiybhk@163.com>
|
Thank you for rebasing onto today's The
So: please drop What happens next, and it is all on our side: #2257 lands (it also fixes a second Thank you for your patience, and for keeping the PR current through a very busy stretch on |
6eb8992 to
fcf451c
Compare
|
Thank you for the clear explanation and for coordinating the fix in #2257. I've dropped I'll leave the branch as-is and let you handle the update and validation after #2257 lands. Thank you again for reviewing this and keeping us informed. |
|
Merged as c7488b0 — thank you, and thank you for your patience through a sequencing promise that took far longer than it should have. Verified on the merge result before landing: extraction 369/0 with all the #1989 tests green; c_lsp, pipeline, lang_contract, parse_coverage, grammar_regression and complexity green; with production reverted the tests no longer compile, so they bind to A nice coincidence worth telling you about: on the morning of the merge a reporter on #1153 ("method calls through object pointers are dropped", priority/high) independently traced that bug to exactly this defect — The explicit override layered on top of the shape rule (the reporter's option 2 on #1989) remains open as a follow-up, as discussed. |
What does this PR do?
Fixes #1989.
Recover C/C++ definitions hidden by conventional build-system export macros through the existing preprocessing second pass. Candidate collection is lexically bounded to 32 names per file; explicit caller defines retain priority. Recovered definitions pass line mapping, original-source visibility, and qualified-name reconciliation gates. The change covers class/struct/enum definitions, free functions, and inline methods, with negative controls for ordinary all-caps identifiers.
Rebased onto
mainat92abefa3. The implementation preserves the upstream error-regiondroppedcounter initialization and usescbm_calloc/cbm_freewithCBM_MEM_CLASS_EXTRACTfor its temporary superseded-definition bitmap. All 19 original regression tests remain registered. The PR contains one signed-off commit,fcf451c6, touching only the original four files. Project-level macro configuration remains in follow-up #2049.Validation
git diff --check, diff-scoped formatting checks, and strict GCC/G++ syntax checks passed for the changed translation units.scripts/security-audit.shpassed.Known boundaries: one-character export prefixes such as
X_APIremain intentionally rejected; header-only prototypes retain the existing extraction behavior; UINTERFACE cascade handling remains outside this PR.