Skip to content

fix(parser,script_driver): fix master CI regressions from #3755 and #3701 - #3897

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/master-ci-3755-3701-regressions
Nov 18, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/master-ci-3755-3701-regressions

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Fixes two master CI regressions introduced by #3755 and #3701:

  1. keeps_comsub_case_subject (src/parser/command_substitution.rs):
    operator values: dequote stored CTLNUL + quoted-null retention oracle for @-lists #3755 added keeps_comsub_case_subject asserting extract("$(case $(ls) in esac)") == None (from before fix(executor): keep a $( body parse error fatal to the enclosing command (Refs #3756) #3843), while fix(executor): keep a $( body parse error fatal to the enclosing command (Refs #3756) #3843 had already updated keeps_empty_case_esac_shape to Some("case x in esac"). Updated keeps_comsub_case_subject to Some("case $(ls) in esac").

  2. Unmatched-delimiter EOF exit status (src/script_driver.rs + tests):
    fix(comsub,parser): honor ANSI-C $'...' in $( walkers; split EOF exit status by construct #3701 changed word-internal matched-pair EOF diagnostics to exit 1, breaking cli_tests (malformed_parameter_expansions_return_status_two, unterminated_complete_command_strings_are_syntax_errors, cli_noexec_reports_unclosed_parameter_expansion, malformed_script_preserves_valid_prefix_before_status_two).
    Verified against GNU bash 5.3.20 in WSL: all of these (echo ${x, echo "hi, -n noexec, malformed_parameter_prefix.sh, and all 9 cases in issue3605_eof_exit_status_word_pairs.rs) exit 2, not 1.
    Restored exit status 2 in src/script_driver.rs (preserving fix(comsub,parser): honor ANSI-C $'...' in $( walkers; split EOF exit status by construct #3701 ANSI-C $'...' comsub walker fixes) and updated consumer_tests.rs, issue1184_f6_backquote_eof_regressions.rs, and issue3605_eof_exit_status_word_pairs.rs back to 2.

…3701

1) Update keeps_comsub_case_subject empty-case expectation to Some("case $(ls) in esac") matching #3843 keeps_empty_case_esac_shape.
2) Restore exit status 2 for unmatched-delimiter EOF diagnostics in script_driver.rs (verified against GNU bash 5.3.20 in WSL: all word-internal pairs and -c/-n/file modes exit 2), keeping #3701 ANSI-C $'...' comsub walker fixes.
3) Restore status 2 assertions in consumer_tests.rs, issue1184_f6_backquote_eof_regressions.rs, and issue3605_eof_exit_status_word_pairs.rs.
@caomengxuan666
caomengxuan666 merged commit 10fdc15 into master Nov 18, 2026
9 of 12 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/master-ci-3755-3701-regressions branch November 18, 2026 10:03
caomengxuan666 added a commit that referenced this pull request Nov 18, 2026
…t exits 1, not 2 (Refs #3899, Refs #3900)

fix(script_driver, lexer): EOF consumed by a compound array assignment exits 1, not 2 (Refs #3899, Refs #3900)

#3897 changed the EOF route's arms to return 2 unconditionally. GNU does
not: EOF consumed inside parse_compound_assignment's token loop sets
EXECUTION_FAILURE (parse.y:7151-7152 diagnostic at the `name=(` line,
:7167-7169 set status 1); the `error yacc_EOF` production forces 2 only
on a still-zero status (parse.y:484-493), and live errexit forces 2
(error.c:324-327). The three arms (generic close-char, `$[` hunt,
extglob) now consult the delimiter stack's array_list bit: status 1 when
a compound assignment is open (2 under live errexit), else 2.

Captain correction in the same PR (commit 2fc6dad, continuation.rs,
captain-exclusive file): the close-char scan's top-level `(` arm
classified any command-position `(` with a non-empty pending word as an
array list, so `!(` (extglob/negation, pending word `!`) carried a
false-positive array_list bit and flipped the issue3229 case-position
extglob cell 2 -> 1 on the first head. array_list now requires a genuine
`name=`/`name+=` word; other command-position words open a subshell
frame. Applied in lockstep to the oracle scan and its checkpointable
mirror. GNU probes: `case ab in / !(ab` -> rc 2 line 3; `v=(a +(x` -> 1;
`echo +(x` -> 2.

Verification (captain-adjudicated, REPORT ~/workspace/fix-eof-split/REPORT.md):
- Head census (2fc6dad) total 81 (era band 79-88, better than tip 85):
  compat_issue78 green (CLI 7/7), issue551-c6 green, issue3229 stem green
  (10/10 on the server tree). New cells vs the old tip are census jitter
  on faces this diff cannot reach (issue2333 carrier family; issue3640 x2,
  already proven jitter by server isolation 7/7 on both trees; issue2340
  wait-retention and issue2972 declare-listing, both green on the two
  immediately preceding heads and unreachable from EOF routing).
- Goldens exactly the 2 baseline names. CLI's only fail is the documented
  coproc flake; the compat_issue78 CLI cell is green.
- Server legs on the fixed tree: issue3229 10/10, compat_issue78 7/7,
  issue551 9/9, 40-shape oracle matrix byte-identical to the lane's fixed
  matrix, RUSTFLAGS="-D warnings" rc=0, rustfmt clean.
- Merged without update-branch under the zero-intersection exception:
  base(bb27eb2)...tip(cc80b2d) touched only trap_exec.rs + 2 test files;
  this PR touches only script_driver.rs + continuation.rs.

本 PR 删除了什么:
- 未删除任何产品代码、测试用例或钉。本 PR 只改 EOF 状态分流(script_driver.rs
  三臂)与 close-char 扫描的 `(` 分类(continuation.rs 双臂);回归钉
  tests/issue3229… 的既有断言保持 GNU 真值不变。

UNVERIFIED-BY-CAPTAIN — captain review: PASS. Merge by captain; #3899 and
#3900 to be hand-closed by the captain after merge (Refs-only body, no
auto-close). Residuals: #3904 (A13, PR #3908 in flight, rc assertions need
this merge + rebase) and #3905 (A14, captain's nested-arm fix in
continuation.rs, next).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant