fix(tools): count only definitions as exports in the overlap report #1741
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1741"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-08T18:05:25Z.
What
tools/pr_overlap.pytook every added line withAPS5_VABIbefore a name and a parenthesis as an export, so a declaration such asextern "C" int* APS5_VABI __error_nid_postfix();, which many source files add to reach the guest errno, made each pull request that adds it "implement the same function" as all the others. The reports of #1641 and #1727 each list five such rows.The export collection moves into
exports(diff), which skips a line that ends in a semicolon. In the tree every declaration the pattern matches ends that way (206 lines), and a definition's first line ends in{,},(or,(3086 lines); no declaration is split over lines, so none is lost.Overlap: #1325 changes
open_prsin the same file and addstools/tests/test_pr_overlap.py, #988 changes its__main__output; this change is inscanand its own test file, so they merge in any order. #1662 and #1623 add anadd_testat the same place in the rootCMakeLists.txt; whichever merges second rebases two lines.Tested
python3 tools/tests/test_pr_overlap_exports.pyandctest -R pr_overlap_exports: three cases over one diff: definitions of a POSIX export, ansceexport withnoexcept, a one-line body and a signature with the brace on the next line are exports; two declarations (one withnoexceptand trailing spaces, kept in a separate string so an editor cannot strip them), a_nid_no_patchhelper, a removed line and a context line are not. Written before the change; it fails onmainwithAttributeError: module 'pr_overlap' has no attribute 'exports'and passes with it.--branchruns against the 200 newest open pull requests (the tool's current limit, which #1325 lifts), Linux, Python 3.12:feat/libkernel-socket-read-write(#1727):main's tool reports 9 rows, 6 of them__error_nid_postfixonly (#1613, #1616, #1627, #1641, #1675, #1729); this one reports the 3 rows with conflicting lines (#1708, #1711, #1738) and nothing under "Same exports".feat/libkernel-mlock(#1673): 1 row, #1633's conflicting line, with both.tools/check_conventions.py --base upstream/mainpasses;progress_reportandimport_auditstill pass.main6b56175a), run 37822121862:pr_overlap_exportspasses its three repeats on Linux and Windows, full suite 474/474 on each, and the relinker job on Ubuntu, macOS and Windows, which the rootCMakeLists.txtchange triggers.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-08T20:47:54Z.
The Linux failure is
agc_driver_buffer_formatat the 120 s limit, unrelated to this change, which touches onlytools/and the rootCMakeLists.txt. Onmain's own recent runs the test takes 12 to 15 s (runs 37829320117 and 37826284139), and the fork's run of this commit passed (SleglJan/AnyPS5 run 37822121862, 474/474 on Linux and Windows). A re-run should pass.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T01:56:52Z.
I verified the current head locally:
test_pr_overlap_exports.pypasses 3/3, and Conventions plusgit diff --checkpass. Before merge, CONTRIBUTING still requires rebasing: this head is 50 commits behind currentmain(f1451396, merge base6b56175a). The overlap report also shows #1623 and #1662 touching the same root CMake test-registration line; please resolve/check that after rebasing and rerun the final-head checks. The latest upstream Linux Build failed at the 120 sagc_driver_buffer_formattimeout while the fork run is reported green. My upstream access is pull-only, so I cannot rerun it. #1949 is a separate UTF-8 follow-up and should stay out of this PR’s export-detection scope.Imported from boykopovar/AnyPS5. Originally posted by rmz-24 on 2026-10-09T13:10:16Z.
Windows run (Windows 11 Pro 25H2, Python 3.14),
db7666b2cherry-picked ontomaind70b8998:tools/tests/test_pr_overlap_exports.py: passes.tools/pr_overlap.pyreset tomainand the new tests kept:FAILED (errors=3), so the tests catch what the change fixes.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-09T13:11:35Z.
Rebased onto
maind70b8998; the one conflict was the test registration line in the root CMakeLists.txt, now afterhardware_oracle's. On the new headdb7666b2:test_pr_overlap_exports.py3/3,tools/check_conventions.py --base main,git diff --checkandtools/check_test_registration.pypass. #1623 and #1662 are closed. The open pull requests that touchtools/pr_overlap.pyare #2134 (report encoding) and #1325 (overlap against every open pull request); neither touches the lines this one changes, and each merges cleanly with this branch. Full Linux and Windows builds of this head merged intomain, with the relinker matrix, in the fork's Actions: https://github.com/SleglJan/AnyPS5/actions/runs/37932706208 (all jobs pass).AI-assisted: yes (Claude Code).