Just poking at the issue Anton referenced in basic-cli with the debug build of the compiler.
I'm wondering how do we make progress debugging this kind of issue? these things in Mono seems a bit like black magic to me sometimes.
$ ../roc/target/debug/roc glue glue.roc crates ./platform/main.roc
thread 'main' panicked at crates/glue/src/types.rs:2225:5:
assertion `left == right` failed: glue_procs_by_layout for Layout { repr: Direct(Struct([InLayout(33), InLayout(37)])), semantic: None } was None, but the layout cache said its has_varying_stack_size was true
left: false
right: true
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Thanks for helping out with that Luke :)
I remember @Richard Feldman wrote that assert, so he may be able to provide the best guidance
it's been a couple years, but I think the idea here was that at this point we expect an earlier stage in the process to have added an entry in glue_procs_by_layout
for this layout, but it wasn't there
poking around a bit, it looks like this is specifically for the getter/setter stuff that Folkert and I were doing to try to fix passing closures to/from the host
the current approach that we've been working on instead is to:
Box
) if you want to send them across the host boundaryTask
, which we can special-case because it's a builtin nowthat eliminates the need for the whole getter/setter thing, which had lots of problems
Is there any chance that failing this assertion can lead to a segmentation fault down the line?
I think in this particular case it's more like you might get a crash
in RustGlue.roc
because you're trying to look something up but it's not there
just linking to this issue
Last updated: Jul 06 2025 at 12:14 UTC