roc icon indicating copy to clipboard operation
roc copied to clipboard

`roc check IDCounter.roc` also checks main.roc

Open planmac opened this issue 1 year ago • 8 comments

Got this error when running: roc check IDCounter.roc on the Full Code found at the end of this pg: https://www.roc-lang.org/examples/RecordBuilder/README.html

The full error message: 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> Outstanding references to the derived module Location: crates/compiler/load_internal/src/file.rs:3298:29

Platform: Apple silicon

planmac avatar Sep 12 '24 22:09 planmac

Thanks for reporting this @planmac!

I was not able to reproduce this error on ubuntu, can you share the output of roc version?

Anton-4 avatar Sep 15 '24 07:09 Anton-4

roc nightly pre-release, built from commit 9a4d556725 on Sat Sep 7 09:14:19 UTC 2024

planmac avatar Sep 15 '24 22:09 planmac

I'm still not able to reproduce it on ubuntu with that exact version. In 10 days I will have access to my mac again, and I'll give it a try then.

Anton-4 avatar Sep 16 '24 14:09 Anton-4

Can't reproduce on Apple M1

JRI98 avatar Sep 16 '24 14:09 JRI98

Thanks @JRI98 :)

@planmac let's make super sure nothing weird happened, can you do:

wget https://raw.githubusercontent.com/roc-lang/examples/main/examples/RecordBuilder/IDCounter.roc
roc check IDCounter.roc
roc version

Anton-4 avatar Sep 16 '24 16:09 Anton-4

OK, I replicated the error - if there is a main.roc file in the same dir as the file being checked then roc check <anything> attempts to compile/invoke that main.roc file, leading to the compiler error. I tested this in a clean dir:

mkdir Roc
cd Roc
cp ../IDCounter.roc ./
touch main.roc
roc check IDCounter.roc

.. throws a -- MISSING HEADER in main.roc -- error Not sure if this is a feature or a bug ??

planmac avatar Sep 18 '24 14:09 planmac

Thanks for investigating this further @planmac, I've started a discussion on zulip.

Anton-4 avatar Sep 21 '24 16:09 Anton-4

Looks like the original error also happens when I put a valid hello world in main.roc:

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>
Outstanding references to the derived module
Location: crates/compiler/load_internal/src/file.rs:3298:29

This should definitely not happen.

Anton-4 avatar Sep 22 '24 08:09 Anton-4

I think this is a dup of an issue I closed earlier this week, let me pull it up.

https://github.com/roc-lang/roc/issues/7175

Check with latest (main/master) but this should be fixed. I'll close for now, but feel free to reopen if you still see it.

gamebox avatar Dec 05 '24 01:12 gamebox