roc-lang / roc

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

Improve glibc error message on NixOS #5064

Open dankeyy opened 1 year ago

dankeyy commented 1 year ago

When trying to test a Roc program in NixOS, one might enounter the following error

Couldn't find libgcc_s.so.1!
You may need to install libgcc

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

even though the system has glibc, because NixOS is not fhs compliant. As a workaround for now, we should recommend users to use nix-build with the default.nix

nat-418 commented 7 months ago

I'm not sure what needs to change here. I have not encountered this on NixOS 23.11.

Anton-4 commented 7 months ago

Yeah, you're not likely to hit this anymore but if you change nix files you may still encounter it. We can add something like this here:

eprintln!("When using Nix, set NIX_LIBGCC_S_PATH and NIX_GLIBC_PATH like we do in github.com/roc-lang/roc/blob/main/flake.nix");