Skip to content

WIP: forward-port #1766 host-env harness fix + weak-row upgrade (tests-only) - #1812

Merged
caomengxuan666 merged 2 commits into
masterfrom
fix9/1766-forward
Oct 27, 2026
Merged

caomengxuan666 merged 2 commits into
masterfrom
fix9/1766-forward

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

WIP: forward-port of the #1766 host-env harness fix to current master, plus the weak-row upgrade (tests-only).

Refs #1766

Why this PR exists

PR #1779 was merged (711d429) before its verification gates landed, and the
merge took the original fix commit (2edd162) but NOT the harness fix
(35e527a, on branch fix9/carrier-host1766). As a result, master's copy of
tests/issue1766_host_env_prefix_regressions.rs panics 16/16 in
run_host_captures (Arc::try_unwrap): the Executor owns the handler
closure, which owns the second Arc clone of the capture sink, so the unwrap
can only succeed once the executor is dropped. CI does not catch this
because the Rust tests job runs --lib plus three named integration targets
only — this file is not among them.

Contents (one commit, tests-only, no product code)

Commit 58535403 (on master c9bd0f3f, Merge PR #1763):

  • Forward-port of 35e527a verbatim: drop(executor) before
    Arc::try_unwrap in run_host_captures, with its comment (verified
    against git show 35e527a7, not rewritten from memory).
  • Upgrade of the formerly weak top-level compound-append row
    (issue1766_top_compound_append_leaks_no_marker → renamed
    issue1766_top_compound_append_composes_window_value) from no-marker-leak
    only to the exact GNU value 1(9) (plus the retained assert_no_marker).
    Its upgrade condition is met: fix7/carrier: tempenv compound append, carrier pair views, eval marker data (#1620, #1635, #1634 eval face) #1767 has merged. The file header note is
    updated accordingly.

Gates (final base c9bd0f3 + 5853540, via the build-slot, JOBS=1, purified env)

  • issue1766 file: 14 passed / 2 failed. The upgraded row passes (exact
    1(9)). The 3 marker rows that failed on the pre-merge tree now pass on
    current master (stored command text no longer carries marker bytes). Only
    2 rows fail, both on !env.contains_key("ref") (nameref rows, top-level
    and stage); their value assertions (var=origx) pass.
  • lib (--skip login_posix_env): 771 passed / 1 failed / 1 ignored; the
    single failure is the allowed ownership_unary_operators_check_existing_file
    (baseline-identical set).
  • diffcorpus (306, GNU 5.3.20 oracle): 305/306, single failure ps06.
    ps06 is a known timing flake; isolated re-runs x3 on the same tree and
    binary all PASS (2026-10-27 00:59 UTC), so the ps06 full-run failure is
    ruled a timing flake, not a Host external-command channel re-applies raw prefix assignments (incl. carrier markers) into the host env map #1766 regression — effective failure set
    ∅ ⊆ {ms10}. On the previous base (48aa7c7) the same gates gave
    306/306.

Deliberately NOT in this PR

The 2 remaining nameref rows are left exactly as they are — assertions
unchanged, no watering down. Their captured maps were dumped with a
temporary probe (since removed; tree is clean): both maps contain
var=origx (correct) and ref=var (the nameref target name riding along in
the base clone), and both maps are full shell-env clones (94/96 keys), not
exported-only sets. Deciding between (a) rescoping those test invariants to
assignment-derived keys and (b) changing the host map to exported-only is
the parent's call and will be handled separately; this PR changes neither
the assertions nor the product code for those rows.

Full report: REPORT-FORWARDPORT.md in the cluster directory
(~/workspace/rubash-fix9/clusters/carrier-host1766-forward/).

…mpound-append row to exact 1(9)

Forward-port of 35e527a (fix9/carrier-host1766), which missed the
#1779 merge: drop the Executor before unwrapping the capture Arc in
run_host_captures, otherwise all 16 tests panic in try_unwrap before any
assertion runs. Also upgrades the formerly weak top-level compound-append
row (no-marker-leak only) to assert the exact GNU value 1(9); its upgrade
condition is met now that #1767 has merged. The 5 base-clone rows
(marker hits on __RUBASH_LAST/CURRENT_COMMAND, nameref contains_key ref)
are deliberately left untouched pending the parent's ruling on the host
map contract (rescope test invariants vs exported-only host map).

Refs #1766
…#1766)

Adjudication (c) for the last two PR #1812 pins
(issue1766_top/stage_nameref_append_binds_target): the pins are
correct GNU expectations - 'declare -n ref=var; var=orig; ref+=x env'
prints var=origx and NO ref= line - and the product leaked the
nameref cell itself ('ref=var', the target NAME as text) into the
host env map, whose base is a full-table clone.

invoke_host_external_command now removes nameref alias cells from
that base clone, selected by the NAMEREF_VARS attribute set (never
a name blacklist). The target cell stays, so nothing is lost; the
prefix composition below (tempenv_export_name already resolves
prefix names to their targets) is untouched, as is the rest of the
channel contract (the clone still carries unexported non-prefix
cells - issue1766_top_tempenv_restores_after_host_command pins
a=14 in the second capture).

Gate: tests/issue1766_host_env_prefix_regressions.rs 16/16
(was 14/16 on this branch).
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 27, 2026 15:41
@caomengxuan666
caomengxuan666 merged commit 0f16cf2 into master Oct 27, 2026
8 of 9 checks passed
@caomengxuan666
caomengxuan666 deleted the fix9/1766-forward branch October 30, 2026 01:42
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