Package Details: ghcid-static-git 0.8.9.r1.gb7dc5c4-4

Git Clone URL: https://aur.archlinux.org/ghcid-static-git.git (read-only, click to copy)
Package Base: ghcid-static-git
Description: GHCi based bare bones IDE
Upstream URL: https://github.com/ndmitchell/ghcid
Licenses: BSD-3-Clause
Conflicts: ghcid
Provides: ghcid
Submitter: gesh
Maintainer: gesh
Last Packager: gesh
Votes: 0
Popularity: 0.000000
First Submitted: 2021-10-27 20:40 (UTC)
Last Updated: 2025-01-19 19:45 (UTC)

Dependencies (3)

Required by (0)

Sources (1)

Pinned Comments

gesh commented on 2025-01-15 13:12 (UTC) (edited on 2025-01-15 13:15 (UTC) by gesh)

To clarify -- the goal of this package is to statically link against the Haskell dependencies. The non-Haskell libraries (glibc, gmp) could be worked around in theory, but need a musl-based toolchain to do so. I both haven't managed to make such a toolchain work, and doubt it is useful in Arch in practice, given the binaries aren't meant for redistribution to other distros.

If someone wants to try their hand at removing these deps (and so making of them makedepends), the build invocation must be passed --enable-executable-static, and (though I haven't managed to track down how to do this) GHC must be told to compile with musl-gcc instead of gcc (this might require installing a musl-based GHC).

This might not even be easily supported with current cabal, though, see https://github.com/haskell/cabal/issues/1325

See also https://hasufell.github.io/posts/2024-04-21-static-linking.html

(This investigation was sparked by the realization that hledger-bin is fully statically linked)

gesh commented on 2024-12-04 16:41 (UTC)

The default makepkg configuration sets LDFLAGS but not LD. GHC used to take this as its cue to select its own choice of LD. However GHC would not check that its choice of LD supports LDFLAGS. This is a problem for dependencies with C components, which get linked using this LD.

Starting with ghc 9.6.5 (2024-04-16), one can build this behaviour out of ghc[1]. ghcup has picked up this configuration for its bindists[2], and is to my knowledge the only bindist fixing this -- my recommendation is to use its ghc to build the package.

[1] - https://gitlab.haskell.org/ghc/ghc/-/issues/24565 [2] - https://github.com/haskell/ghcup-hs/issues/1033

Latest Comments

gesh commented on 2025-01-15 13:12 (UTC) (edited on 2025-01-15 13:15 (UTC) by gesh)

To clarify -- the goal of this package is to statically link against the Haskell dependencies. The non-Haskell libraries (glibc, gmp) could be worked around in theory, but need a musl-based toolchain to do so. I both haven't managed to make such a toolchain work, and doubt it is useful in Arch in practice, given the binaries aren't meant for redistribution to other distros.

If someone wants to try their hand at removing these deps (and so making of them makedepends), the build invocation must be passed --enable-executable-static, and (though I haven't managed to track down how to do this) GHC must be told to compile with musl-gcc instead of gcc (this might require installing a musl-based GHC).

This might not even be easily supported with current cabal, though, see https://github.com/haskell/cabal/issues/1325

See also https://hasufell.github.io/posts/2024-04-21-static-linking.html

(This investigation was sparked by the realization that hledger-bin is fully statically linked)

gesh commented on 2024-12-04 16:41 (UTC)

The default makepkg configuration sets LDFLAGS but not LD. GHC used to take this as its cue to select its own choice of LD. However GHC would not check that its choice of LD supports LDFLAGS. This is a problem for dependencies with C components, which get linked using this LD.

Starting with ghc 9.6.5 (2024-04-16), one can build this behaviour out of ghc[1]. ghcup has picked up this configuration for its bindists[2], and is to my knowledge the only bindist fixing this -- my recommendation is to use its ghc to build the package.

[1] - https://gitlab.haskell.org/ghc/ghc/-/issues/24565 [2] - https://github.com/haskell/ghcup-hs/issues/1033