[Git][ghc/ghc][wip/T25282] 2 commits: hadrian: Add non-reinstallable package list to generated settings file

Teo Camarasu (@teo) gitlab at gitlab.haskell.org
Mon Sep 23 15:08:12 UTC 2024



Teo Camarasu pushed to branch wip/T25282 at Glasgow Haskell Compiler / GHC


Commits:
dbb4b707 by Teo Camarasu at 2024-09-23T16:07:59+01:00
hadrian: Add non-reinstallable package list to generated settings file

This lets Cabal know which packages are not reinstallable.
Previously this was a fixed list that was hard-coded into Cabal.

See: <https://github.com/haskell/cabal/issues/10087>

Resolvces #25282

- - - - -
02ce16f9 by Teo Camarasu at 2024-09-23T16:07:59+01:00
Mark template-haskell as reinstallable

- - - - -


3 changed files:

- hadrian/src/Packages.hs
- hadrian/src/Rules/CabalReinstall.hs
- hadrian/src/Rules/Generate.hs


Changes:

=====================================
hadrian/src/Packages.hs
=====================================
@@ -12,7 +12,7 @@ module Packages (
     runGhc, semaphoreCompat, stm, templateHaskell, terminfo, text, time, timeout,
     transformers, unlit, unix, win32, xhtml,
     lintersCommon, lintNotes, lintCodes, lintCommitMsg, lintSubmoduleRefs, lintWhitespace,
-    ghcPackages, isGhcPackage,
+    ghcPackages, isGhcPackage, nonReinstallablePackages,
 
     -- * Package information
     crossPrefix, programName, nonHsMainPackage, programPath, timeoutPath,
@@ -248,3 +248,30 @@ Cabal requires a few headstands:
    its face when a relative path is used (e.g. `../cwrapper.c`). Consequently
    we copy the files into `driver/ghci` in the configure script.
 -}
+
+
+-- | The set of non-reinstallable packages includes those which cannot be
+-- rebuilt using a GHC installation and Hackage-published source distribution.
+-- There are a few reasons why this might be true:
+--
+--  * the package overrides its unit ID (e.g. with ghc's @-this-unit-id@ flag),
+--    which can result in multiple indistinguishable packages (having potentially
+--    different ABIs) with the same unit ID.
+--
+--  * the package contains definitions of wired-in declarations which tie
+--    it to a particular compiler (e.g. we can't build link against
+--    @base-4.18.0.0@ using GHC 9.6.1).
+--
+--  * the package does not have a complete (that is, buildable) source distribution.
+--    For instance, some packages provided by GHC rely on files outside of the
+--    source tree generated by GHC's build system.
+nonReinstallablePackages :: [Package]
+nonReinstallablePackages =
+  [ base
+  , ghcBignum
+  , ghcInternal
+  , ghcPrim
+  , ghc
+  , integerGmp
+  , integerSimple
+  ]


=====================================
hadrian/src/Rules/CabalReinstall.hs
=====================================
@@ -24,7 +24,7 @@ The libdir of the reinstalled GHC points to the libdir of the stage 2 compiler (
 
 -- | We don't support reinstalling these
 cabalExcludedPackages :: [Package]
-cabalExcludedPackages = [array, base, deepseq, filepath, ghcBignum, ghcBootTh, ghcPrim, integerGmp, integerSimple, pretty, templateHaskell]
+cabalExcludedPackages = [array, base, deepseq, filepath, ghcBignum, ghcBootTh, ghcPrim, integerGmp, integerSimple, pretty]
 
 
 cabalBuildRules :: Rules ()


=====================================
hadrian/src/Rules/Generate.hs
=====================================
@@ -505,6 +505,7 @@ generateSettings settingsFile = do
         , ("Use LibFFI", expr $ yesNo <$> useLibffiForAdjustors)
         , ("RTS expects libdw", yesNo <$> getFlag UseLibdw)
         , ("Relative Global Package DB", pure rel_pkg_db)
+        , ("Non-reinstallable packages", pure . unwords . map pkgName $ nonReinstallablePackages)
         ]
     let showTuple (k, v) = "(" ++ show k ++ ", " ++ show v ++ ")"
     pure $ case settings of



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a2bfa54bd8e4dfbebe0d961747fbbfe3ddd23414...02ce16f941f5e4d3e948f8810b3ce5637178e21e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a2bfa54bd8e4dfbebe0d961747fbbfe3ddd23414...02ce16f941f5e4d3e948f8810b3ce5637178e21e
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/20240923/b8c1dbfe/attachment-0001.html>


More information about the ghc-commits mailing list