GHC 9.4 symlink wrappers installed incorrectly on FreeBSD 12

Viktor Dukhovni ietf-dane at dukhovni.org
Thu Aug 11 02:06:43 UTC 2022


I just built a GHC 9.4 bindist on FreeBSD 12, and found that the bindist
Makefile installed unusable wrappers when the source was a symlink.  It
seems plausible that the issue may not be FreeBSD-specific, but that's
all I've tried so far.

The problem wrappers do not have execute permissions, and lack the
variable settings at the top of the scripts needed to make them work:

    $ ls -l ~/.local/ghc-9.4/bin
    total 98
    -rw-r--r--  1 viktor  viktor    45 Aug 10 21:46 ghc
    -rwxr-xr-x  1 viktor  viktor   406 Aug 10 21:46 ghc-9.4.1
    -rw-r--r--  1 viktor  viktor    97 Aug 10 21:46 ghc-pkg
    -rwxr-xr-x  1 viktor  viktor   466 Aug 10 21:46 ghc-pkg-9.4.1
    -rw-r--r--  1 viktor  viktor    67 Aug 10 21:46 ghci
    -rwxr-xr-x  1 viktor  viktor   430 Aug 10 21:46 ghci-9.4.1
    -rw-r--r--  1 viktor  viktor    57 Aug 10 21:46 haddock
    -rwxr-xr-x  1 viktor  viktor   434 Aug 10 21:46 haddock-ghc-9.4.1
    -rw-r--r--  1 viktor  viktor    33 Aug 10 21:46 hp2ps
    -rwxr-xr-x  1 viktor  viktor   406 Aug 10 21:46 hp2ps-ghc-9.4.1
    -rw-r--r--  1 viktor  viktor    33 Aug 10 21:46 hpc
    -rwxr-xr-x  1 viktor  viktor   402 Aug 10 21:46 hpc-ghc-9.4.1
    -rw-r--r--  1 viktor  viktor   734 Aug 10 21:46 hsc2hs
    -rwxr-xr-x  1 viktor  viktor  1109 Aug 10 21:46 hsc2hs-ghc-9.4.1
    -rw-r--r--  1 viktor  viktor    50 Aug 10 21:46 runghc
    -rwxr-xr-x  1 viktor  viktor   417 Aug 10 21:46 runghc-9.4.1
    -rw-r--r--  1 viktor  viktor    50 Aug 10 21:46 runhaskell
    -rwxr-xr-x  1 viktor  viktor   425 Aug 10 21:46 runhaskell-9.4.1

    $ (cd ~/.local/ghc-9.4; grep . $(find bin ! -name hsc2hs ! -perm -001))
    bin/ghci:executable="$bindir/ghc-9.4.1"
    bin/ghci:exec $executable --interactive "$@"
    bin/ghc:exec "$executablename" -B"$libdir" ${1+"$@"}
    bin/haddock:exec "$executablename" -B"$libdir" -l"$libdir" ${1+"$@"}
    bin/hp2ps:exec "$executablename" ${1+"$@"}
    bin/ghc-pkg:PKGCONF="$libdir/package.conf.d"
    bin/ghc-pkg:exec "$executablename" --global-package-db "$PKGCONF" ${1+"$@"}
    bin/runghc:exec "$executablename" -f "$exedir/ghc" ${1+"$@"}
    bin/hpc:exec "$executablename" ${1+"$@"}
    bin/runhaskell:exec "$executablename" -f "$exedir/ghc" ${1+"$@"}

The same holds for "hsc2hs", but the "meat" of the script is longer so I
chose to skip it.

-- 
    Viktor.


More information about the ghc-devs mailing list