Repository navigation
test: wave-2 pins P4 (Refs #2683 #2782 #3020 #2765 #2789) - #3163
Merged
Merged
Conversation
added 5 commits
November 8, 2026 23:54
…and-not-found GNU parse.y:3630-3643: a # introduces a comment only at a word start in the source text; quoted/expansion-produced # words are command names (127). rubash drops them post-expansion in src/executor/command_prepare.rs (starts_with(#) arm).
GNU parse.y:5158-5163 (PST_EXTPAT on ==/!=) + parse.y:5203-5206 + execute_cmd.c:4108-4111: conditional pattern lexing/matching forces extended_glob regardless of the shopt option. The option itself is visible only from the next read unit (builtins/shopt.def:638-640 shopt_set_extglob runs after the current line was lexed). Pins cover the issue shape (spaced form; the glued form is a GNU syntax error too), both routes, flip chains, and same-line blindness for case/glob.
GNU parse.y:6772-6808 error_token_from_text: [[ a ==]]2>f names ==]]2 / ==]]2>; a complete conditional names the whole glued item b]]2>f. rubash cond_follower_text contributes only the redirect operators first byte. Oracle bytes verified (the issue text naming ]]2>f does not match the 5.3.20 oracle).
GNU parse.y:295/3116/3120-3130: one flat redir_stack per read unit, bodies drain in push (line) order - no frame tiers. rubash claims pending bodies frame by frame in src/parser/redirections.rs. Nine shapes with distinct body markers (if/else/nested/function/pipeline).
GNU parse.y:4451 parse_comsub hands the body to the grammar during the read of the enclosing unit: skipped bodies still abort the unit (-c 127 via the #2787 remap, file 2, sourced-from--c 127), nested bodies included. rubash screens parse-error markers only at execution. Status/stdout pinned byte-for-byte; wording is #2783s face and intentionally unpinned.
caomengxuan666
marked this pull request as ready for review
November 9, 2026 03:17
caomengxuan666
added a commit
that referenced
this pull request
Nov 10, 2026
executor: stop swallowing expanded '#' command words as comments `execute_assignment_or_comment_command` in `src/executor/command_prepare.rs` carried an arm that discarded any simple command whose first expanded word starts with `#`, reporting exit code 0. GNU bash treats comments as purely lexical (parse.y:3630-3643): the reader discards a `#` only when it begins a word in the source text where a word can start. Quoted, expansion-produced, command-substitution-produced and variable-carried `#...` words are command names and report command-not-found (127). Source-text comments never reach the executor as words because the scanner consumes them, so the arm had no legitimate input and is removed (4 lines). Captain verification (Simular box, per-stem result lines): - Pin stem issue3020_hash_command_word: base e1afd25 3 passed / 6 failed (exactly the six quoted/expansion/comsub/variable cells) -> head 9 passed / 0 failed. - Pin stem issue2683_same_line_shopt_extglob: 10 passed / 0 failed on head and on base (see the attribution note below). - Neighbour stems all green: issue3205 11/11, issue1114 13/13, issue1573 9/9, issue120 4/4, audit_b4 1/1. - Lib: head 1207 passed / 0 failed / 4 ignored; base identical; failure name sets empty on both sides. - `RUSTFLAGS="-D warnings"` check at lib+bins scope: rc=0. The all-targets scope is red on base and head alike from pre-existing warnings in unrelated test files (untouched by this change); left for their owners. - `cargo fmt --check` rc=0; marker-literal lint OK. CI on the head: 10 pass + 1 skipping, zero red. ## Note on the second issue The same-line shopt/extglob pins were re-measured: all 10 pass on the current base. Captain attribution check: the pin stem scores 8 passed / 2 failed at f7aee5c (the two failed cells are exactly the banked ones) and 10 passed / 0 failed at f7fed21, the merge commit of PR #3223, whose deferred extglob parking, grouped-feeder entry snapshot and parse-loop marker arming cover the same mechanism. This PR therefore carries no product change for that side; its closure is the captain's manual call on this evidence. ## 本 PR 删除了什么 Removed the 4-line executor arm described above (one `if` block in `src/executor/command_prepare.rs`). Nothing else is deleted; no test files change (the pins are already on master via PR #3163). Fixes #3020 Refs #2683
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.
Wave-2 pin-first lane P4 (parser interleave / extglob read-time family). Pins only — no product code. Each pin encodes GNU bash 5.3.20 oracle behavior byte-for-byte (script-file probes), runs fail-first on master
f17644d7, and is paired with a root-cause + fix design in the lane REPORT (fix lanes dispatch when the gating faces free up).Refs #2683
Refs #2782
Refs #3020
Refs #2765
Refs #2789
Per issue:
tests/issue3020_hash_command_word.rs(9 cells): quoted/expansion-produced#command words are command names (127), not comments. Root face: post-expansionstarts_with('#')swallow insrc/executor/command_prepare.rs.tests/issue2683_same_line_shopt_extglob.rs(10 cells):[[ == ]]extglob patterns ignore the shopt option entirely in GNU (parse.y PST_EXTPAT forcing); the option is visible only from the next read unit — same-lineshoptis invisible to case/glob shapes on that line.tests/issue2782_cond_glued_redirect_error_token.rs(4 cells): the conditional error walk names the full glued redirect run (==]]2/==]]2>; complete-conditional faceb]]2>f), not the operator's first byte.tests/issue2765_heredoc_frame_pairing.rs(9 cells): heredoc bodies pair by line order across if/else/nested/function/pipeline tiers (GNU's flat redir_stack), not by frame tier.tests/issue2789_comsub_read_time_validation.rs(9 cells): comsub bodies are validated at read time — skipped bodies abort the unit (-c 127 / file 2 / sourced-from--c 127); status+stdout pinned, wording left to the comsub body error echo shows the body fragment, not the enclosing line (F4/R13 residual) #2783 face.本 PR 删除了什么
无(纯测试新增)。净行数:+约 770 行(5 个新测试文件)。
fail-first(基底 f17644d,队长可复核:~/workspace/fix-P4/verify/ 全量日志)