Stream: contributing

Topic: ✔ i2875


view this post on Zulip Jared Cone (Apr 16 2022 at 04:23):

https://github.com/rtfeldman/roc/issues/2875 Include the file name/path in compiler warnings/errors

I have a PR almost ready. I was going to have it show the full path to the file, such as /home/cone/roc/interactive/echo.roc, however since the path is unique per-machine it doesn't jive well with unit tests. So for now I'm just showing the file name, no path. I'm open to suggestions on how to mitigate:

view this post on Zulip Ayaz Hafiz (Apr 16 2022 at 04:46):

Somehow remove the working directory from the path, so it would show the relative path instead such as roc/interactive/echo.roc

In my mind this would be the best thing to do, since if you're invoking from a command line you're working relative to a directory anyway. Once there is a better notion of an application/package root we could use that as the relative base, but I think relative to pwd is a good idea

view this post on Zulip Brendan Hansknecht (Apr 16 2022 at 05:26):

We have the app folder and use it to find the platform. That would probably be the best if it is available there

view this post on Zulip Jared Cone (Apr 19 2022 at 04:23):

I have most of the tests passing but not sure what to do about some of the tests such as test_load::parse_problem. It's writing the source files to a random platform-dependent temp dir:
── OPAQUE TYPE DECLARED OUTSIDE SCOPE ─────────────────── /tmp/.tmpWQAZ9p/Main ─
Would it be fine to change these tests to write the source files to a deterministic relative dir? If so, any recommendations?

view this post on Zulip Brian Carroll (Apr 19 2022 at 11:44):

If you browse through some of the the .gitignore files in the project you'll find some of them are in test directories, ignoring output similar to this. So that might give you an idea of what others have done before.
But I'd say it's OK to just pick whatever name makes sense to you!

view this post on Zulip Jared Cone (Apr 19 2022 at 15:13):

Perfect thanks!

view this post on Zulip Jared Cone (Apr 21 2022 at 05:08):

PR at https://github.com/rtfeldman/roc/pull/2906

All tests are passing locally, however after updating to latest and running cargo test, git status shows these files as untracked

cli/tests/fixtures/multi-dep-str/platform/dynhost
cli/tests/fixtures/multi-dep-str/platform/libapp.so
cli/tests/fixtures/multi-dep-str/platform/metadata
cli/tests/fixtures/multi-dep-str/platform/preprocessedhost
cli/tests/fixtures/multi-dep-thunk/platform/dynhost
cli/tests/fixtures/multi-dep-thunk/platform/libapp.so
cli/tests/fixtures/multi-dep-thunk/platform/metadata
cli/tests/fixtures/multi-dep-thunk/platform/preprocessedhost

Also a test is failing for me on trunk:

---- gen_num::upcast_of_int_checked_is_zext stdout ----
thread 'gen_num::upcast_of_int_checked_is_zext' panicked at 'assertion failed: `(left == right)`
  left: `257`,
 right: `1`: LLVM test failed', compiler/test_gen/src/gen_num.rs:3144:5

but it isn't failing for me on this branch, even tho the branch has been rebased to trunk head. Not sure what that's about...

view this post on Zulip Jared Cone (Apr 21 2022 at 05:45):

github CI found some more tests I need to update

view this post on Zulip Brendan Hansknecht (Apr 21 2022 at 16:40):

Gitignore those untracked files

view this post on Zulip Brendan Hansknecht (Apr 21 2022 at 16:41):

They are from surgical linking. Probably can be ignored across the entire repo instead of just the examples folder like it is currently

view this post on Zulip Brendan Hansknecht (Apr 21 2022 at 16:41):

Eventually they need to move into the roc cache dir that doesn't exist yet

view this post on Zulip Brendan Hansknecht (Apr 21 2022 at 16:43):

For the test failing on trunk but not your branch, did you accidentally merge in a way to remove or disable the test?

view this post on Zulip Jared Cone (Apr 21 2022 at 23:57):

Nah I don't think the test was disabled, but it may have been an intermittent failure. I tried syncing latest trunk again, but cargo test is failing for me:

[nix-shell:~/roc]$ cargo test
   Compiling roc_can v0.1.0 (/home/cone/roc/compiler/can)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:18:85
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.58.0 (02072b482 2022-01-11) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `roc_can`
warning: build failed, waiting for other jobs to finish...
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:18:85
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.58.0 (02072b482 2022-01-11) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: build failed

I'm actually still able to compile roc and run the echo example, just seems to be an issue with cargo test

view this post on Zulip Jared Cone (Apr 22 2022 at 04:44):

I tried a clean sync with git fetch --prune origin && git reset --hard origin/trunk && git clean -f -d, tried removing and reinstalling nix, but still getting that error with cargo test

view this post on Zulip Jared Cone (Apr 24 2022 at 05:03):

I was able to resolve this with cargo clean. Still getting some other errors when doing cargo test but no more panics from the rust compiler

view this post on Zulip Notification Bot (Apr 24 2022 at 05:04):

Jared Cone has marked this topic as resolved.


Last updated: Jul 06 2025 at 12:14 UTC