Stream: beginners

Topic: ✔ running compiler tests and getting failures


view this post on Zulip Becker A. (Nov 26 2023 at 07:03):

I'm trying to set myself up for development on the roc-lang/roc repo. I've done the following:

*edit - "the docs" -> https://github.com/roc-lang/roc/blob/69b72866dbd7686ddd3b091516c683304328f292/CONTRIBUTING.md#running-tests *

the cargo test command then generates test failures. more specifically:

$ cargo test -p roc_repl_expect --lib

running 26 tests
test test::big_recursive_tag_copied_back ... ok
test test::box_with_strings ... ok
test test::arg_parser ... ok
test test::equals_fail ... ok
test test::compare_long_strings ... ok
test test::extra_offset_in_tag_union ... ok
test test::adjacent_lists ... ok
test test::equals_pass ... ok
thread 'test::lookup_clone_result' panicked at 'misaligned pointer dereference: address must be a multiple of 0x8 but is 0x16f7add94', crates/repl_expect/src/app.rs:57:45
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

tests should work on main, right? am I doing something wrong?

view this post on Zulip Luke Boswell (Nov 26 2023 at 07:11):

I'm not sure all tests should be working on main... maybe there is something special about that package? There are a lot of random packages, and may that is specific to WASM or dev backend or REPL or something special

Do tests work for you if you run cargo run --release?

view this post on Zulip Becker A. (Nov 26 2023 at 07:21):

I tried cargo run --release and it looks like it's spitting out the same text I would get if I ran roc on it's own, i.e.:

$ cargo run --release
The current directory (/Users/___/Repos/roc) does not contain a main.roc file to use as a default.

You can run `roc help` for more information on how to provide a .roc file.

so it looks like the compilation is working! but this isn't the same as running tests, right? this just runs the main program compiled from source?

view this post on Zulip Becker A. (Nov 26 2023 at 07:28):

I ask just because, from my interpretation of CONTRIBUTING.md, I should be running tests to confirm any changes I make to the source code. am I understanding that right?

view this post on Zulip Luke Boswell (Nov 26 2023 at 07:33):

Yeah sorry I meant cargo test --release

view this post on Zulip Becker A. (Nov 26 2023 at 07:37):

ahh gotcha, my bad I should've realized that's what you meant :sweat_smile: running now...

view this post on Zulip Becker A. (Nov 26 2023 at 07:43):

all tests pass! thanks :+1:

-> should the docs be changed to note that tests should be run with --release?

view this post on Zulip Brian Carroll (Nov 26 2023 at 11:07):

No, this should be a temporary situation so we shouldn't update the docs for it.
We should get the test working or ignore it.

view this post on Zulip Becker A. (Nov 26 2023 at 19:55):

Gotcha. Should I put in a bug for it then?

view this post on Zulip Becker A. (Nov 26 2023 at 20:37):

Went ahead a made a bug for this, feel free to close if that's not appropriate
https://github.com/roc-lang/roc/issues/6100

view this post on Zulip Brian Carroll (Nov 26 2023 at 21:02):

That's great, thanks!

view this post on Zulip Notification Bot (Nov 27 2023 at 02:05):

Becker A. has marked this topic as resolved.


Last updated: Jul 06 2025 at 12:14 UTC