Skip to content

Commit

Permalink
Fix the platform string for GNU/Hurd
Browse files Browse the repository at this point in the history
Since version 9.4.7-1, ghc fails to build on the GNU/Hurd port of Debian,
see

https://buildd.debian.org/status/fetch.php?pkg=ghc&arch=hurd-i386&ver=9.4.7-1&stamp=1697717885&raw=0

Error, rule finished running but did not produce file:
  _build/stage0/lib/i386-gnu-ghc-9.4.6/ghc-boot-th-9.4.7/libHSghc-boot-th-9.4.7.a

and indeed, what did get produce was rather
_build/stage0/lib/i386-hurd-ghc-9.4.6/ghc-boot-th-9.4.7/libHSghc-boot-th-9.4.7.a
(i386-hurd instead of i386-gnu).

This is due to confusion between hurd and gnu in various places.  Apparently
previous versions of ghc were using gnu for the GNU/Hurd port, and thus
putting libraries etc. in i386-gnu. So we have to follow the existing
practice.
  • Loading branch information
sthibaul committed Nov 14, 2023
1 parent 69417ac commit 25106e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cabal/src/Distribution/Simple/GHC/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ ghcOsString :: OS -> String
ghcOsString Windows = "mingw32"
ghcOsString OSX = "darwin"
ghcOsString Solaris = "solaris2"
ghcOsString Hurd = "gnu"
ghcOsString other = prettyShow other

-- | GHC's rendering of its platform and compiler version string as used in
Expand Down
11 changes: 11 additions & 0 deletions changelog.d/pr-9434
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
synopsis: Fix the platform string for GNU/Hurd
packages: Cabal
prs: #9434

description: {

Depending who you ask, GNU/Hurd will be labelled "gnu" or "hurd". The autotools
use "gnu", so ghc follows this for installed files, even if the ghc source code
uses OSHurd. We thus need to add the translation between the two.

}

0 comments on commit 25106e4

Please sign in to comment.