summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-05-09 18:23:15 +0100
committerZubin Duggal <zubin.duggal@gmail.com>2022-05-25 19:03:35 +0530
commit243e6c44e95a9462844f73f394fe6a5dc3e4145a (patch)
tree42d557776bcecd71c809d06359db8114610b5e4c
parenteffc42a78cb9e9ed455d1bb0310701cdb6757f5a (diff)
downloadhaskell-243e6c44e95a9462844f73f394fe6a5dc3e4145a.tar.gz
hadrian: Only copy and install libffi headers when using in-tree libffi
When passed `--use-system-libffi` then we shouldn't copy and install the headers from the system package. Instead the headers are expected to be available as a runtime dependency on the users system. Fixes #21485 #21487 (cherry picked from commit fec3e7aa72bee69ef3a3f363709377990650a5d3)
-rw-r--r--hadrian/src/Rules/Generate.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index 8f56507794..048a75dc77 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -77,13 +77,12 @@ generatedDependencies :: Expr [FilePath]
generatedDependencies = do
stage <- getStage
rtsPath <- expr (rtsBuildPath stage)
+ useSystemFfi <- expr (flag UseSystemFfi)
includes <- expr $ includesDependencies stage
libDir <- expr $ stageLibPath stage
- useSystemFfi <- expr (flag UseSystemFfi)
mconcat [ package compiler ? compilerDependencies
, package ghcPrim ? ghcPrimDependencies
- , package rts ? return (
- (if useSystemFfi then [] else fmap (rtsPath -/-) libffiHeaderFiles)
+ , package rts ? return ((if useSystemFfi then pure [] else fmap (rtsPath -/-) libffiHeaderFiles)
++ includes
++ ((libDir -/-) <$> derivedConstantsFiles))
, stage0 ? return includes ]