tools: check_conventions.py fails on Windows with WinError 206, its duplicate-export git grep is longer than the 32k command line #8848
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 011010 on 2026-10-21T02:59:10Z.
python tools/check_conventions.py --base origin/maincannot complete on Windows. It stops induplicates(), before any check has run, with:Environment: Windows 11, Python 3.14.3, git 2.52.0.windows.1, tree at
main5d10ea9ea.Cause.
duplicates()passes one regular expression, built from every export in the tree, as a single argv element. On this tree that is 4,445 names and a 147,788-character expression. Windows builds the process from one command line capped at 32,767 characters, soCreateProcessrefuses it before Git starts.core.longpathsdoes not help: the limit is the command line, not a path. Linux has anARG_MAXof about 2 MB, so the CI job never reaches it.With
duplicates()made to return immediately, the rest of the check runs on Windows and reports the other findings normally, so this step is the only one that fails there.Verified alternative.
git grepreads expressions from a file with-f. Writing the same expression to a file and passing-f <file>returns the expected hits on the same tree here (7,835 lines for the version of the expression measured above) without any command-line growth:The file must be written without a BOM or the first alternative does not match (writing with the default
Set-Content -Encoding utf8of Windows PowerShell added one in my check and made the run return 0 hits).Why it matters.
AGENTS.mdandCONTRIBUTING.mdtell contributors to run this check before pushing. On Windows the command fails regardless of the change, so a Windows contributor has no local run of it and only the CI job sees the result. CI is unaffected.Coordination. #8777 edits this same function to count assembly exports, so the two changes should be reconciled in whichever lands second.
I can open the pull request with the
-fchange and a test that the expression is not passed on the command line, if that is wanted.AI-assisted: yes (Claude Code). The traceback and the measurements above come from my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T03:19:49Z.
I found open PR #8777, which already changes
duplicates()to detect assembly exports and addresses the same function. The regex it builds is still 147,788 characters at the measured 4,445-export size, so it would still hit the WindowsCreateProcesslimit. I suggested in that PR that the author include your measuredgit grep -fapproach and a regression test, avoiding a competing PR on the same method.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T03:30:05Z.
Fixed on current main by #8461. The merged checker passes fixed-string patterns to
git grep -f -through stdin instead of constructing a long argv regex. The PR reports a Windows regression that reproduced WinError 206 on main and passed with the change, and the merged Windows relinker job passed. I also flagged that open #8777 needs to preserve this approach when it adds assembly-export detection, or it could reintroduce the same limit.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T03:30:11Z.
The reported Windows command-line failure is fixed on current
mainby #8461. The merged checker passes fixed-string patterns togit grep -f -through stdin, and #8461 reports a Windows regression that reproduced WinError 206 on main and passed with the fix. Its Windows relinker job also passed. I flagged open #8777 because it still uses the older long regex as one argv item; its assembly-export change should be rebased and keep the streamed-pattern approach to avoid reintroducing this failure. I cannot close the issue with the permissions on this account, but the specific failure is covered by the merged change.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T04:18:41Z.
I checked current
main: #8461 (fix(tools): stream duplicate export search patterns) already movedgit greppatterns off the command line using-F -f -, which addresses the reported WinError 206. I also reviewed #8777, which extends this duplicate check to assembly exports; its current diff builds a combined regex and passes that full pattern as an argv element again. I left an inline note there asking to keep that expanded pattern off argv while preserving the needed matching behavior. The issue can be closed once the author confirms the current-main fix covers the reported Windows setup.Imported from boykopovar/AnyPS5. Originally posted by 011010 on 2026-10-21T04:26:48Z.
Thanks @MarcZX10. Verified on this machine after updating to
main7ab4b2e56:python tools/check_conventions.py --base origin/mainnow completes on Windows with noWinError 206(the findings it prints come from comparing against the old fork history, not from the checker). Thegit grep -nF -f -form from #8461 is the one I measured working.Closing as fixed. #8777 is still open, now conflicts with
main, and still builds the long-Epattern; it needs a rebase that keeps the streamed patterns or it reintroduces this.