haskell / unix

POSIX functionality
https://hackage.haskell.org/package/unix
Other
107 stars 92 forks source link

System library dependencies not documented #265

Open andreasabel opened 1 year ago

andreasabel commented 1 year ago

Which system libraries does unix depend on? This should be documented in:

Here is a broken CI run with GHC 9.4 and --enable-executable-static on ubuntu-22.04 that points to a missing library, but it is not apparent from unixs documentation which one:

/usr/local/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/lib/../lib/x86_64-linux-ghc-9.4.3/unix-2.7.3/libHSunix-2.7.3.a(Files.o):
function ghczuwrapperZC1ZCunixzm2zi7zi3ZCSystemziPosixziFilesZCmknod: 
error: undefined reference to '__xmknod'

See https://github.com/andreasabel/ci-executable-static/actions/runs/3620850873/jobs/6103575852

Report at ubuntu-22.04 home:

hasufell commented 1 year ago

Which system libraries does unix depend on?

$ lddtree libHSunix-2.7.2.2-ghc8.10.7.so | grep -v libHS                                                                          114ms  Mon 16:49
    librt.so.1 => /lib64/librt.so.1
    libutil.so.1 => /lib64/libutil.so.1
    libdl.so.2 => /lib64/libdl.so.2
    libpthread.so.0 => /lib64/libpthread.so.0
    libgmp.so.10 => /lib64/libgmp.so.10
    libc.so.6 => /lib64/libc.so.6
        ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
    libm.so.6 => /lib64/libm.so.6
Bodigrim commented 1 year ago

__xmknod is mknod provided by glibc. I don't think the CI failure is anyhow specific to unix package, it's just the very first library GHC is trying to link statically.

andreasabel commented 1 year ago

Thanks for the info.
I think it would be good to add the information that Julian retrieved to the docs, or, alternatively, the recipe how to retrieve it.

Bodigrim commented 2 months ago

The problem with __xmknod is likely because "glibc in version 2.33 removed definitions of xstat, xstat64, __xmknod and others from sys/stat.h". See also https://github.com/oracle/graal/issues/5814 for another instance of breakage, outside of Haskell ecosystem.

AFAIU the solution would be to use a GHC bindist built for Ubuntu 22.04 (currently we reuse the bindist for Ubuntu 20.04).

hasufell commented 2 months ago

AFAIU the solution would be to use a GHC bindist built for Ubuntu 22.04

Can you open an issue at ghcup-metadata?