Stream: platform development

Topic: verbose mode in roc run


view this post on Zulip Brian Hicks (Sep 13 2022 at 11:06):

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

view this post on Zulip Anton (Sep 13 2022 at 11:27):

@Ayaz Hafiz may be able to help you here, since the failure only happens on x86_64 macos.

view this post on Zulip Brian Hicks (Sep 13 2022 at 12:34):

well, it seems like it maybe happens on Linux too. I’ve got the integration tests disabled for that target right now

view this post on Zulip Anton (Sep 13 2022 at 12:36):

alright, I'll give it a try

view this post on Zulip Anton (Sep 13 2022 at 12:48):

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

view this post on Zulip Brendan Hansknecht (Sep 13 2022 at 14:19):

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

view this post on Zulip Brian Hicks (Sep 13 2022 at 14:20):

I think I'll just dig out my x86 mac and try it locally. Gonna have some serious dust to blow off though. :laughing:

view this post on Zulip Brian Hicks (Sep 13 2022 at 17:40):

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?

view this post on Zulip Brian Hicks (Sep 13 2022 at 17:53):

also if anyone knows what exit status 9 would mean, that'd answer some questions!

view this post on Zulip Brian Hicks (Sep 13 2022 at 17:53):

(specifically the question: what does exit status 9 mean?)

view this post on Zulip Anton (Sep 13 2022 at 18:06):

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.

view this post on Zulip Anton (Sep 13 2022 at 18:08):

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.

view this post on Zulip Anton (Sep 13 2022 at 18:09):

Example on how to upload the executable: https://github.com/roc-lang/roc/blob/4644ce40e3f492af2df6515ab7ae290f8221a243/.github/workflows/nix_linux_x86_64.yml

view this post on Zulip Anton (Sep 13 2022 at 18:10):

I'd also inspect memory usage when just running the test on your own machine

view this post on Zulip Brian Hicks (Sep 13 2022 at 19:19):

OK, here's something curious: it works if I build a binary and then run the binary instead of just doing roc run :thinking:

view this post on Zulip Anton (Sep 14 2022 at 07:18):

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