Skip to content

Fix winuxsh compatibility regressions - #8

Merged
caomengxuan666 merged 3 commits into
masterfrom
codex/winuxsh-compat-fixes
Jul 26, 2026
Merged

caomengxuan666 merged 3 commits into
masterfrom
codex/winuxsh-compat-fixes

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Summary

  • parse arithmetic expansion $((...)) separately from command substitution so base-prefixed arithmetic like 16#de survives lexing
  • improve parameter pattern removal with escaped quote glob patterns
  • split unquoted variables using the active IFS and feed inherited stdin into the first stdin-consuming pipeline stage
  • add regression tests for the winuxsh host-contract cases

Tests

  • cargo test --test executor_tests test_function_assignment_arithmetic_expansion_accepts_base_hash
  • cargo test --test executor_tests test_parameter_pattern_removal_decodes_escaped_double_quote_globs
  • cargo test --test executor_tests test_set_positional_operands_split_unquoted_variable_with_custom_ifs
  • cargo test --test executor_tests pipeline

@caomengxuan666
caomengxuan666 merged commit cbbea41 into master Jul 26, 2026
3 checks passed
caomengxuan666 added a commit that referenced this pull request Nov 20, 2026
A background job that takes the --internal-bg-wrapper path waited on
its script child through wait_external_child without publishing a
WrapperRelayTargetGuard. A group-delivered SIGINT (kill -SIGINT
-- -$!, the bats CTRL-C shape) therefore found no relay target: the
wrapper restored its saved disposition and re-raised, dying by the
signal, and the rubash#737 PDEATHSIG arm then SIGKILLed the script
child before its INT trap could run — bats file_setup_teardown #8
lost teardown_file. The pipeline path has published the target
since rubash#2626; the simple-command wait now does the same for
exactly the span of the wait. GNU interposes no wrapper (jobs.c
wait_for job-wait semantics: delivery reaches the job's processes
directly), so the wrapper must stay transparent to addressed and
group-delivered signals.

Verification (GNU bash 5.3.20 oracle; bats-core 1.11.0):
- stock test/file_setup_teardown.bats, release build: master
  filter "user abort" not ok (line 118, teardown log missing);
  fixed filter ok and full file 17/17; oracle full file 17/17.
- new pin issue2983_wrapper_simple_wait_relays_group_sigint_to_
  script_child (cfg(unix)): fail-first against master code,
  passes with the fix; the pre-existing issue2983 pin is
  unchanged and green.
- adjacent suites 2982/866/2729/1825/2241/1990_1991/2053: no new
  reds vs master; the 1825 (1) and 1990_1991 (3) failures are
  identical pre-existing sets on master and fixed.
- Windows (X299): kill-form and jobs probes byte-identical
  between master and fixed binaries; the relay publish is inert
  off unix by design.

Refs #2983

UNVERIFIED-BY-CAPTAIN

Co-authored-by: caomengxuan666 <[email protected]>
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