I'm trying to diagnose some weird failure (roc run
building the host but then exiting with code 9?) and not having a great time of it. Is there a way to get Roc to give verbose logging output to help figure out what's going on here?
(This only happens on CI, FWIW! If it were local I'd have a lot more tools.) https://github.com/roc-lang/rbt/actions/runs/3044411941/jobs/4904773008
@Ayaz Hafiz may be able to help you here, since the failure only happens on x86_64 macos.
well, it seems like it maybe happens on Linux too. I’ve got the integration tests disabled for that target right now
alright, I'll give it a try
On linux I get:
---- examples::test_hello_world stdout ----
Ok(
Output {
status: ExitStatus(
unix_wait_status(
25856,
),
),
stdout: "🔨 Rebuilding host...\n",
stderr: "thread '<unnamed>' panicked at 'Failed to rebuild src/main.rs - stderr of the `cargo build` command was:\nerror: no bin target named `host`\n', crates/compiler/build/src/link.rs:1310:27\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\nthread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any { .. }', crates/cli/src/build.rs:324:46\n",
},
)
thread 'examples::test_hello_world' panicked at 'assertion failed: false', tests/examples.rs:25:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
This may be expected, as is mentioned above the test:
// example tests are disabled for Unix right now since there's a bug preventing
// them from running[...]
So probably best to continue on MacOS x86_64
That Linux issue is due to trying to use the surgical linker but not being set up for it. You probably will get the real issue if you run with --linker=legacy
I think I'll just dig out my x86 mac and try it locally. Gonna have some serious dust to blow off though. :laughing:
welp, dust blown off, upgraded to macOS 12 dot whatever, and I can't reproduce the bug. :rolling_eyes: Soooooo once again: are there any "BE VERY VERBOSE" flags or environment variables I can throw in here to get more info out of CI?
also if anyone knows what exit status 9 would mean, that'd answer some questions!
(specifically the question: what does exit status 9 mean?)
If the exit codes are the same as on linux; it means that the system killed your process, a common cause of that seems to be running out of memory.
I don't think looking at verbose compiler output will help here, my first step would be to download the executable that ci used for the test and see what it does on your machine.
Example on how to upload the executable: https://github.com/roc-lang/roc/blob/4644ce40e3f492af2df6515ab7ae290f8221a243/.github/workflows/nix_linux_x86_64.yml
I'd also inspect memory usage when just running the test on your own machine
OK, here's something curious: it works if I build a binary and then run the binary instead of just doing roc run
:thinking:
I've also seen that behavior in a different error here but I have not yet found the cause.
Last updated: Jul 06 2025 at 12:14 UTC