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
Commit d06a023
Browse filesBrowse the repository at this point in the historyBrowse files
feat: mcpp run and mcpp test name a script's missing #! interpreter
An artefact the run slot executes directly can be a script: emsdk's
JavaScript launcher begins `#!/usr/bin/env node`. An emsdk payload
installed before its recipe wrote `.mcpp-toolchain.json` names no
runner, so the launcher runs through that line, and on a host without
`node` on PATH the only output was `/usr/bin/env: 'node': No such file
or directory`. mcpp had spawned `env` successfully, so none of its own
launcher messages applied, and nothing named the cause or the remedy.
mcpp.build.runner_lookup now reads a script's `#!` line as the kernel
reads it (parse_script_interpreter, script_interpreter): the interpreter
is the first word after `#!`, and through `env` the program is the
first word that is neither `-S` nor a `NAME=value` assignment. A form
it does not read with certainty (a relative interpreter, any other
`env` option, `env` with no program) names no program, so the note
never names the wrong one. Windows reads no `#!` line and is skipped.
missing_interpreter_note says, when the interpreter is not an
executable file or the program `env` would look up is on no directory
of the artefact's PATH, which program is missing, that a toolchain
payload names its runner in `.mcpp-toolchain.json` and one installed
before its recipe wrote that file names none, and the remedy:
`mcpp index update`, then `mcpp toolchain remove <spec>` and
`mcpp toolchain install <spec>`. It names no toolchain, because which
payload built a file is not a fact its first line holds.
`mcpp run` prints the note before it executes an artefact with no
runner and no execution host, against the PATH the artefact receives;
the blank line before the program's output now follows the composed
environment so the note stays above it. `mcpp test` prints it once per
build, for the first test it executes directly. Neither prints it for
`--print-launch`, and `mcpp test` not under `--message-format json`.
Tests: five RunnerLookup cases cover the parse (direct, `env`, `env -S`
with an assignment, CRLF), the forms that name no program, a missing
`env` program and a missing interpreter path, and the cases that stay
silent (a found interpreter, a binary, a missing file). docs/20 states
the note in both languages in place of "mcpp does not yet explain it".
Closes#621
0 commit comments