Stream: bugs

Topic: roc check crash in simple multi-file project


view this post on Zulip drew (Jun 24 2025 at 20:23):

hey folks, just checking in on the state of projects with multiple files. It seems roc check still crashes on a simple multi-file projects, which means the LSP also doesn't work (see: https://gist.github.com/drewolson/358b196935083982d982339e672c7474). are others struggling with these same problems?

view this post on Zulip Brendan Hansknecht (Jun 24 2025 at 22:41):

Intriguing. I definitely have seen it work with multiple files

view this post on Zulip Brendan Hansknecht (Jun 24 2025 at 22:42):

So would require more debugging to know why that doesn't work

view this post on Zulip Brendan Hansknecht (Jun 24 2025 at 22:42):

Must be something more specific than just multifile

view this post on Zulip drew (Jun 25 2025 at 00:24):

hmm, interesting. this is the simplest multi file project i could come up with

view this post on Zulip drew (Jun 25 2025 at 00:29):

as it is literally just two files, one main and one with an add function.

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:39):

i wonder if removing the type annotation on add or changing it from using Int _ to using Int * (or Int a) would help

view this post on Zulip drew (Jun 25 2025 at 00:39):

fails with all of these as well

view this post on Zulip drew (Jun 25 2025 at 00:40):

Int * doesn't actually compile :slight_smile:

view this post on Zulip drew (Jun 25 2025 at 00:40):

but no type annotation has the same error

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:41):

wait it's just with Check

view this post on Zulip drew (Jun 25 2025 at 00:41):

yes

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:41):

and not when you build?

view this post on Zulip drew (Jun 25 2025 at 00:41):

yes

view this post on Zulip drew (Jun 25 2025 at 00:41):

which means the LSP also doesn't work

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:41):

that's extra strange since check is a subset of the build pipeline

view this post on Zulip drew (Jun 25 2025 at 00:42):

agreed. i think this same bug has been here for at least a year, but i don't know why i'm the only one experiencing it

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:42):

what's the version you have?

view this post on Zulip drew (Jun 25 2025 at 00:42):

i just pulled the rolling nightly

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:42):

and what platform etc?

view this post on Zulip drew (Jun 25 2025 at 00:42):

$ roc --version roc nightly pre-release, built from commit c47a8e9cdac on Sat Mar 22 09:14:20 UTC 2025

view this post on Zulip drew (Jun 25 2025 at 00:42):

i followed the install directions

view this post on Zulip drew (Jun 25 2025 at 00:42):

see the gist above

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:43):

i have never experienced this and i did all of AOC last winter in Roc

view this post on Zulip drew (Jun 25 2025 at 00:43):

latest CLI platform

view this post on Zulip drew (Jun 25 2025 at 00:43):

Anthony Bullard said:

i have never experienced this and i did all of AOC last winter in Roc

interesting, that's good to hear

view this post on Zulip drew (Jun 25 2025 at 00:44):

can you reproduce this with the gist i shared?

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:44):

oh you are checking a single file that's a module

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:44):

hmmm

view this post on Zulip drew (Jun 25 2025 at 00:44):

yep

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:44):

i'm trying to think if i ever would have done that

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:45):

semantic analysis requires an entire project. whether that's a package, a platform, or an app

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:45):

i fixed a similar bug with apps that had a package dependency

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:46):

i've been so deep in the compiler rewrite i've unfortunately not had the chance to write much of any Roc in the past 3-4 months

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:46):

ironic, I know

view this post on Zulip drew (Jun 25 2025 at 00:46):

np, i figured that is often the case!

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:53):

can you try adding --main main.roc to your check command before Foo.roc?

view this post on Zulip Anthony Bullard (Jun 25 2025 at 00:55):

so, roc check --main main.roc Foo.roc

view this post on Zulip drew (Jun 25 2025 at 00:58):

same error

view this post on Zulip Anthony Bullard (Jun 25 2025 at 01:20):

ok it looks like we have an issue here where the derived module is still locked because main is referencing it

view this post on Zulip Anthony Bullard (Jun 25 2025 at 01:22):

Maybe @Anton can take a look into this when he comes on next. the load system is rather complicated to debug and i'm on my phone

view this post on Zulip Anthony Bullard (Jun 25 2025 at 01:34):

i think we need main to not be queued for processing

view this post on Zulip Anthony Bullard (Jun 25 2025 at 01:35):

if we don't reference a package or platform

view this post on Zulip Anton (Jun 25 2025 at 08:35):

Sorry that this important issue did not get solved for so long @drew!
I may be close to solving #compiler development > slow build with lots of `?` and will take a look after that.

view this post on Zulip Anton (Jun 25 2025 at 11:50):

and will take a look after that.

I could not resist, fix coming in :airplane_arrival:
Gemini 2.5 pro was able to fix the bug given some debug logs, I'm pretty impressed, this requires real understanding.

view this post on Zulip Anthony Bullard (Jun 25 2025 at 11:54):

would love to see that PR!

view this post on Zulip Anthony Bullard (Jun 25 2025 at 11:54):

mainly to see if my high level diagnosis was correct

view this post on Zulip Anton (Jun 25 2025 at 12:01):

#7870

view this post on Zulip Anton (Jun 25 2025 at 12:04):

@drew tomorrow's nightly will contain fixed binaries for roc and roc_language_server

view this post on Zulip Anton (Jun 25 2025 at 12:05):

Gemini 2.5 pro was able to fix the bug given some debug logs, I'm pretty impressed, this requires real understanding.

The file with the bug(file.rs) is nearly 7000 lines too :p

view this post on Zulip Anthony Bullard (Jun 25 2025 at 12:23):

Approved @Anton but there is a check failure

view this post on Zulip drew (Jun 25 2025 at 12:26):

Anton said:

and will take a look after that.

I could not resist, fix coming in :airplane_arrival:
Gemini 2.5 pro was able to fix the bug given some debug logs, I'm pretty impressed, this requires real understanding.

how did you interface with gemini to fix the bug? aider? something else?

view this post on Zulip Anton (Jun 25 2025 at 13:36):

Raw :p through aistudio.google.com share link

view this post on Zulip Anton (Jun 25 2025 at 13:36):

I like to have full control over the messages, no prompt pollution from middle men

view this post on Zulip drew (Jun 25 2025 at 14:02):

timely — https://blog.google/technology/developers/introducing-gemini-cli-open-source-ai-agent/

view this post on Zulip Anthony Bullard (Jun 25 2025 at 14:13):

drew said:

timely — https://blog.google/technology/developers/introducing-gemini-cli-open-source-ai-agent/

This quote from the blog sent me:

That free license gets you access to Gemini 2.5 Pro and its massive 1 million token context window. To ensure you rarely, if ever, hit a limit during this preview, we offer the industry’s largest allowance: 60 model requests per minute and 1,000 requests per day at no charge.

view this post on Zulip Anthony Bullard (Jun 25 2025 at 14:13):

60 requests per MINUTE on 2.5 pro free-of-charge???

view this post on Zulip drew (Jun 25 2025 at 14:14):

indeed

view this post on Zulip Anthony Bullard (Jun 25 2025 at 14:14):

Google may have just looped me back in, and that is something I would probably put on my machine (after some inspection of the source, of course)

view this post on Zulip Anthony Bullard (Jun 25 2025 at 14:16):

Now I just gotta get code assist working in Neovim

view this post on Zulip drew (Jun 25 2025 at 14:17):

i think the point of the cli is it is editor independent like claude code

view this post on Zulip Anthony Bullard (Jun 25 2025 at 14:18):

Yeah, but i'll have to check the tools it has to see if I can have it access the open files and projects in my editors

view this post on Zulip Anton (Jun 25 2025 at 18:04):

Anthony Bullard said:

Approved Anton but there is a check failure

@drew it's possible that the change causes issues on some machines, so it's not going to be in tomorrow's nightly yet. I need to investigate some more.

view this post on Zulip Anton (Jun 27 2025 at 11:31):

Problem resolved, fix will be in tomorrow's nightly

view this post on Zulip drew (Jun 27 2025 at 18:08):

do i get access to this buy downloading the alpha3-rolling binary from github?

view this post on Zulip drew (Jun 27 2025 at 18:08):

(tomorrow, that is :slight_smile:)

view this post on Zulip Anton (Jun 28 2025 at 09:22):

No, there have been breaking changes since alpha3, you can get the nightly here in less than an hour probably https://github.com/roc-lang/roc/releases/tag/nightly

view this post on Zulip Anton (Jun 28 2025 at 10:26):

Fresh nightlies are up :)

view this post on Zulip drew (Jun 28 2025 at 13:49):

drew:~/code/hello-roc (main)$ roc main.roc 3 Hello, World! drew:~/code/hello-roc (main)$ roc check Foo.roc 0 errors and 0 warnings found in 20 ms.

view this post on Zulip drew (Jun 28 2025 at 13:49):

it's working!

view this post on Zulip drew (Jun 28 2025 at 13:49):

thanks

view this post on Zulip drew (Jun 28 2025 at 13:50):

confirmed the language server also now works


Last updated: Jul 06 2025 at 12:14 UTC