You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] $0/BASH_SOURCE of a script invoked by absolute /d/-style path is rewritten to D:/ native form while $PWD stays /d/ — breaks path math (bats-core suite blocked) #224
Invoke with an absolute POSIX-style path: rubash.exe /d/repo/.../pwdsrc.sh
GNU bash 5.3.0 (bash /mnt/d/.../pwdsrc.sh): all three are the SAME string the caller used; GNU never rewrites $0/BASH_SOURCE into a different path form. $PWD and $0 are always consistent.
Relative invocation (rubash pwdsrc.sh from its dir) keeps the relative form (consistent with GNU), so the rewrite happens only for absolute /d/-style invocations (including exec /d/.../script).
Why it matters (bats-core blocked on it)
bats-core's launcher chain does cd "$(dirname "$(bats_readlinkf "${BASH_SOURCE[0]}")")" (libexec/bats-core/bats:120) and builds $BATS_RUN_TMPDIR/${BATS_TEST_FILE_NUMBER}-${BATS_TEST_FILENAME##*/}.src (lib/bats-core/preprocessing.bash:6). With $BASH_SOURCE in D:/ form, ${BATS_TEST_FILENAME##*/} does not strip (no / in backslash paths), producing the invalid mixed filename C:/Users/.../Temp/bats-run-XXX/1-D:\repo\...\tagging.bats.src -> Invalid argument, and every bats test file dies with not ok 1 bats-gather-tests (rc=1) while the same files are green under GNU (and on a patched copy with a D:/-normalizing readlinkf, GNU stays green, rubash still hits it from the second path source).
GNU C source: bash sets $0 from the filename as given to execute_disk_command/shell startup (shell.c); there is no platform re-canonicalization of $0/BASH_SOURCE independent of $PWD. The invariant rubash breaks: within one process, $PWD, $0, and BASH_SOURCE must live in the SAME path domain so dirname/parameter-chops compose.
Related: rubash#166 ($0 correctness family, content-level) — this issue is the path-FORM inconsistency (D:/ vs /d/) against $PWD after it.
Artifacts: target/issue-suites/results/ecosuite/bats-core/ (tagging.rub.err with the 1-D:\...src failure, GNU-green outputs), probe target/ecosuite/probe/pwdsrc.sh.
Also observed in the same chain (env-bound, winuxsh): export -f function does not survive exec env VAR=x <bash-script> under rubash (rubash exports BASH_FUNC_f%%=... correctly and direct rubash children import it; through the external env utility the function is lost — bin/bats:89-90 export -f bats_readlinkf + exec env BATS_ROOT=... bats reports bats_readlinkf: command not found at libexec/bats-core/bats:119). GNU env passes it through. That loss point is the external env tool, not the rubash engine.
Lane: wt4/ecosuite evaluation suites (no src/ fixes in lane).
Activity
ecosuite lane: dedicated mixed-suite coverage (modernish/mvdan-sh/nvm…
ecosuite fixes: #218 assignment-RHS backslash data, #219 comment newl…
caomengxuan666 commentedon Sep 27, 2026
已修复并合入 master(commit d3e8aff,lane wt4/ecofix,GNU 引用见提交;探针/夹具与 WSL GNU 5.3.0 字节一致)。感谢报告!
docs(#329): path-form rendering policy analysis - four-source decompo…
fix(path): self-produced path values render POSIX form — $0, BASH, in…
docs(corpus): ecosweep4 section - dev-toolchain shell layer wave + B …
tests(#373): GNU-counter-evidenced expectation flips + type_p cwd har…
tests(#374): executor_tests mechanical flips + alias/extglob posture …
tests(#374): wt37 round-2 CLI-posture conversions with GNU 5.3.0 evid…
fix(#412): function pipeline stage with an output redirect keeps its …