Following the tutorial on WSL Ubuntu 20.04.
Nightly ZIP build extracted: roc_nightly-linux_x86_64-20220420-07fcaf.tar.gz
Installation steps succeeded, but on running helloWorld on any of the three runtimes I get errors:
viktor@SIRIUS:~$ cd bin
viktor@SIRIUS:~/bin$ ll
total 109296
drwxr-xr-x 1 viktor viktor 4096 Apr 21 00:37 ./
drwxr-xr-x 1 viktor viktor 4096 Apr 21 00:40 ../
-rw-r--r-- 1 viktor viktor 0 Apr 20 23:22 .motd_shown
drwxr-xr-x 1 viktor viktor 4096 Apr 20 23:23 compiler/
drwxr-xr-x 1 viktor viktor 4096 Apr 20 23:23 examples/
-rwxr-xr-x 1 viktor viktor 70666608 Apr 20 11:34 roc*
drwxr-xr-x 1 viktor viktor 4096 Sep 7 2021 zig-linux-x86_64-0.8.1/
-rw-r--r-- 1 viktor viktor 41250060 Sep 7 2021 zig-linux-x86_64-0.8.1.tar.xz
viktor@SIRIUS:~/bin$ ./roc examples/hello-world/rust-platform/helloRust.roc
thread '<unnamed>' panicked at 'Failed to rebuild src/main.rs - stderr of the `cargo build` command was:
error: failed to load manifest for dependency `roc_std`
Caused by:
failed to read `/home/viktor/bin/roc_std/Cargo.toml`
Caused by:
No such file or directory (os error 2)
', compiler/build/src/link.rs:1114:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any { .. }', cli/src/build.rs:236:50
🔨 Rebuilding host... viktor@SIRIUS:~/bin$
viktor@SIRIUS:~/bin$
viktor@SIRIUS:~/bin$ ./roc examples/hello-world/zig-platform/helloZig.roc
thread '<unnamed>' panicked at 'Failed to rebuild host.zig - stderr of the `zig` command was:
ld.lld: error: cannot open /earthbuild/target/release/build/roc_builtins-415514521724d807/out/builtins-host.o: No such file or directory
error: LLDReportedFailure
', compiler/build/src/link.rs:1114:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any { .. }', cli/src/build.rs:236:50
🔨 Rebuilding host... viktor@SIRIUS:~/bin$
viktor@SIRIUS:~/bin$
viktor@SIRIUS:~/bin$ ./roc examples/hello-world/c-platform/helloC.roc
thread '<unnamed>' panicked at 'Failed to rebuild host.c - stderr of the `clang` command was:
clang: error: no such file or directory: '/earthbuild/target/release/build/roc_builtins-415514521724d807/out/builtins-host.o'
', compiler/build/src/link.rs:1114:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any { .. }', cli/src/build.rs:236:50
🔨 Rebuilding host... viktor@SIRIUS:~/bin$
viktor@SIRIUS:~/bin$
Any ideas what I missed? Looks like it is trying to access some path from the build host, which it should not, I guess...
FWIW I'm running on WSL, but I run using the nix shell.
Hi @Viktor Ferenczi, thanks for bringing this to our attention. I've created an issue to add tests for this. I was able to reproduce the errors for the zig and c platform but not for the rust platform. Can you share the output of ls /home/viktor/bin/roc_std
?
@Folkert de Vries did something change recently with how we use builtins-host.o
?
nothing comes to mind. I may be missing some context here
This appears to have been caused by using the surgical linker by default, PR #2859.
if that's the problem, you can opt out of it with --linker=legacy
does using that flag fix the problem?
@Anton
viktor@SIRIUS:~$ ls -la /home/viktor/bin/roc_std
ls: cannot access '/home/viktor/bin/roc_std': No such file or directory
(It took me some time to find your moved message in Zulip. The link in the chat notification email does not follow the message if it is moved. Don't move messages. Copy them and replace the original with a trampoline. Otherwise people get confused. This chat client is strange, to say the least...)
@Viktor Ferenczi apologies, I'll remember that for next time.
The roc_std folder should be in the tar.gz, can you double-check that?
@Richard Feldman yes, the --linker=legacy
flag fixes the problem, thanks :)
@Viktor Ferenczi once you copy over roc_std
to your bin folder, the following commands should work:
./roc examples/hello-world/rust-platform/helloRust.roc
./roc examples/hello-world/zig-platform/helloZig.roc --linker=legacy
./roc examples/hello-world/helloWorld.roc --linker=legacy
./roc examples/hello-world/c-platform/helloC.roc --linker=legacy
I've set up a PR that mentions this workaround in the getting_started docs.
@Anton when you get a chance, can you open an issue about the symptom the --linker=legacy
flag fixes? Eventually the goal is to remove that option, so this is a bug we'll need to fix! :big_smile:
oh wait is it https://github.com/rtfeldman/roc/issues/2913 ?
Anton said:
Viktor Ferenczi once you copy over
roc_std
to your bin folder, the following commands should work: ...
Yes, the roc_std
folder was in the nightly tar.gz
. Indeed, after copying that folder they started to work with the --linker=legacy
parameter.
Slowly getting there, actually running some Roc after a few days. :)
Maybe I need to use Linux is some other way than WSL. How do you run Linux?
I have a dual boot setup with one hard drive for Kubuntu 20.04 and a different hard drive for windows 10.
@Richard Feldman yes, that's the issue
Last updated: Jul 06 2025 at 12:14 UTC