Repository navigation
WIP: winx3-parser — parser family fixes for #1301–#1306 (verification pending) - #1391
Merged
Merged
Conversation
…irst operand (#1304) glibc rule: mere presence of the variable counts (empty value too). Parser-side: OptionParsePolicy gains posixly_correct; parse_command_runtime narrows the stop to 1 and funnels both positional push sites through push_positional. Non-getopt commands (find/test/[/expr/true/false/dd) opt out in option_policy_for_command. The dispatcher pre-passes share the flag via classify_args_for_dispatch (lands with #1303). WIP: harness build + repro verification still pending (mini build queued in the build-slot queue); published early per the no-local-only-work rule, verification to follow on this branch.
…reviation expansion (#1303) New classify_args_for_dispatch walk: only real option tokens are expanded or intercepted, so values (grep --label --help, cp --suffix --ver) and wrapped-command operands (xargs/timeout/env/find -exec) keep their spelling. Single argv-order scan for --help/--version (first match wins, as GNU). The scan also rejects --help=/--version= with the doesn't-allow-an-argument error (dispatcher side of #1301; parser side follows in #1301). env gains stop_options_after_positionals=1. WIP: harness build + repro verification still pending (mini build queued in the build-slot queue); published early per the no-local-only-work rule, verification to follow on this branch.
Both long branches (and the single-dash long form) now report "option '--<name>' doesn't allow an argument" instead of silently ignoring the value (grep --count=x used to hang). i18n translate_error gains the common.error.option_no_argument pattern. Dispatcher --help=/--version= rejection landed with the #1303 scan rewrite. WIP: harness build + repro verification still pending (mini build queued in the build-slot queue); published early per the no-local-only-work rule, verification to follow on this branch.
… argv (#1302) Long and single-dash-long Int branches now test has_inline_value: an explicit empty value fails as invalid argument '' instead of consuming the next argv as the value. String branches already used has_inline_value and are untouched. WIP: harness build + repro verification still pending (mini build queued in the build-slot queue); published early per the no-local-only-work rule, verification to follow on this branch.
grep gets its one-line Usage before Try; sed gets its full help instead of the Try line (Registry::get_help, new); unknown long options keep the full --unknown=x token in the diagnostic (ambiguous keeps the bare name, as GNU). The #1303 scan's no-argument error path is gated through print_parse_error_tail. WIP: harness build + repro verification still pending (mini build queued in the build-slot queue); published early per the no-local-only-work rule, verification to follow on this branch.
…sing; -NUM for uniq/diff/split (#1306) OptionalInt/OptionalString in a cluster now record presence and let the rest of the cluster parse (uniq -Dc, diff -cu, split -dl) for commands that opt out via allow_optional_short_attached_values=false (uniq/diff/split only; sed -i.bak etc. keep attached values). Digit runs in a cluster are the command's -NUM option (diff -c5/-5c, uniq -D5, split -d5). diff/uniq gain hidden -NUM metas; diff reports conflicting output style options (rc2) for two different styles including --normal and -D/--ifdef. WIP: harness build + repro verification still pending (mini build queued in the build-slot queue); published early per the no-local-only-work rule, verification to follow on this branch.
The enclosing 'export namespace WinuxCmd' already exports these
using-declarations; a second 'export' on them is ill-formed and GCC 16
rejects it ('export' may only occur once in an export declaration).
MSVC accepts the redundant form, so official builds never exposed this.
This is the GCC-portability fix for the mingw+Wine local verification
route only. It is unrelated to #1301-#1306 and touches no parser,
dispatcher, or command code.
Refs #1401
…CC modules GCC module build of utils:regex failed with 'size_t' does not name a type when PCRE2 is off: the global module fragment was empty and 'import std' does not provide unqualified ::size_t under strict GCC module semantics (same shape as gnu_float80.cppm, which includes <cstddef> in its global fragment and builds). Refs #1406. One file only; unrelated to #1301-#1306 and to the #1401 version.cppm fix. Verification pending: mini build [93/93], repro.sh and REPORT section 9 gates to follow; Fixes not used until gates pass.
…or GCC modules Refs #1412
# Conflicts: # src/utils/i18n.cppm # tests/unit/cat/cat_unit_test.cpp # tests/unit/find/find_unit_test.cpp # tests/unit/grep/grep_unit_test.cpp # tests/unit/sed/sed_unit_test.cpp # tests/unit/split/split_unit_test.cpp # tests/unit/uniq/uniq_unit_test.cpp # tests/unit/xargs/xargs_unit_test.cpp
Member
Author
|
Verification landed (merge af5ca1e brings origin/main in; conflicts resolved in src/utils/i18n.cppm + 6 test files, both-sides-kept).
|
caomengxuan666
marked this pull request as ready for review
October 27, 2026 03:26
Open
1 task done
This was referenced Oct 27, 2026
caomengxuan666
added a commit
that referenced
this pull request
Oct 27, 2026
…#1407/#1412) The four filed walls were fixed per-file via PR #1391 (version.cppm inner export, regex/string size_t, utf8 PCH/std conflict), but the full GCC build was never re-run to completion afterwards (build15 died on a missing Wine interpreter with zero files compiled). Re-running it on current main shows the defects were one class, not four files: module global fragments that are not self-sufficient under GCC — a C++ header must be seen before the windows.h chain so c++config.h's std declarations land with C++ linkage (#1412 mechanism), and bare size_t/uint64_t/_fileno must come from their own headers instead of MSVC header-chain leaks (#1406/#1407 mechanism). A keep-going (-k 0) GCC 16.2 build of the whole tree enumerates every remaining instance; this commit fixes the class in one pass: - #1412 guard (pre-include <cstddef> + #undef NOMINMAX) for every pch-first fragment lacking it: native_path (the wall the baseline build actually stops at), cmd_meta, console, file_io, i18n, pager, wildcard, win32 (its second include is aclapi.h, another windows header — no C++ header precedes pch.h there either). - i18n: add <cstdint> (bare uint64_t in legacy_key; pristine-file probe shows both errors, the guard alone leaves this one). - console: add <stdio.h> (_fileno). - text_io: it has no global fragment at all and uses bare size_t; add the fragment with <cstddef>. Refs #1401 Refs #1406 Refs #1407 Refs #1412
caomengxuan666
added a commit
that referenced
this pull request
Oct 27, 2026
…#1407/#1412) The four filed walls were fixed per-file via PR #1391 (version.cppm inner export, regex/string size_t, utf8 PCH/std conflict), but the full GCC build was never re-run to completion afterwards (build15 died on a missing Wine interpreter with zero files compiled). Re-running it on current main shows the defects were one class, not four files: module global fragments that are not self-sufficient under GCC — a C++ header must be seen before the windows.h chain so c++config.h's std declarations land with C++ linkage (#1412 mechanism), and bare size_t/uint64_t/_fileno must come from their own headers instead of MSVC header-chain leaks (#1406/#1407 mechanism). A keep-going (-k 0) GCC 16.2 build of the whole tree enumerates every remaining instance; this commit fixes the class in one pass: - #1412 guard (pre-include <cstddef> + #undef NOMINMAX) for every pch-first fragment lacking it: native_path (the wall the baseline build actually stops at), cmd_meta, console, file_io, i18n, pager, wildcard, win32 (its second include is aclapi.h, another windows header — no C++ header precedes pch.h there either). - i18n: add <cstdint> (bare uint64_t in legacy_key; pristine-file probe shows both errors, the guard alone leaves this one). - console: add <stdio.h> (_fileno). - text_io: it has no global fragment at all and uses bare size_t; add the fragment with <cstddef>. Refs #1401 Refs #1406 Refs #1407 Refs #1412
caomengxuan666
added a commit
that referenced
this pull request
Oct 27, 2026
#1406/#1407/#1412) The four filed walls were fixed per-file via PR #1391 (version.cppm inner export, regex/string size_t, utf8 PCH/std conflict), but the full GCC build was never re-run to completion afterwards (build15 died on a missing Wine interpreter with zero files compiled). Re-running it on current main shows the defects were one class, not four files: module units that are not self-sufficient under GCC — a C++ header must be seen before the windows.h chain so c++config.h's std declarations land with C++ linkage (#1412 mechanism); bare size_t/uint64_t/_fileno must come from their own headers instead of MSVC header-chain leaks (#1406/#1407 mechanism); and names re-exported with 'export using' must have external linkage, i.e. be exported at their declarations, not merely declared in the purview (#1401 mechanism). A keep-going (-k 0) GCC 16.2 build of the whole tree enumerates every remaining instance; this commit fixes the class in one pass: - #1412 guard (pre-include <cstddef> + #undef NOMINMAX) for every pch-first fragment lacking it: native_path (the wall the baseline build actually stops at), cmd_meta, console, file_io, i18n, pager, wildcard, win32 (its second include is aclapi.h, another windows header — no C++ header precedes pch.h there either). - i18n: add <cstdint> (bare uint64_t in legacy_key; pristine-file probe shows both errors, the guard alone leaves this one). - console: add <stdio.h> (_fileno). - text_io: it has no global fragment at all and uses bare size_t; add the fragment with <cstddef>. - cppbar: export the terminal namespace and the color/style entities (RGB, apply_color, reset_color, StyleConfig, Style) at their declarations so the trailing export-using block names only entities with external linkage, exactly as Color/ProgressBar already did. This TU was unreachable in every earlier build (it imports :console). Refs #1401 Refs #1406 Refs #1407 Refs #1412
caomengxuan666
added a commit
that referenced
this pull request
Oct 27, 2026
#1406/#1407/#1412) The four filed walls were fixed per-file via PR #1391 (version.cppm inner export, regex/string size_t, utf8 PCH/std conflict), but the full GCC build was never re-run to completion afterwards (build15 died on a missing Wine interpreter with zero files compiled). Re-running it on current main shows the defects were one class, not four files: module units that are not self-sufficient under GCC — a C++ header must be seen before the windows.h chain so c++config.h's std declarations land with C++ linkage (#1412 mechanism); bare size_t/uint64_t/_fileno/ _fdopen must come from their own headers instead of MSVC header-chain leaks (#1406/#1407 mechanism); and exports must be well-formed — no 'export' inside an export block/namespace, and 'export using' may only name entities exported at their declarations (#1401 mechanism). A keep-going (-k 0) GCC 16.2 build of the whole tree enumerates every remaining instance; this commit fixes the class in one pass: - #1412 guard (pre-include <cstddef> + #undef NOMINMAX) for every pch-first fragment lacking it: native_path (the wall the baseline build actually stops at), cmd_meta, console, file_io, i18n, pager, wildcard, win32 (its second include is aclapi.h, another windows header — no C++ header precedes pch.h there either), childproc (its <filesystem> sits after pch.h, too late to serve as the guard). - i18n: add <cstdint> (bare uint64_t in legacy_key; pristine-file probe shows both errors, the guard alone leaves this one). - console: add <stdio.h> (_fileno). file_io: add <stdio.h> (_fdopen). - text_io: it has no global fragment at all and uses bare size_t; add the fragment with <cstddef>. - file_io: remove the six inner 'export' keywords inside 'export namespace file_io' (the version.cppm shape, with a NOTE). - cppbar: export the terminal namespace and the color/style entities (RGB, apply_color, reset_color, StyleConfig, Style) at their declarations so the trailing export-using block names only entities with external linkage, exactly as Color/ProgressBar already did. This TU was unreachable in every earlier build (it imports :console). Refs #1401 Refs #1406 Refs #1407 Refs #1412
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP draft — parser family fixes, not yet verified. Published early so the line is visible; do not merge until verification lands on this branch.
Coverage (one commit per issue)
b0eb7cb--help/--versioninterception + abbreviation expansion in dispatch —a81d89f--flag=value—856025c--int=no longer swallows the next argv —ad980e4--unknown=xtoken) —f6329ce-NUMfor uniq/diff/split; diff conflicting-style rc2 —55d347bEach commit carries its regression tests. Two issue-text corrections are baked in: #1306's
diff -cuexpectation in the issue text is wrong (GNU diffutils: rc2 +diff: conflicting output style options); #1302's fix is at the parser layer (message form differs from GNU grep's own string — see open items).Current progress
minitarget) has been queued in the shared build-slot queue through repeated attempts, each killed by runtime restarts before acquiring the slot; a further attempt is queued now.repro.shhas therefore not yet run against these changes. All commit titles carryWIP:for exactly this reason; follow-up commits on this branch will add the verification results (no history rewrite).src/files and 13 unit-test files, fixes + regression tests only.tests/unit/{cat,grep,sed}the committed test blocks appear in reverse commit order vs the original worktree layout; line multisets are identical.main@ b7c3675. Overlap check vs fix(sed,find,path): sed empty-match abutting suppression, find walk abort + D:name unification, long-path probe alignment (#1284, #1283, #1288) #1299 per the cluster report: no overlapping hunks; fix(sed,find,path): sed empty-match abutting suppression, find walk abort + D:name unification, long-path probe alignment (#1284, #1283, #1288) #1299's files untouched.Open items (awaiting main-session adjudication, deliberately not expanded here)
invalid max count) down in the grep handler?is_posixly_correct()requires non-empty — sync it or not (affects nohup/echo, separate evaluation).