Stream: beginners

Topic: repl broken or just bad install?


view this post on Zulip jan kili (Oct 30 2023 at 03:48):

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

view this post on Zulip Declan Joseph Maguire (Oct 30 2023 at 03:50):

REPL is working on firefox on windows for me, so it's not a universal issue

view this post on Zulip jan kili (Oct 30 2023 at 03:57):

The tutorial starts working for me once it shifts from repl to file, here.

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 04:13):

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

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 04:14):

just did clean builds of latest main on debian and mac. Both work fine

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 04:15):

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

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 04:18):

googling, I see some comments suggesting it may be an issue with 32bit vs 64bit libraries.

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 04:19):

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.

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 04:24):

@JanCVanB Can you give us the outputs of these two commands:

file  /usr/lib/libgcc_s.so.1
find /usr/lib* -name "libgcc_s*"

view this post on Zulip jan kili (Oct 30 2023 at 04:30):

@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 ~]$

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 04:31):

ah, can you file what the symlink points to: libgcc_s-13-20231011.so.1

view this post on Zulip jan kili (Oct 30 2023 at 04:32):

[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 ~]$

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 04:33):

yeah, cool: ELF 32-bit LSB shared object

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 04:33):

So we are just linking the wrong version. Should be an easy fix here.

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 04:34):

just check lib64 before lib

view this post on Zulip jan kili (Oct 30 2023 at 04:36):

is there an even less-popular supported OS I can switch to, to find even more obscure bugs? :zany_face:

view this post on Zulip Declan Joseph Maguire (Oct 30 2023 at 04:37):

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.

view this post on Zulip jan kili (Oct 30 2023 at 04:37):

k brb

view this post on Zulip jan kili (Oct 30 2023 at 04:39):

I'm getting weird errors in my fortran-based hypervisor

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 04:44):

If you are building roc from source and willing to test locally, try the lib64 branch I just pushed

view this post on Zulip jan kili (Oct 30 2023 at 04:56):

(installing nix)

view this post on Zulip jan kili (Oct 30 2023 at 05:06):

@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]$

view this post on Zulip jan kili (Oct 30 2023 at 05:07):

the crashing repl is in nightly download

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 05:07):

Weird

view this post on Zulip jan kili (Oct 30 2023 at 05:08):

HAHA nightly repl fine inside nix develop shell

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 05:08):

Haha....nix is magic

view this post on Zulip jan kili (Oct 30 2023 at 05:08):

[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]$

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 05:09):

I guess we find the nix library when it is a available

view this post on Zulip jan kili (Oct 30 2023 at 05:09):

Can I use the locally-built repl outside of nix?

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 05:10):

Not sure. I would assume not. Cause it probably is loading nix specific dependencies that will be missing. You can try though

view this post on Zulip jan kili (Oct 30 2023 at 05:11):

I forget where the files live...

view this post on Zulip jan kili (Oct 30 2023 at 05:13):

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?

view this post on Zulip jan kili (Oct 30 2023 at 05:14):

It's not urgent for me :) I prefer file-development-land anyways

view this post on Zulip Brendan Hansknecht (Oct 30 2023 at 05:34):

./target/release/roc or ./target/debug/roc. And yeah otherwise, we can just wait for the first nightly after this PR lands

view this post on Zulip jan kili (Oct 30 2023 at 05:56):

It worked! No missing nix-specific dependencies. git switch lib64 && nix develop then cargo build && exit then ./target/debug/roc repl understands 1 + 2

view this post on Zulip jan kili (Oct 30 2023 at 06:01):

:github_merged_emoji:


Last updated: Jul 06 2025 at 12:14 UTC