I'm trying to setup Roc for the first time following the tutorial, and it is panicking when doing the "Hello, World!" expression? Also complains about libtinfo being missing:
> roc repl
roc: /lib64/libtinfo.so.6: no version information available (required by roc)
The rockin’ roc repl
────────────────────────
Enter an expression, or :help, or :q to quit.
» "Hello, World!"
ld: /usr/lib/libgcc_s.so.1: error adding symbols: file in wrong format
thread 'main' panicked at 'we produce a valid Dylib: DlOpen { desc: "/tmp/.tmpGzVlYV/app.so.1.0: cannot open shared object file: No such file or directory" }', crates/repl_cli/src/cli_gen.rs:73:65
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Hi Braydon, can you tell me what OS you are using?
Yup, I am using Fedora 35
We've seen this issue before on some fedora systems (#4011). I was unable to reproduce that on my fedora VM but I'll give it another try.
I just checked the gcc version I have, and it is reporting:
╰─λ gcc --version
gcc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Thanks, I don't think gcc is the problem though. The issue did not reproduce for me on fedora 36 WS, I'm going to set up fedora 35 and I'll try to make a minimal executable that should still error on your machine. That will make it easier to figure out what exactly is going wrong.
@Braydon Hall can you share the output of the neofetch
command?
I've done some further digging and I think the real problem is hidden because we do not check the exit status of a command used for linking. I've built a new release here that should output more information. @Braydon Hall could you try doing roc repl
and input "Hello, world!" again with this release?
Here's the result of neofetch:
╰─λ neofetch
.',;::::;,'. zorua@CORONET
.';:cccccccccccc:;,. -------------
.;cccccccccccccccccccccc;. OS: Fedora release 35 (Thirty Five) x86_64
.:cccccccccccccccccccccccccc:. Kernel: 5.18.13-100.fc35.x86_64
.;ccccccccccccc;.:dddl:.;ccccccc;. Uptime: 5 days, 23 hours, 29 mins
.:ccccccccccccc;OWMKOOXMWd;ccccccc:. Packages: 2215 (rpm), 18 (flatpak)
.:ccccccccccccc;KMMc;cc;xMMc:ccccccc:. Shell: zsh 5.8.1
,cccccccccccccc;MMM.;cc;;WW::cccccccc, Resolution: 1920x1080, 2560x1440, 3440x1440
:cccccccccccccc;MMM.;cccccccccccccccc: WM: bspwm
:ccccccc;oxOOOo;MMM0OOk.;cccccccccccc: Theme: Adwaita [GTK2], Nordic [GTK3]
cccccc:0MMKxdd:;MMMkddc.;cccccccccccc; Icons: Adwaita [GTK2]
ccccc:XM0';cccc;MMM.;cccccccccccccccc' Terminal: kitty
ccccc;MMo;ccccc;MMW.;ccccccccccccccc; CPU: AMD Ryzen 9 5900X (24) @ 3.700GHz
ccccc;0MNc.ccc.xMMd:ccccccccccccccc; GPU: NVIDIA GeForce RTX 3070 Ti
cccccc;dNMWXXXWM0::cccccccccccccc:, Memory: 19638MiB / 31914MiB
cccccccc;.:odl:.;cccccccccccccc:,.
:cccccccccccccccccccccccccccc:'.
.:cccccccccccccccccccccc:;,..
'::cccccccccccccc::;,.
And the result of that new build is:
╰─λ roc repl
roc: /lib64/libtinfo.so.6: no version information available (required by roc)
The rockin’ roc repl
────────────────────────
Enter an expression, or :help, or :q to quit.
» "Hello, World!"
ld: /usr/lib/libgcc_s.so.1: error adding symbols: file in wrong format
thread 'main' panicked at '
___________
Linking command failed with status ExitStatus(unix_wait_status(256)):
Child { stdin: None, stdout: None, stderr: None, .. }
___________
', crates/compiler/build/src/link.rs:1496:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
:thinking: if you clone the roc source code repository and run roc dev examples/helloWorld.roc
does that work?
I'm curious if this is repl-specific
There was a bit more output the first time I ran it, but closed my terminal before grabbing the output :upside_down:
╰─λ roc dev examples/helloWorld.roc
roc: /lib64/libtinfo.so.6: no version information available (required by roc)
🔨 Rebuilding platform...
Hello, World!
Runs fine! Seems to be a repl problem, based just on this then
ok one other thing to try to narrow it down:
roc dev --linker=legacy examples/helloWorld.roc
Well, then.
╰─λ roc dev --linker=legacy examples/helloWorld.roc
roc: /lib64/libtinfo.so.6: no version information available (required by roc)
🔨 Rebuilding platform...
thread '<unnamed>' panicked at 'I could not find the clang command.
Please install clang.', crates/utils/src/lib.rs:206:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'Failed to (re)build platform.: Any { .. }', crates/cli/src/build.rs:342:46
I guess I need clang?
Could have sworn I already had it... Ugh
you might just have to ln -s clang-{version} clang
Nope, installing clang did not help:
╰─λ roc dev --linker=legacy examples/helloWorld.roc
roc: /lib64/libtinfo.so.6: no version information available (required by roc)
🔨 Rebuilding platform...
ld: /usr/lib/libgcc_s.so.1: error adding symbols: file in wrong format
thread 'main' panicked at 'not yet implemented: gracefully handle `ld` (or `zig` in the case of wasm with --optimize) returning exit code Some(1)', crates/cli/src/build.rs:417:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
or alias clang to zig cc
? this has been my magic fix for C compilers/linkers not cooperating lately
we'll soon have zig in production (building things for raspberri pi on CI) at work
also generally to play around with this stuff you can set the CC=path/to/c/compiler
and see if that fixes it
yeah so it seems to me that:
so once the surgical linker supports making dynamic libraries on Linux, we can switch the repl over to use that and I think that should fix it!
@Brendan Hansknecht any idea what that would take? we're already making that stub .so now, so we might be really close with that?
I think most of it shouldn't be too hard. The big thing is filling out the dynamic relocation table for calls to roc_alloc
and the like. Our stub with changes to offsets should theoretically work for calling into roc code without any dependencies on the host. Though theer may also be some other relocation we need to add within the app, not fully sure.
or alias clang to zig cc?
@Braydon Hall for this you'll need to:
zig version
alias clang="zig cc"
./roc repl
in the same terminalYou'll have to save alias clang="zig cc"
to your .profile or .zshrc file if you want to keep it for all future terminal sessions.
Either I'm doing this wrong, or it doesn't work :sweat_smile:
╭─zorua@CORONET in ~
[🔴] × zig version
0.9.1
╭─zorua@CORONET in ~ took 12ms
╰─λ alias clang="zig cc"
╭─zorua@CORONET in ~
╰─λ roc repl
roc: /lib64/libtinfo.so.6: no version information available (required by roc)
The rockin’ roc repl
────────────────────────
Enter an expression, or :help, or :q to quit.
» "Hello, World!"
ld: /usr/lib/libgcc_s.so.1: error adding symbols: file in wrong format
thread 'main' panicked at 'we produce a valid Dylib: DlOpen { desc: "/tmp/.tmpx7Cxwj/app.so.1.0: cannot open shared object file: No such file or directory" }', crates/repl_cli/src/cli_gen.rs:73:65
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace```
Yeah sorry, because we can't reproduce this we have to make educated guesses about how to fix it.
For roc repl, I don't think you're using the release I sent you before, right? The 12-01 nightly should have the same functionality for enhanced error reporting in this case. Can you try again with that one?
Last updated: Jul 06 2025 at 12:14 UTC