summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-03 13:03:53 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-09 20:39:27 -0500
commit5d65773eb6bbac76247f97f385772fe366889085 (patch)
tree4b5a73aac877161d4762b867faf1b4cdd2537265 /hadrian
parent965a273510adfac4f041a31182c2fec82e614e47 (diff)
downloadhaskell-5d65773eb6bbac76247f97f385772fe366889085.tar.gz
Remove RTS hack for configuring
See the brand new Note [Undefined symbols in the RTS] for additional details.
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Hadrian/Haskell/Cabal/Parse.hs8
-rw-r--r--hadrian/src/Rules/Register.hs8
2 files changed, 10 insertions, 6 deletions
diff --git a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
index dfb4924889..ab7850771c 100644
--- a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
+++ b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
@@ -148,6 +148,8 @@ configurePackage context@Context {..} = do
-- Figure out what hooks we need.
hooks <- case C.buildType (C.flattenPackageDescription gpd) of
C.Configure -> pure C.autoconfUserHooks
+ C.Simple -> pure C.simpleUserHooks
+ C.Make -> fail "build-type: Make is not supported"
-- The 'time' package has a 'C.Custom' Setup.hs, but it's actually
-- 'C.Configure' plus a @./Setup test@ hook. However, Cabal is also
-- 'C.Custom', but doesn't have a configure script.
@@ -155,12 +157,6 @@ configurePackage context@Context {..} = do
configureExists <- doesFileExist $
replaceFileName (pkgCabalFile package) "configure"
pure $ if configureExists then C.autoconfUserHooks else C.simpleUserHooks
- -- Not quite right, but good enough for us:
- _ | package == rts ->
- -- Don't try to do post configuration validation for 'rts'. This
- -- will simply not work, due to the @ld-options@ and @Stg.h@.
- pure $ C.simpleUserHooks { C.postConf = \_ _ _ _ -> return () }
- | otherwise -> pure C.simpleUserHooks
-- Compute the list of flags, and the Cabal configuration arguments
flavourArgs <- args <$> flavour
diff --git a/hadrian/src/Rules/Register.hs b/hadrian/src/Rules/Register.hs
index e716204614..bfd8538cb0 100644
--- a/hadrian/src/Rules/Register.hs
+++ b/hadrian/src/Rules/Register.hs
@@ -45,6 +45,14 @@ configurePackageRules = do
isGmp <- (== "gmp") <$> interpretInContext ctx getBignumBackend
when isGmp $
need [buildP -/- "include/ghc-gmp.h"]
+ when (pkg == rts) $ do
+ -- Rts.h is a header listed in the cabal file, and configuring
+ -- therefore wants to ensure that the header "works" post-configure.
+ -- But it (transitively) includes these, so we must ensure they exist
+ -- for that check to work.
+ need [ buildP -/- "include/ghcautoconf.h"
+ , buildP -/- "include/ghcplatform.h"
+ ]
Cabal.configurePackage ctx
root -/- "**/autogen/cabal_macros.h" %> \out -> do