Skip to content

WIP: fix(executor): apply tempenv assignments in pipeline function stages (#1765) - #1804

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix9/funcstage-tempenv
Oct 26, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix9/funcstage-tempenv

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

WIP: pipeline function stages dropped their temporary-environment prefix assignments entirely — the stage's cloned sub-shell never called apply_temporary_assignments, so a=0; a=9 f | cat printed 0 instead of running the body with a=9. This mirrors the non-pipeline function invocation path on the stage clone: apply the prefix assignments, register function_tempenv_names, skip the body on posix-fatal / DISCARD-class failures with status 1, and restore after the body (GNU subst.c:13153, variables.c:3536, execute_cmd.c:5181,5233,5252).

Fixes #1765

Regression coverage: tests/issue1765_pipeline_function_stage_tempenv_regressions.rs — 17 pins with GNU bash 5.3.20 expectations (scalar/indexed/assoc prefixes, append forms, mid-stage application, sibling-stage isolation, readonly posix/default faces, arith-expansion failure).

Unlock note: on the original base the indexed-append pin was red for an out-of-scope reason — the shared tempenv machine's compound branch ignored the append flag (root cause of #1620). That fix has since landed on master via #1767 (merge 43f59df, commit 461cd1f: compound APPEND words prepend the old cell's scalar view). This branch is rebased onto master 202de47 and the pin now passes with zero changes to the patch and zero changes to any assertion.

Gates on the rebased tree (single build-slot run; logs in the cluster work dir):

Gate Result
Full build (cargo build --locked) RC=0
Targeted #1765 (17 pins) 17 passed / 0 failed
lib full, rebased tree (--skip login_posix_env) 771 passed / 1 failed / 1 ignored
lib full, pristine master 202de47 771 passed / 1 failed / 1 ignored — failure sets identical (sole failure: ownership_unary_operators_check_existing_file, the known baseline)
diffcorpus 306 vs GNU 5.3.20 306 passed / 0 failed (failure set ∅ ⊆ {ms10}; ms10 passed outright this run, outputs byte-identical)
rustfmt (changed files, per-file) clean; CR count 0

Full cluster report: ~/workspace/rubash-fix9/clusters/funcstage-tempenv/REPORT.md (§「解闸收尾」).

…(rubash#1765)

Pipeline function stages ran on a cloned sub-shell that never called
apply_temporary_assignments, so prefix assignments were dropped and
the function body saw the outer values (a=0; a=9 f | cat printed 0).
Mirror the non-pipeline function invocation path on the stage clone:
apply the prefix assignments, register function_tempenv_names, skip
the body on posix-fatal / DISCARD-class failures with status 1, and
restore after the body (GNU subst.c:13153, variables.c:3536,
execute_cmd.c:5181,5233,5252).

Regression tests: tests/issue1765_pipeline_function_stage_tempenv_regressions.rs
(17 pins, GNU 5.3.20 expectations).

Fixes #1765
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 26, 2026 17:50
@caomengxuan666
caomengxuan666 merged commit a94c90c into master Oct 26, 2026
10 of 11 checks passed
@caomengxuan666
caomengxuan666 deleted the fix9/funcstage-tempenv branch October 30, 2026 01:41
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.

Pipeline function stage drops prefix (temporary) assignments entirely

1 participant