Bug#1116556: ghc: FTBFS on hurd-any
Samuel Thibault
sthibault at debian.org
Sun Nov 23 01:07:27 GMT 2025
Hello,
Samuel Thibault, le dim. 28 sept. 2025 17:21:25 +0200, a ecrit:
> 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
This is still a concern with the latest ghc upload.
> Could you backport it to the Debian package, as attached? I have
> included both a 9.8 and a 9.10 version.
Could you please apply the attached upstream patch?
Samuel
-------------- 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