Repository navigation
WIP: fix(executor): apply tempenv assignments in pipeline function stages (#1765) - #1804
Merged
Merged
Conversation
…(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
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: pipeline function stages dropped their temporary-environment prefix assignments entirely — the stage's cloned sub-shell never called
apply_temporary_assignments, soa=0; a=9 f | catprinted0instead of running the body witha=9. This mirrors the non-pipeline function invocation path on the stage clone: apply the prefix assignments, registerfunction_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):
cargo build --locked)--skip login_posix_env)ownership_unary_operators_check_existing_file, the known baseline)Full cluster report:
~/workspace/rubash-fix9/clusters/funcstage-tempenv/REPORT.md(§「解闸收尾」).