Skip to content

fix(doctor): a shell's own commands are no programs missing from PATH - #511

Merged
7schmiede merged 1 commit into
mainfrom
fix/doctor-shell-builtins
Nov 10, 2026
Merged

7schmiede merged 1 commit into
mainfrom
fix/doctor-shell-builtins

Conversation

@7schmiede

Copy link
Copy Markdown
Member

What and why

devstack doctor checked the first word of each build, run and exec line on PATH. set "E2E_URL={service.web.url}" && npx playwright test, the line the stack file reference recommends for Windows since 0.45.0 (#504), failed with not on PATH, but the stack file runs them: set (#510). It now takes the first word of each command between &&, ||, ;, | and & (outside quotes; 2>&1 stays a redirection), leaves out what the step's shell runs itself (cmd: set, cd, call, …; sh: export, cd, ., …) and, in sh, the assignments before a command (X=1 npx …).

Point
Cause The check took the first word of a line as its program, without knowing the shell the line runs in.
Bug class shell-builtin-as-program
Proof the_programs_of_a_line_leave_out_the_shells_builtins written first (red: no such function), green now; both shells, the reference's lines, quotes, groups, redirections, and a builtin of the other shell counting as a program. With a stack file holding the reference's line: 0.45.0 says FAIL not on PATH … set, this build ok tools on PATH: node, npx.
Siblings The only other PATH check is the one for docker, which names its program. The behaviour is as old as doctor (0.3.0); a cd web && npm start line failed the same way.
Guard The test above.

No review card: a check gets more exact; no format, trust or term changes.

Closes #510

🤖 Generated with Claude Code

`devstack doctor` checked the first word of each `build`, `run` and `exec`
line on PATH, so `set "E2E_URL=…" && npx playwright test`, the line the
stack file reference gives for Windows since 0.45.0, failed with "not on
PATH: set". It now takes the first word of each command between `&&`,
`||`, `;`, `|` and `&` (outside quotes), leaves out what the step's shell
runs itself (cmd: `set`, `cd`, `call`, …; sh: `export`, `cd`, `.`, …) and,
in sh, the assignments before a command, so `npx` is what gets checked.

Closes #510

Bug-Class: shell-builtin-as-program
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 2db50a3 into main Nov 10, 2026
@7schmiede
7schmiede deleted the fix/doctor-shell-builtins branch November 10, 2026 18:23
@7schmiede 7schmiede mentioned this pull request Nov 10, 2026
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.

doctor: a shell builtin in an exec step (cmd's set) is reported as a program missing from PATH

1 participant