I'm fresh installing Roc again :) but I seem to have caught the REPL at a bad time :P is this just a my-computer thing or for everyone?
The repl program crashes with the same error no matter what I enter - "foo"
, foo = "bar"
, 1 + 2
...
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/.tmp4bKqwR/app.so.1.0: cannot open shared object file: No such file or directory" }', crates/repl_cli/src/cli_gen.rs:71:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
This is on Fedora Linux, but can change OS if we're troubled on Linux today.
Link to possibly-related crashes: https://github.com/roc-lang/roc/issues/5797
REPL is working on firefox on windows for me, so it's not a universal issue
The tutorial starts working for me once it shifts from repl to file, here.
interesting. We link to libgcc_s
by default on linux. They system version should just work. I wonder why it doesn't work on fedora. Maybe we need to link the version in lib64 or something else special
just did clean builds of latest main on debian and mac. Both work fine
Also, probably starts working cause once you start using a file, you get the surgical linker which doesn't deal with finding and linking libraries like libgcc_s
googling, I see some comments suggesting it may be an issue with 32bit vs 64bit libraries.
So yeah, for now, I am guessing that we need to link against /usr/lib64/libgcc_s.so.1
or similar on fedora. It may have the 32bit lib in the /usr/lib
folder.
@JanCVanB Can you give us the outputs of these two commands:
file /usr/lib/libgcc_s.so.1
find /usr/lib* -name "libgcc_s*"
@Brendan Hansknecht sure thing
[jan@framey ~]$ file /usr/lib/libgcc_s.so.1
/usr/lib/libgcc_s.so.1: symbolic link to libgcc_s-13-20231011.so.1
[jan@framey ~]$ find /usr/lib* -name "libgcc_s*"
/usr/lib/gcc/x86_64-redhat-linux/13/32/libgcc_s.so
/usr/lib/gcc/x86_64-redhat-linux/13/libgcc_s.so
/usr/lib/libgcc_s-13-20231011.so.1
/usr/lib/libgcc_s.so.1
/usr/lib64/libgcc_s-13-20231011.so.1
/usr/lib64/libgcc_s.so.1
find: ‘/usr/libexec/initscripts/legacy-actions/auditd’: Permission denied
[jan@framey ~]$
ah, can you file
what the symlink points to: libgcc_s-13-20231011.so.1
[jan@framey ~]$ ls /usr/lib/libgcc*
/usr/lib/libgcc_s-13-20231011.so.1 /usr/lib/libgcc_s.so.1
[jan@framey ~]$ file /usr/lib/libgcc_s-13-20231011.so.1
/usr/lib/libgcc_s-13-20231011.so.1: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=47271e4f12eb0e416bb06db9adfd85efe28523b2, stripped
[jan@framey ~]$
yeah, cool: ELF 32-bit LSB shared object
So we are just linking the wrong version. Should be an easy fix here.
just check lib64
before lib
is there an even less-popular supported OS I can switch to, to find even more obscure bugs? :zany_face:
Maybe try all the weird government commissioned OSs and hardware from the 70s through 90s, like the BBC micro from the UK. That should give some fun bugs.
k brb
I'm getting weird errors in my fortran-based hypervisor
If you are building roc from source and willing to test locally, try the lib64
branch I just pushed
(installing nix)
@Brendan Hansknecht hmm, this test is inconclusive/redirecting because a repl built from source on main
works for me:
[jan@framey roc]$ nix develop
[jan@framey roc]$ cargo build
Finished dev [unoptimized + debuginfo] target(s) in 0.50s
[jan@framey roc]$ cargo run repl
Finished dev [unoptimized + debuginfo] target(s) in 0.44s
Running `target/debug/roc repl`
The rockin’ roc repl
────────────────────────
Enter an expression, or :help, or :q to quit.
» "hi"
"hi" : Str
»
CTRL-C
[jan@framey roc]$ git branch
* main
[jan@framey roc]$
the crashing repl is in nightly download
Weird
HAHA nightly repl fine inside nix develop shell
Haha....nix is magic
[jan@framey roc]$ nix develop
[jan@framey roc]$ cargo build
Finished dev [unoptimized + debuginfo] target(s) in 0.50s
[jan@framey roc]$ cargo run repl
Finished dev [unoptimized + debuginfo] target(s) in 0.44s
Running `target/debug/roc repl`
The rockin’ roc repl
────────────────────────
Enter an expression, or :help, or :q to quit.
» "hi"
"hi" : Str
»
CTRL-C
[jan@framey roc]$ git branch
* main
[jan@framey roc]$ which roc
~/_code/_roc/roc-nightly/roc_nightly-linux_x86_64-2023-10-27-c509252/roc
[jan@framey roc]$ roc repl
The rockin’ roc repl
────────────────────────
Enter an expression, or :help, or :q to quit.
» "hi"
"hi" : Str
»
CTRL-C
[jan@framey roc]$ exit
exit
[jan@framey roc]$ which roc
~/_code/_roc/roc-nightly/roc_nightly-linux_x86_64-2023-10-27-c509252/roc
[jan@framey roc]$ 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.
» "hi"
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/.tmpZ97s1P/app.so.1.0: cannot open shared object file: No such file or directory" }', crates/repl_cli/src/cli_gen.rs:71:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[jan@framey roc]$
I guess we find the nix library when it is a available
Can I use the locally-built repl outside of nix?
Not sure. I would assume not. Cause it probably is loading nix specific dependencies that will be missing. You can try though
I forget where the files live...
Assuming I can't, does that mean the next step is to wait for someone to provide me with a hopefully-fixed compiler that was built in an x64 Linux environment without Nix?
It's not urgent for me :) I prefer file-development-land anyways
./target/release/roc
or ./target/debug/roc
. And yeah otherwise, we can just wait for the first nightly after this PR lands
It worked! No missing nix-specific dependencies. git switch lib64 && nix develop
then cargo build && exit
then ./target/debug/roc repl
understands 1 + 2
:github_merged_emoji:
Last updated: Jul 06 2025 at 12:14 UTC