Skip to content

Describe of a fresh PATH walk absolutizes the display instead of the as-written join (command -v / type) #3147

Closed

Description

@caomengxuan666

现象

未执行过(未入 hash 表)的命令做 fresh PATH walk 描述时,command -v / type 打印的是锚定到会话 cwd 的绝对路径(带 /./ 残留),GNU 打印 walk 构造的 as-written join 本身。

复现(fixture 目录为 cwd,rel1/foo 为 0755 脚本):

PATH=./rel1:$PATH
command -v foo
type foo
  • GNU bash 5.3.20:./rel1/foo / foo is ./rel1/foo
  • rubash(master 88047f5 基底实测):/tmp/<fixture>/./rel1/foo / foo is /tmp/<fixture>/./rel1/foo

GNU 语义

findcmd.c 的 walk 只构造一个字符串(sh_makepath 的 <elem>/<name> join);describe_command(builtins/type.def)打印的正是这个构造名。已记录(hashed)情形的同一问题已由 #2696 修复(记录拼写);本单是未记录情形的 describe 显示面,是同一「一个构造字符串」机制的另一表面。

定位(初步)

command_path_with_bridge(src/executor/lookup_paths.rs)对 fresh walk 返回 find_user_command 的锚定结果经 shell_display_path 的形式;describe 显示应改为 walk 的 as-written join(find_user_command_as_written / #2696 引入的 recorded_resolution_spelling 同一套锚定相等判定),hashed 情形继续用记录拼写。command_paths(type -a 枚举)同面核查。

归宿

1.5.1 后续波,与 #2696/#2717 同族(area:path);修法落点在 describe 层,不动执行 walk。

Activity

  1. added this to the 1.5.1 milestone on Nov 8, 2026
  2. added
    bug
    gnu-baseline
    P3-low
    area:path
    on Nov 8, 2026
  3. caomengxuan666 commented on Nov 8, 2026

    @caomengxuan666
    MemberAuthor

    订正一点:正文「已由 #2696 修复」不准确——#2696 仍 OPEN,其修法在途于 draft PR #3120(X2 组,目前只推了 4 个钉提交,修法 WIP 在 lane 工作区未推)。

    本单是 describe 层的另一表面,修法依赖 #2696 引入的 recorded_resolution_spelling 机制,故归宿定为:等 #3120 合入后再派单修车道,不并入在飞的 X2 车道。

  4. caomengxuan666 commented on Nov 11, 2026

    @caomengxuan666
    MemberAuthor

    Fixed by PR #3215 (squash-merged as f5f65d35e97e7707171d9d737cbf01421d8a7432, 2026-11-11T12:14:26Z), captain-verified.

    • Captain review flipped INCOMPLETE → PASS after the owed §F2B leg landed on the Simular box: base vs head --all-targets sets identical at 28 points each (14 lint + 14 could-not-compile), both-way diffs empty; all 14 lint points live in the tests/ hygiene face (the [freeze-1.5.0] executor_tests hygiene: three wrong pins (BASH_ARGC/ARGV vs GNU 5.3.20) + parallel-fd full-run hang at mapfile -u3 pin #2631 family), none in this PR's files or src/.
    • Two cells argued over during the lane's life (per the review record) were settled against the GNU source/oracle before the pin was finalized — the pin as merged encodes the measured expectations.
    • Merge round, for the record: the final head ae30ce56 first showed two unrelated environment reds in sequence — a macOS issue2859 counting-race cell (established flake family: zero intersection, same leg green on the adjacent head and on master's own CI) and a single-cell goldens trap-timing miss (sub-term-wait). The goldens job was re-run exactly once and turned green, so the PR merged on a fully green final head; the captain's fallback flake ruling for the macOS cell was recorded but never needed to carry the merge.

    Closing as fixed on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P3-lowarea:pathbuggnu-baseline

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions