haskell / ghcup-hs

https://www.haskell.org/ghcup/
GNU Lesser General Public License v3.0
284 stars 88 forks source link

ghcup-0.1.22.0 with libtinfow.so.9 currently broken on FreeBSD #1078

Closed mr0mr0 closed 3 months ago

mr0mr0 commented 4 months ago

ghcup-0.1.22.0 (as fetched by curl) fails to run on FreeBSD owing to a linker error for versioned shared object "libtinfow.so.9". FreeBSD install of ncurses currently delivers libtinfo.so.6 Previous version ghcup-0.1.20.0 does not exhibit this problem, and runs okay on FreeBSD Attempts to hack the shell script delivered by curl, eg by setting script environment variable "ghver=0.1.20.0", fail owing to immediate auto-upgrade to the the non-working version

Workaround: [1] run the script from curl as far as possible to get some .ghcup infrastructure in place (it ends with the linker error as below) [2] over-write ghcup with the earlier version ghver="0.1.22.0"; curl -Lf "https://downloads.haskell.org/~ghcup/$ghver/x86_64-portbld-freebsd-ghcup-$ghver" >~/.ghcup/bin/ghcup chmod a+x ~/.ghcup/bin/ghcup [3] ghcup tui # now works for me

Example failures with 0.1.22.0

[user@home ~]$ ghcup ld-elf.so.1: Shared object "libtinfow.so.9" not found, required by "ghcup"

[user@home ~]$ ldd .ghcup/bin/ghcup .ghcup/bin/ghcup: libm.so.5 => /lib/libm.so.5 (0x128848499000) libtinfow.so.9 => not found (0) ### <<<<< libutil.so.9 => /lib/libutil.so.9 (0x128847962000) libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x1288490d3000) libgmp.so.10 => /usr/local/lib/libgmp.so.10 (0x12884999d000) librt.so.1 => /usr/lib/librt.so.1 (0x128849b92000) libdl.so.1 => /usr/lib/libdl.so.1 (0x128849edf000) libthr.so.3 => /lib/libthr.so.3 (0x12884a422000) libc.so.7 => /lib/libc.so.7 (0x12884a8ff000) [vdso] (0x7ffffffff650)

Sample curl command from https://www.haskell.org/ghcup/ which fetches installation shell script curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org

hasufell commented 4 months ago

libtinfow.so.9 is provided by the FreeBSD base system and it is SONAME 9 for FreeBSD 14: https://github.com/freebsd/freebsd-src/blob/stable/14/lib/ncurses/tinfo/Makefile#L10

We do not actively support older FreeBSD versions. Which version are you running?

mr0mr0 commented 4 months ago

D'oh! back to school for me! I am lurking behind the curve on FreeBSD 13.2 I like your idea: "OS is older than currently GHCup supported version - consider this in case of problems" My apologies, and thanks for checking.

hasufell commented 4 months ago

I would like to support even older FreeBSDs and I have private CI that can do that with pots/jails.

But it's work and I do all this in my free time anyway.