FYI I tried it today pretty much with the code you've provided and some simple returns in part1 and part2 and it crashed with
thread '<unnamed>' panicked at crates/compiler/mono/src/ir.rs:6162:56:
called `Option::unwrap()` on a `None` value
stack backtrace:
0: 0x619d6db6a8ab - <unknown>
1: 0x619d6ce2c1e0 - <unknown>
2: 0x619d6db66113 - <unknown>
3: 0x619d6db6a644 - <unknown>
4: 0x619d6db6c1a0 - <unknown>
5: 0x619d6db6bebf - <unknown>
6: 0x619d6db6c6be - <unknown>
7: 0x619d6db6c589 - <unknown>
8: 0x619d6db6ada6 - <unknown>
9: 0x619d6db6c324 - <unknown>
10: 0x619d6cd21e75 - <unknown>
11: 0x619d6cd21f33 - <unknown>
12: 0x619d6cd21dc6 - <unknown>
13: 0x619d6d699d75 - <unknown>
14: 0x619d6d68ce14 - <unknown>
15: 0x619d6d67b442 - <unknown>
16: 0x619d6d6a8339 - <unknown>
17: 0x619d6d68a44e - <unknown>
18: 0x619d6d6b8330 - <unknown>
19: 0x619d6d68f6cf - <unknown>
20: 0x619d6d6b5ac2 - <unknown>
21: 0x619d6d6b6306 - <unknown>
22: 0x619d6d6b94f7 - <unknown>
23: 0x619d6d6b8661 - <unknown>
24: 0x619d6d68f6cf - <unknown>
25: 0x619d6d6a85de - <unknown>
26: 0x619d6d68a44e - <unknown>
27: 0x619d6d6832fa - <unknown>
28: 0x619d6d6809b7 - <unknown>
29: 0x619d6d585444 - <unknown>
30: 0x619d6d50e2c6 - <unknown>
31: 0x619d6d503c0e - <unknown>
32: 0x619d6d50f535 - <unknown>
33: 0x619d6db71f05 - <unknown>
34: 0x782ff1ea339d - <unknown>
35: 0x782ff1f2849c - <unknown>
36: 0x0 - <unknown>
When not calling AoC.solve
it works just fine
Can you share the code you used? I'd like to repro if I can
It'd be nice to give a better error message than a rust panic
Running the exact code you've sent results in
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: <https://github.com/roc-lang/roc/issues/new/choose>
Undefined Symbol in relocation, (+e2a2, Relocation { kind: PltRelative, encoding: Generic, size: +20, target: Symbol(SymbolIndex(+e5)), addend: +fffffffffffffffc, implicit_addend: false }): Ok(Symbol { name: "roc_fx_stdinReadToEnd", address: +0, size: +0, kind: Unknown, section: Undefined, scope: Unknown, weak: false, flags: Elf { st_info: +10, st_other: +0 } })
Location: crates/linker/src/elf.rs:1452:25
Changing the bottom lines to
part1 : Str -> Result Str _
part1 = \_ -> Ok "Foo"
part2 : Str -> Result Str _
part2 = \_ -> Ok "Bar"
Results in the error provided above.
I didn't share code because it's pretty much exactly the code you've sent :sweat_smile:
Ok, this looks like an issue with the new roc_fx_stdinReadToEnd
I just added.
I think I know what it is...
I didn't add roc_fx_stdinReadToEnd
to our pub fn init() {
thing which protects the vicious rust GC from removing what it thinks is dead code. That must only be relevant for Linux, and doesn't materialise as an issue on Macos. I didn't add an integration test for it, so we didn't pick it up in CI :man_facepalming:.
Would you be interested in trying a fix for me? if you add roc_fx_stdinReadToEnd
and then build basic-cli locally, does it still give you this error?
:salute: :sweat_smile: always happy to dig up bugs :laughter_tears:
You can build basic-cli using roc build.roc
... but then you will need to use a relative path to platform/main.roc
instead of a URL for the platform.
10 messages were moved here from #advent of code > 2024 AoC Template by Luke Boswell.
I'll try in a bit or tomorrow
I plan to do a new basic-cli release this week, so I've gone ahead and put up a fix in https://github.com/roc-lang/basic-cli/pull/268,
Last updated: Jul 06 2025 at 12:14 UTC