I tried splitting my advent of code code into a module, to try and make one program that runs all of my solutions.
I made an interface of todays solve and called that from a main.roc in the same folder, and that worked fine.
Then I made a main.roc in the parent folder, and try to import that same interface (making sure to rename it according to its' path)- but now when I call roc dev
in my repo root, roc just hangs.
I tried letting it run for several minutes but ehhh.. I'm pretty convinced it's not getting anywhere. It's less than 200 lines of code.
Repo to reproduce (on the modularize
branch):
https://gitlab.com/AsbjornOlling/aoc2023/-/tree/modularize
It hangs when I run roc dev
in the repo root using the roc
from the nix flake shell (should be latest main
).
If I comment out D04.Solution
from the imports in :/main.roc
, it runs fine.
Feels like a bug in resolving imports? Let me know if I should just open a github issue.
does roc build
hang as well?
yup. roc build
as well
they all hang while consuming 100% of one core
...and actually the roc_ls
language server that emacs is running hangs as well, using 100% of one core
roc test D04/Solution.roc
hangs as well. so probably something funky in the interface file
cool. Sounds like a proper bug. I wonder what kind of silly thing we are doing/looping on the imports
Can you file an issue. If possible a minimal repro is always amazing, but filing everything is also great.
I'll file an issue :sparkles:
I started ripping away code, and got down to this minimal repro:
in a folder with only this file, running roc test Solution.roc
interface Solution
exposes [a]
imports [
parser.Core
]
a = 2
I filed #6185
Try roc check
. I have seen that work when the other commands hang.
roc check
also hangs
FWIW, I tried going back in the roc repo history to see how far back I can reproduce this bug, and the bug seems to be older than one year, and probably also older than the first commit where nix build
works in the repo flake :sweat_smile:
I wanted to try and see if I could fix it myself (I probably can't, but I'll give it a shot!), by finding a commit where it works, and doing a git bisect
dance from there. But I got stuck trying to build old versions of roc.
It probably is just a parser assumption that is wrong from when the parse was first written
...actually, it hangs, so probably an issue in file.rs
and the loading logic.
Probably the best way to figure out what is going on:
gdb
or lldb
bt
to get a backtraceLast updated: Jul 06 2025 at 12:14 UTC