roc-lang / roc

A fast, friendly, functional language.
https://roc-lang.org
Universal Permissive License v1.0
4.48k stars 315 forks source link

repl (nightly) failed to link dynamic library #5866

Open Anton-4 opened 1 year ago

Anton-4 commented 1 year ago
./roc repl

  The rockin’ roc repl
────────────────────────

Enter an expression, or :help, or :q to quit.

» 2+2
Couldn't find the glibc development files!
We need the objects crti.o, crtn.o, and Scrt1.o
You may need to install the glibc development package
(probably called glibc-dev or glibc-devel)

We looked in the following directories:
/usr/lib/x86_64-linux-gnu
/lib/x86_64-linux-gnu
/usr/lib
/usr/lib64
username@ubu-22-04:~/Downloads/nightly/roc_nightly-linux_x86_64-2023-09-29-648a02a$ sudo apt install libc-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libc6-dev' instead of 'libc-dev'
The following packages were automatically installed and are no longer required:
  apg ethtool gnome-control-center-faces gnome-online-accounts libcolord-gtk1
  libfreerdp-server2-2 libgnome-bg-4-1 libgsound0 libgssdp-1.2-0
  libgupnp-1.2-1 libgupnp-av-1.0-3 libgupnp-dlna-2.0-4 libmspack0 libntfs-3g89
  librygel-core-2.6-2 librygel-db-2.6-2 librygel-renderer-2.6-2
  librygel-server-2.6-2 libvncserver1 libxmlsec1-openssl
  mobile-broadband-provider-info network-manager-gnome open-vm-tools
  python3-certifi python3-macaroonbakery python3-protobuf python3-pymacaroons
  python3-requests python3-rfc3339 python3-tz rygel zerofree
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libc-dev-bin libc-devtools libcrypt-dev libnsl-dev libtirpc-dev
  linux-libc-dev manpages-dev rpcsvc-proto
Suggested packages:
  glibc-doc
The following NEW packages will be installed:
  libc-dev-bin libc-devtools libc6-dev libcrypt-dev libnsl-dev libtirpc-dev
  linux-libc-dev manpages-dev rpcsvc-proto
0 upgraded, 9 newly installed, 0 to remove and 7 not upgraded.
Need to get 6.232 kB of archives.
After this operation, 26,7 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://be.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libc-dev-bin amd64 2.35-0ubuntu3.3 [20,3 kB]
Get:2 http://be.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libc-devtools amd64 2.35-0ubuntu3.3 [28,9 kB]
Get:3 http://be.archive.ubuntu.com/ubuntu jammy-updates/main amd64 linux-libc-dev amd64 5.15.0-84.93 [1.330 kB]
Get:4 http://be.archive.ubuntu.com/ubuntu jammy/main amd64 libcrypt-dev amd64 1:4.4.27-1 [112 kB]
Get:5 http://be.archive.ubuntu.com/ubuntu jammy/main amd64 rpcsvc-proto amd64 1.4.2-0ubuntu6 [68,5 kB]
Get:6 http://be.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libtirpc-dev amd64 1.3.2-2ubuntu0.1 [192 kB]
Get:7 http://be.archive.ubuntu.com/ubuntu jammy/main amd64 libnsl-dev amd64 1.3.0-2build2 [71,3 kB]
Get:8 http://be.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libc6-dev amd64 2.35-0ubuntu3.3 [2.100 kB]
Get:9 http://be.archive.ubuntu.com/ubuntu jammy/main amd64 manpages-dev all 5.10-1ubuntu1 [2.309 kB]
Fetched 6.232 kB in 1s (11,4 MB/s)      
Selecting previously unselected package libc-dev-bin.
(Reading database ... 200307 files and directories currently installed.)
Preparing to unpack .../0-libc-dev-bin_2.35-0ubuntu3.3_amd64.deb ...
Unpacking libc-dev-bin (2.35-0ubuntu3.3) ...
Selecting previously unselected package libc-devtools.
Preparing to unpack .../1-libc-devtools_2.35-0ubuntu3.3_amd64.deb ...
Unpacking libc-devtools (2.35-0ubuntu3.3) ...
Selecting previously unselected package linux-libc-dev:amd64.
Preparing to unpack .../2-linux-libc-dev_5.15.0-84.93_amd64.deb ...
Unpacking linux-libc-dev:amd64 (5.15.0-84.93) ...
Selecting previously unselected package libcrypt-dev:amd64.
Preparing to unpack .../3-libcrypt-dev_1%3a4.4.27-1_amd64.deb ...
Unpacking libcrypt-dev:amd64 (1:4.4.27-1) ...
Selecting previously unselected package rpcsvc-proto.
Preparing to unpack .../4-rpcsvc-proto_1.4.2-0ubuntu6_amd64.deb ...
Unpacking rpcsvc-proto (1.4.2-0ubuntu6) ...
Selecting previously unselected package libtirpc-dev:amd64.
Preparing to unpack .../5-libtirpc-dev_1.3.2-2ubuntu0.1_amd64.deb ...
Unpacking libtirpc-dev:amd64 (1.3.2-2ubuntu0.1) ...
Selecting previously unselected package libnsl-dev:amd64.
Preparing to unpack .../6-libnsl-dev_1.3.0-2build2_amd64.deb ...
Unpacking libnsl-dev:amd64 (1.3.0-2build2) ...
Selecting previously unselected package libc6-dev:amd64.
Preparing to unpack .../7-libc6-dev_2.35-0ubuntu3.3_amd64.deb ...
Unpacking libc6-dev:amd64 (2.35-0ubuntu3.3) ...
Selecting previously unselected package manpages-dev.
Preparing to unpack .../8-manpages-dev_5.10-1ubuntu1_all.deb ...
Unpacking manpages-dev (5.10-1ubuntu1) ...
Setting up manpages-dev (5.10-1ubuntu1) ...
Setting up linux-libc-dev:amd64 (5.15.0-84.93) ...
Setting up libtirpc-dev:amd64 (1.3.2-2ubuntu0.1) ...
Setting up rpcsvc-proto (1.4.2-0ubuntu6) ...
Setting up libnsl-dev:amd64 (1.3.0-2build2) ...
Setting up libcrypt-dev:amd64 (1:4.4.27-1) ...
Setting up libc-dev-bin (2.35-0ubuntu3.3) ...
Setting up libc-devtools (2.35-0ubuntu3.3) ...
Setting up libc6-dev:amd64 (2.35-0ubuntu3.3) ...
Processing triggers for man-db (2.10.2-1) ...
username@ubu-22-04:~/Downloads/nightly/roc_nightly-linux_x86_64-2023-09-29-648a02a$ ./roc repl

  The rockin’ roc repl
────────────────────────

Enter an expression, or :help, or :q to quit.

» 2+2
thread 'main' panicked at 'failed to link dynamic library: Os { code: 2, kind: NotFound, message: "No such file or directory" }', crates/repl_cli/src/cli_gen.rs:341:6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

roc version: roc_nightly-linux_x86_64-2023-09-29-648a02

Anton-4 commented 1 year ago

A bloated workaround:

wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 13
Anton-4 commented 1 year ago

ld was missing, it can be installed with:

sudo apt install binutils

The error message should still be improved before this issue can be closed.