fix(run): mcpp build then mcpp run exec'd a bare-metal ELF on the host - #458
Merged
Conversation
… host
Shipped in 2026.8.19.2 and found by running the released binary through the
flow a new user takes:
$ mcpp new blinky --template riscv-virt-rt && cd blinky
$ mcpp run # ok — boots in qemu
$ mcpp build && mcpp run # Running `target/riscv64-none-elf/…/bin/blinky`
# no emulator, no output, exit=1
`try_fast_run` exec's the cached artifact directly, and matched cache entries
whose targetTriple is "" on the reasoning — written in its own header — that
"`mcpp run` never takes a --target flag". The caller does guard the flag, but a
project can name its target in the MANIFEST instead, and that spelling never
reaches the cache key: a cross build's entry is written as "" and read back as
if it were a host build.
The fix states the function's actual precondition: it exec's the artifact, so
it is valid only when the artifact is for this machine. A declared default
target turns the fast path off and the full prepare — which is what resolves
the runner — takes over.
⚠️ The first version of the regression test was a false green: added to an
existing project in e2e/131 it passed with the fix disabled. Probing all 16
bail-outs showed the fast path was never reached there, because mcpp.toml was
newer than build.ninja — a rebuild does not rewrite build.ninja when its
content is unchanged, so in a directory whose manifest was edited in place the
fast path is already off. The test now builds a fresh project, and was checked
red-then-green against the fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shipped in 2026.8.19.2 and found by running the released binary through the
flow a new user takes:
try_fast_runexec's the cached artifact directly, and matched cache entrieswhose targetTriple is "" on the reasoning — written in its own header — that
"
mcpp runnever takes a --target flag". The caller does guard the flag, but aproject can name its target in the MANIFEST instead, and that spelling never
reaches the cache key: a cross build's entry is written as "" and read back as
if it were a host build.
The fix states the function's actual precondition: it exec's the artifact, so
it is valid only when the artifact is for this machine. A declared default
target turns the fast path off and the full prepare — which is what resolves
the runner — takes over.
existing project in e2e/131 it passed with the fix disabled. Probing all 16
bail-outs showed the fast path was never reached there, because mcpp.toml was
newer than build.ninja — a rebuild does not rewrite build.ninja when its
content is unchanged, so in a directory whose manifest was edited in place the
fast path is already off. The test now builds a fresh project, and was checked
red-then-green against the fix.
Released as 2026.8.19.3.