Skip to content

Hand the contract a launcher it can execute - #169

Merged
frangarcj merged 1 commit into
masterfrom
next-host-runner-arguments
Aug 26, 2026
Merged

Hand the contract a launcher it can execute#169
frangarcj merged 1 commit into
masterfrom
next-host-runner-arguments

Conversation

@frangarcj

Copy link
Copy Markdown
Contributor

The Intel macOS host built its whole SDK, validated it, and then died naming nothing. From vitasdk/autobuilds#36 after #168 landed:

23:29:27  -- Validated SDK at .../build/vitasdk
23:29:28  -- Static target SDK validation passed
23:29:47  Host dependency audit passed
23:29:47  [100%] Built target finalize-sdk
23:29:47  no such file or directory
23:29:47  make[3]: *** [CMakeFiles/check-toolchain-contract] Error 1

VITASDK_HOST_RUNNER carries the launcher that lets an arm64 machine run what it cross-built — arch -x86_64 — and it arrives from the shell as one string. Interpolated into a VERBATIM COMMAND, a string with a space in it is a single argv[0], so what got looked up on disk was a program named arch -x86_64:

$ cmake -E env FOO=1 "arch -x86_64" cmake -E echo ran
no such file or directory
$ cmake -E env FOO=1 arch -x86_64 cmake -E echo ran
arch: posix_spawnp: /opt/homebrew/bin/cmake: Bad CPU type in executable

The second message is this arm64 laptop refusing to run its own arm64 cmake under arch -x86_64, which is the point: the launcher was reached and did its job. On the runner the binary behind it is the x86_64 SDK, and Rosetta runs it.

x86_64-apple-darwin is cross-built, so check-toolchain-contract is the only thing that executes what it produced. Without it the host publishes unverified — the situation db4d1a593 was written to end.

Second defect of the same commit, and it was hidden behind the first. While run[@]: unbound variable was killing the arm64 leg, the Intel job stopped at no build-machine SDK found for x86_64-apple-darwin (needs arm64-apple-darwin) and never got near the contract. Fixing #168 is what let this one surface.

tests/cmake/host-runner-command.cmake runs the shape the target uses — an environment, a two-word launcher, a command behind it — with cmake -E env as the launcher, because that exists wherever the test runs. Against a runner that is not split it fails three ways:

a launcher with an argument stays two arguments: expected 2 argument(s), got 1
a launcher with several arguments keeps them all: expected 3 argument(s), got 1
a launcher with arguments did not reach the command: status 1, output ''

The split lives in cmake/HostRunner.cmake so the test can call the same function the target does, rather than a copy of it. The shell side is unchanged: smoke_test_bootstrap splits the same string on whitespace into an array, which is correct there.

Every suite in the checks job passes locally.


AI tools were used in preparing this PR (Claude Opus 5, Anthropic).

The Intel macOS host built its whole SDK, validated it, and then died
with

    no such file or directory

naming nothing. The Rosetta gate passes `arch -x86_64` as the launcher
that lets an arm64 machine run what it cross-built, and that arrives as
one string. Interpolated into a VERBATIM COMMAND, a string with a space
in it is one argv[0], so what was looked up on disk was a program called
"arch -x86_64":

    $ cmake -E env FOO=1 "arch -x86_64" cmake -E echo ran
    no such file or directory
    $ cmake -E env FOO=1 arch -x86_64 cmake -E echo ran
    ran

The Intel host is cross-built, so the contract is the only thing that
executes what it produced: without it the host publishes unverified,
which is the situation the gate was written to end.

Second defect of the same commit, and it was hidden behind the first --
the build never reached the contract while the smoke test was killing
the arm64 leg it cross-builds from. tests/cmake/host-runner-command.cmake
runs the shape the target uses, with a two-word launcher that exists
wherever the test runs; against a runner that is not split it fails
three ways, one of them by not running the command at all.
@frangarcj
frangarcj merged commit 283b076 into master Aug 26, 2026
13 of 19 checks passed
@frangarcj
frangarcj deleted the next-host-runner-arguments branch August 26, 2026 19:55
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.

1 participant