[Git][ghc/ghc][wip/T23536-teo] Deleted 1 commit: try not always re-exporting template-haskell in ghc-boot

Teo Camarasu (@teo) gitlab at gitlab.haskell.org
Wed Apr 10 11:26:22 UTC 2024



Teo Camarasu pushed to branch wip/T23536-teo at Glasgow Haskell Compiler / GHC


WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below.


Deleted commits:
01b8ad82 by Teo Camarasu at 2024-04-10T10:15:46+01:00
try not always re-exporting template-haskell in ghc-boot

- - - - -


4 changed files:

- compiler/ghc.cabal.in
- hadrian/src/Settings/Packages.hs
- libraries/ghc-boot/ghc-boot.cabal.in
- libraries/ghci/ghci.cabal.in


Changes:

=====================================
compiler/ghc.cabal.in
=====================================
@@ -82,6 +82,15 @@ Flag hadrian-stage0
     Default: False
     Manual: True
 
+Flag bootstrap-th
+    Description:
+      Enabled when building the stage1 compiler in order to vendor the in-tree
+      `template-haskell` library, while allowing dependencies to depend on the
+      boot `template-haskell` library.
+      See Note [Bootstrapping Template Haskell]
+    Default: False
+    Manual: True
+
 Library
     Default-Language: GHC2021
     Exposed: False
@@ -124,6 +133,10 @@ Library
                    ghc-heap   == @ProjectVersionMunged@,
                    ghci == @ProjectVersionMunged@
 
+    if !flag(bootstrap-th)
+        Build-Depends:
+            template-haskell    == 2.22.0.0
+
     if os(windows)
         Build-Depends: Win32  >= 2.3 && < 2.15
     else


=====================================
hadrian/src/Settings/Packages.hs
=====================================
@@ -87,6 +87,7 @@ packageArgs = do
             -- We do it through a cabal flag in ghc.cabal
             , stageVersion < makeVersion [9,8,1] ? arg "+hadrian-stage0"
             , flag StaticLibzstd `cabalFlag` "static-libzstd"
+            , stage0 `cabalFlag` "bootstrap-th"
             ]
 
           , builder (Haddock BuildPackage) ? arg ("--optghc=-I" ++ path) ]
@@ -155,9 +156,12 @@ packageArgs = do
           -- compiler comes with the same versions as the one we are building.
           --
             builder (Cabal Setup) ? cabalExtraDirs ffiIncludeDir ffiLibraryDir
-          , builder (Cabal Flags) ? ifM stage0
-              (andM [cross, bootCross] `cabalFlag` "internal-interpreter")
-              (arg "internal-interpreter")
+          , builder (Cabal Flags) ? mconcat
+             [ ifM stage0
+                (andM [cross, bootCross] `cabalFlag` "internal-interpreter")
+                (arg "internal-interpreter")
+             , stage0 `cabalFlag` "bootstrap-th"
+             ]
 
           ]
 


=====================================
libraries/ghc-boot/ghc-boot.cabal.in
=====================================
@@ -115,17 +115,13 @@ Library
       hs-source-dirs: .
       build-depends:
               ghc-boot-th         == @ProjectVersionMunged@
-            , template-haskell    == 2.22.0.0
-      -- reexport modules from ghc-boot-th and template-haskell so that packages
-      -- don't have to import all of ghc-boot, ghc-boot-th and template-haskell.
-      -- It makes the dependency graph easier to understand and to refactor
-      -- and reduces the amount of cabal flags we need to use for bootstrapping TH.
+      -- reexport modules from ghc-boot-th that packages
+      -- don't have to import all of ghc-boot, and ghc-boot-th.
+      -- It makes the dependency graph easier to understand.
       reexported-modules:
               GHC.LanguageExtensions.Type
             , GHC.ForeignSrcLang.Type
             , GHC.Lexeme
-            , Language.Haskell.TH
-            , Language.Haskell.TH.Syntax
     if !os(windows)
         build-depends:
                    unix       >= 2.7 && < 2.9


=====================================
libraries/ghci/ghci.cabal.in
=====================================
@@ -22,6 +22,15 @@ Flag internal-interpreter
     Default: False
     Manual: True
 
+Flag bootstrap-th
+    Description:
+      Enabled when building the stage1 compiler in order to vendor the in-tree
+      `template-haskell` library, while allowing dependencies to depend on the
+      boot `template-haskell` library.
+      See Note [Bootstrapping Template Haskell]
+    Default: False
+    Manual: True
+
 source-repository head
     type:     git
     location: https://gitlab.haskell.org/ghc/ghc.git
@@ -86,5 +95,10 @@ library
         ghc-heap         == @ProjectVersionMunged@,
         transformers     >= 0.5 && < 0.7
 
+    if !flag(bootstrap-th)
+        Build-Depends:
+            template-haskell    == 2.22.0.0
+
+
     if !os(windows)
         Build-Depends: unix >= 2.7 && < 2.9



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/01b8ad82b641ecb1b6859774e342548049a3bd32
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/20240410/b96788db/attachment-0001.html>


More information about the ghc-commits mailing list