[Git][ghc/ghc][wip/remove-rts-configure-hack] Draft: Remove RTS hack for configuring

John Ericson (@Ericson2314) gitlab at gitlab.haskell.org
Tue Jan 3 21:36:21 UTC 2023



John Ericson pushed to branch wip/remove-rts-configure-hack at Glasgow Haskell Compiler / GHC


Commits:
e9cc3e5e by John Ericson at 2023-01-03T16:36:11-05:00
Draft: Remove RTS hack for configuring

I expect this to fail on macOS.

- - - - -


2 changed files:

- hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
- hadrian/src/Rules/Register.hs


Changes:

=====================================
hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
=====================================
@@ -148,6 +148,8 @@ configurePackage context at 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 at 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 at .
-            pure $ C.simpleUserHooks { C.postConf = \_ _ _ _ -> return () }
-          | otherwise -> pure C.simpleUserHooks
 
     -- Compute the list of flags, and the Cabal configuration arguments
     flavourArgs <- args <$> flavour


=====================================
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



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e9cc3e5ed021db499e760d3b78cf9d2410ee5798

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e9cc3e5ed021db499e760d3b78cf9d2410ee5798
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230103/3c0c20e5/attachment-0001.html>


More information about the ghc-commits mailing list