Skip to content

fix(rust): on-file spawn error names the program and the $PATH search - #1181

Merged
thekevinscott merged 5 commits into
mainfrom
claude/1172-on-file-path
Sep 24, 2026
Merged

thekevinscott merged 5 commits into
mainfrom
claude/1172-on-file-path

Conversation

@thekevinbot

@thekevinbot thekevinbot commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1172

A bare --on-file program missing from $PATH now fails with a message that names the program (argv[0], not the unsplit template), says $PATH was searched, and, when a file by that name exists in the command's working directory, offers the ./ form. Resolution is unchanged: a bare name is never run from the scanned directory.

Before:

dirsql: skipping `notebook.md`: on-file command failed: failed to spawn `extract.py {path}`: No such file or directory (os error 2)

After:

dirsql: skipping `notebook.md`: on-file command failed: failed to spawn `extract.py`: not found on $PATH. Names without a `/` are resolved against $PATH; use `./extract.py` to run `/tmp/claude-1172-manual/extract.py`

A name without a local match prints only failed to spawn nope-xyz: not found on $PATH. A name containing / keeps the OS error, now naming the program.

Rust API: CommandError::Spawn { command, .. } becomes Spawn { program, .. }, and CommandError::NotOnPath { program, local } is new. Migration fragment covers it. No SDK surface changes, so no PARITY.md change and no parity drift.

Not addressed: the issue's note that the trailing parser produced no rows ... cannot infer a schema line is a cascade when every file fails to spawn. That is a separate behavior change and is left for its own issue.

Manual run: built target/debug/dirsql, then in a temp dir with an executable extract.py and notebook.md, ran dirsql --on-file 'extract.py {path}' "SELECT content FROM './notebook.md'" through the Rust binary, the Python launcher (uv run dirsql) and the TS launcher (node packages/ts/dist/cli/dirsql.js). All three print the "After" line above. ./extract.py {path} returns rows.

Changelog / Migrations

  • Changelog fragment added under <root>/<pkg>/changelog.d/ for each changed package (packages/rust/changelog.d/2026-09-24-on-file-not-on-path.md)
  • Migration fragment added under <root>/<pkg>/migrations.d/ (packages/rust/migrations.d/2026-09-24-on-file-not-on-path.md: CommandError shape change)

E2E Verification

  • Ran e2e suites locally for every affected SDK
  • Python SDK e2e: pass
  • TypeScript SDK e2e: pass
  • Rust core e2e (if applicable): pass
  • packages/python/e2e-attestations/<branch>.json receipt written if packages/python changed (just e2e-attest-python)
  • packages/ts/e2e-attestations/<branch>.json receipt written if packages/ts changed (just e2e-attest-ts)
  • Command(s) run: cargo test -p dirsql --features cli, uv run maturin develop then just e2e-attest-python, just e2e-attest-ts
  • Result summary: Rust workspace suite green (incl. new command_runner and path_table_on_file_e2e cases); Python e2e 38 passed; TS e2e 18 passed.

@thekevinscott
thekevinscott merged commit 7694e5a into main Sep 24, 2026
82 checks passed
@thekevinscott
thekevinscott deleted the claude/1172-on-file-path branch September 24, 2026 21:01
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.

--on-file: spawn error does not say it searched $PATH

2 participants