summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-01-16 07:41:38 -0500
committerBen Gamari <ben@well-typed.com>2020-01-27 12:40:17 -0500
commit9f38782e9e284c251ac63e398789a5898d96ab3b (patch)
tree5a33e80c1f585ab31f7a2d0307ed0592b4c072a5
parent97d0b0a367e4c6a52a17c3299439ac7de129da24 (diff)
downloadhaskell-wip/T17631.tar.gz
hadrian: Depend upon libray dependencies when configuring packageswip/T17631
This will hopefully fix #17631.
-rw-r--r--hadrian/src/Rules/Library.hs-boot8
-rw-r--r--hadrian/src/Rules/Register.hs5
2 files changed, 12 insertions, 1 deletions
diff --git a/hadrian/src/Rules/Library.hs-boot b/hadrian/src/Rules/Library.hs-boot
new file mode 100644
index 0000000000..d516902c0a
--- /dev/null
+++ b/hadrian/src/Rules/Library.hs-boot
@@ -0,0 +1,8 @@
+module Rules.Library where
+
+import Base
+import Context
+
+-- Necessary for inter-dependence between Rules.Register and
+-- Rules.Library.
+needLibrary :: [Context] -> Action ()
diff --git a/hadrian/src/Rules/Register.hs b/hadrian/src/Rules/Register.hs
index e9451c2648..e0b0926e6a 100644
--- a/hadrian/src/Rules/Register.hs
+++ b/hadrian/src/Rules/Register.hs
@@ -13,6 +13,7 @@ import Oracles.Setting
import Packages
import Rules.Gmp
import Rules.Rts
+import {-# SOURCE #-} Rules.Library (needLibrary)
import Settings
import Target
import Utilities
@@ -38,7 +39,9 @@ configurePackageRules = do
root -/- "**/setup-config" %> \out -> do
(stage, path) <- parsePath (parseSetupConfig root) "<setup config path parser>" out
let pkg = unsafeFindPackageByPath path
- Cabal.configurePackage (Context stage pkg vanilla)
+ let ctx = Context stage pkg vanilla
+ needLibrary =<< contextDependencies ctx
+ Cabal.configurePackage ctx
root -/- "**/autogen/cabal_macros.h" %> \out -> do
(stage, path) <- parsePath (parseToBuildSubdirectory root) "<cabal macros path parser>" out