Repository navigation
fix(executor): resolve redirect/cd/funsub/type byte spellings through the node (Refs #3372) - #3872
Merged
Merged
Conversation
… the node (Refs #3372) #3218 residual: the sibling consumers of the #3368/#3218 node-key funnel still consulted the folded-string record, so same-string collisions survived for the pre-create opens, the external stdout/cat-output opens, `cd`, `$(<file)`, and the `type` display face. Root cause: `a="$(printf 'x\234')"` (raw byte 0x9C) and `b=x$'\u009c'` (genuine U+009C, UTF-8 C2 9C) fold to the same string. GNU hands each redirect its own expanded bytes (redir.c:298 redirection_expand) and opens them verbatim (redir.c:702 redir_open); cd chdirs the verbatim bytes (builtins/cd.def change_to_directory); `$(<file)` reads the verbatim bytes (subst.c command_substitute); `type` prints the name and the find_user_command hit verbatim (builtins/type.def describe_command). The consumers below took the folded-string record instead, so a transport sibling's spelling steered the genuine leg onto the raw-byte file (or vice versa). Fix (same mechanism as #3368): consumers that hold the node resolve the byte spelling through the node's own record; no record falls back to the plain funnel; the string-keyed record is never consulted. - source_type_state.rs / function_calls.rs pre-create opens take `Some(redirect)` (`create_redirect_output_prepared[_open]_for`). - external_redirects.rs `apply_external_stdout_target` and external_finish.rs `open_cat_output[_sink]` take the node and use `create_redirect_output_for` / `open_append_target_for`. - `cd` takes the byte spelling computed before the fold (`transport_name_spelling_bytes`) on unix (`cd_filesystem_path`). - `$(<file)` takes the pre-fold byte spelling on unix. - `type` / `type -p` / `command -v` / `type -a` write describe lines byte-wise (`write_describe_line` + `describe_display_bytes`) in both `describe_name_with_io` and `describe_name_all_with_io`; with no transport the byte spelling is the folded name's UTF-8 bytes, so plain names print exactly as before. Regression pins (6 stems, 12 tests; expectations from GNU bash 5.3.20 oracle probes, LC_ALL=C.UTF-8): - tests/issue3372_precreate_node_spelling.rs (3) - tests/issue3372_external_stdout_node_spelling.rs (2) - tests/issue3372_cat_output_node_spelling.rs (2) - tests/issue3372_cd_byte_spelling.rs (2; marker landing, not pwd output) - tests/issue3372_funsub_input_byte_spelling.rs (2) - tests/issue3372_type_display_byte_spelling.rs (1) UNVERIFIED-BY-CAPTAIN: no build route was available (X299 tunnel down, local build banned, box wallet empty), so the pins were not run and no cargo check/test ran. The captain verifies fail-first on base and green on this head on a live route before merge. Known residuals (see lane REPORT): `pwd`/PWD display of a raw-byte directory still diverges from GNU (byte-level pwd output is a separate face, deliberately not pinned); function-definition printing in `type` Verbose still goes through folded AST text; external_redirects.rs has 6 pre-existing rustfmt-drift hunks unrelated to this change. ## 本 PR 删除了什么 无删除。纯增量修法 + 6 个新钉文件;既有 `tests/issue3372_append_funnel_node_spelling.rs` 未动。
Member
Author
|
【WIN-AGENT-AUDIT】PR #3872 第2轮(l1 续作)— 接手修编译错 |
Member
Author
|
【WIN-AGENT-AUDIT】PR #3872 第3轮(l1 续作)— 建议:FAIL 机制核查:
续作记录(本轮动过代码):
腿(WSL Linux 原生,/root/l1-rubash + /root/l1-target,GNU oracle /usr/local/bin/bash 5.3.20):
F 点:
未跑/VOID 的腿:无(判词已由钉红定案;cli/regression 基线归因按同名同数推断,未跑 base 侧 cli/regression 对照——记为部分 VOID)。 |
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.
fix(executor): resolve redirect/cd/funsub/type byte spellings through the node (Refs #3372)
#3218 residual: the sibling consumers of the #3368/#3218 node-key funnel
still consulted the folded-string record, so same-string collisions
survived for the pre-create opens, the external stdout/cat-output
opens,
cd,$(<file), and thetypedisplay face.Root cause:
a="$(printf 'x\234')"(raw byte 0x9C) andb=x$'\u009c'(genuine U+009C, UTF-8 C2 9C) fold to the same string. GNU hands each
redirect its own expanded bytes (redir.c:298 redirection_expand) and
opens them verbatim (redir.c:702 redir_open); cd chdirs the verbatim
bytes (builtins/cd.def change_to_directory);
$(<file)reads theverbatim bytes (subst.c command_substitute);
typeprints the name andthe find_user_command hit verbatim (builtins/type.def describe_command).
The consumers below took the folded-string record instead, so a
transport sibling's spelling steered the genuine leg onto the raw-byte
file (or vice versa).
Fix (same mechanism as #3368): consumers that hold the node resolve the
byte spelling through the node's own record; no record falls back to the
plain funnel; the string-keyed record is never consulted.
Some(redirect)(create_redirect_output_prepared[_open]_for).apply_external_stdout_targetandexternal_finish.rs
open_cat_output[_sink]take the node and usecreate_redirect_output_for/open_append_target_for.cdtakes the byte spelling computed before the fold(
transport_name_spelling_bytes) on unix (cd_filesystem_path).$(<file)takes the pre-fold byte spelling on unix.type/type -p/command -v/type -awrite describe linesbyte-wise (
write_describe_line+describe_display_bytes) in bothdescribe_name_with_ioanddescribe_name_all_with_io; with notransport the byte spelling is the folded name's UTF-8 bytes, so
plain names print exactly as before.
Regression pins (6 stems, 12 tests; expectations from GNU bash 5.3.20
oracle probes, LC_ALL=C.UTF-8):
UNVERIFIED-BY-CAPTAIN: no build route was available (X299 tunnel down,
local build banned, box wallet empty), so the pins were not run and no
cargo check/test ran. The captain verifies fail-first on base and green
on this head on a live route before merge.
Known residuals (see lane REPORT):
pwd/PWD display of a raw-bytedirectory still diverges from GNU (byte-level pwd output is a separate
face, deliberately not pinned); function-definition printing in
typeVerbose still goes through folded AST text; external_redirects.rs has 6
pre-existing rustfmt-drift hunks unrelated to this change.
本 PR 删除了什么
无删除。纯增量修法 + 6 个新钉文件;既有
tests/issue3372_append_funnel_node_spelling.rs未动。