Bug#1116556: ghc: FTBFS on hurd-any
Samuel Thibault
sthibault at debian.org
Sun Sep 28 16:21:25 BST 2025
Package: ghc
Version: 9.6.6-4
Severity: important
Tags: ftbfs patch
Hello,
ghc 9.8 and 9.10 currently FTBFS on hurd like so:
# _build/stage1/inplace/package.conf.d/.stamp
| Run GhcPkg Recache Stage1: none => none
| Executable found: x86_64-gnu-ld => /usr/bin/x86_64-gnu-ld
| Package 'rts' configuration flags: configure --distdir /build/reproducible-path/ghc-9.8.4/_build/stage1/rts --disable-executable-stripping --disable-library-str
# cabal-configure (for _build/stage1/rts/setup-config)
Error: hadrian: '/build/reproducible-path/ghc-9.8.4/_build/stage0/bin/ghc'
exited with an error:
ghc: missing -B<dir> option
This is because ghc was missing getExecutablePath support on GNU/Hurd.
This was fixed upstream with
https://gitlab.haskell.org/ghc/ghc/-/commit/3939a8bf93e27d8151aa1d92bf3ce10bbbc96a72.diff
Could you backport it to the Debian package, as attached? I have
included both a 9.8 and a 9.10 version.
Thanks,
Samuel
-- System Information:
Debian Release: forky/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'testing-debug'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'oldoldstable-proposed-updates-debug'), (500, 'oldoldstable'), (500, 'buildd-unstable'), (500, 'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental-debug'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64
Kernel: Linux 6.16.3+deb14-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages ghc depends on:
ii dpkg 1.22.21
ii gcc 4:15.2.0-4
ii libbsd-dev 0.12.2-2
ii libc6 2.41-12
ii libc6-dev 2.41-12
ii libffi-dev 3.5.2-2
ii libffi8 3.5.2-2
ii libgmp-dev 2:6.3.0+dfsg-5
ii libgmp10 2:6.3.0+dfsg-5
ii libncurses-dev 6.5+20250216-2
ii libnuma-dev 2.0.19-1
ii libnuma1 2.0.19-1
ii libtinfo6 6.5+20250216-2
Versions of packages ghc recommends:
ii libstdc++-14-dev 14.3.0-8
Versions of packages ghc suggests:
pn ghc-doc <none>
pn ghc-prof <none>
pn llvm-18 <none>
ii perl 5.40.1-6
-- no debconf information
--
Samuel
il y a 10 catégories de personnes dans le monde : ceux qui comprennent le
binaire, et ceux qui ne le comprennent pas
-------------- next part --------------
diff --git a/libraries/base/System/Environment/ExecutablePath.hsc b/libraries/base/System/Environment/ExecutablePath.hsc
index 5e1daa944205efc9bf49061428e0760763eef62f..07d0f89a90e1629a77bca21924f7e075cee0d19e 100644
--- a/libraries/base/System/Environment/ExecutablePath.hsc
+++ b/libraries/base/System/Environment/ExecutablePath.hsc
@@ -200,9 +200,9 @@ executablePath = Just (fmap Just getExecutablePath `catch` f)
| otherwise = throw e
--------------------------------------------------------------------------------
--- Linux / Solaris
+-- Linux / Solaris / Hurd
-#elif defined(linux_HOST_OS) || defined(solaris2_HOST_OS)
+#elif defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(gnu_HOST_OS)
foreign import ccall unsafe "readlink"
c_readlink :: CString -> CString -> CSize -> IO CInt
@@ -219,7 +219,7 @@ readSymbolicLink file =
c_readlink s buf 4096
peekFilePathLen (buf,fromIntegral len)
-# if defined(linux_HOST_OS)
+# if defined(linux_HOST_OS) || defined(gnu_HOST_OS)
getExecutablePath = readSymbolicLink $ "/proc/self/exe"
executablePath = Just (check <$> getExecutablePath) where
-------------- next part --------------
diff --git a/libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc b/libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
index 5e1daa944205efc9bf49061428e0760763eef62f..07d0f89a90e1629a77bca21924f7e075cee0d19e 100644
--- a/libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
+++ b/libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
@@ -200,9 +200,9 @@ executablePath = Just (fmap Just getExecutablePath `catch` f)
| otherwise = throw e
--------------------------------------------------------------------------------
--- Linux / Solaris
+-- Linux / Solaris / Hurd
-#elif defined(linux_HOST_OS) || defined(solaris2_HOST_OS)
+#elif defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(gnu_HOST_OS)
foreign import ccall unsafe "readlink"
c_readlink :: CString -> CString -> CSize -> IO CInt
@@ -219,7 +219,7 @@ readSymbolicLink file =
c_readlink s buf 4096
peekFilePathLen (buf,fromIntegral len)
-# if defined(linux_HOST_OS)
+# if defined(linux_HOST_OS) || defined(gnu_HOST_OS)
getExecutablePath = readSymbolicLink $ "/proc/self/exe"
executablePath = Just (check <$> getExecutablePath) where
More information about the Pkg-haskell-maintainers
mailing list