aboutsummaryrefslogtreecommitdiff
path: root/lib/Distribution
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-08-06 02:06:54 +0200
committerDaniel Gröber (dxld) <dxld@darkboxed.org>2019-09-17 17:48:26 +0200
commit29c13da426a9009754f5d32351a9f54bccf3cbb5 (patch)
tree44e578b0dec3b06b8b455f41075bb82e1fdfd37b /lib/Distribution
parentc70e8076803bd29d7675ed493ebb1ca246891b34 (diff)
Remove crusty old helper code
- Inplace component inlining really always was a nasty cludge, now that we have proper build-system support we can get rid of it. - GHC options subsets aren't really needed, we can split these up after parsing the options using the ghc library. - Dropped GHC 7.10, it seems unsupportable without the inplace component inlining, possibly a Stack/lib:Cabal bug, but it is quite old so time for it to go anyway. This is the second thing commit it was holing up too!
Diffstat (limited to 'lib/Distribution')
-rw-r--r--lib/Distribution/Helper.hs23
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs
index 98afbd3..89ce6f9 100644
--- a/lib/Distribution/Helper.hs
+++ b/lib/Distribution/Helper.hs
@@ -86,7 +86,6 @@ module Distribution.Helper (
, ChModuleName(..)
, ChPkgDb(..)
, ChEntrypoint(..)
- , NeedsBuildOutput(..)
-- * General information
, Distribution.Helper.buildPlatform
@@ -499,17 +498,15 @@ readUnitInfo :: Helper pt -> Unit pt -> IO UnitInfo
readUnitInfo helper unit@Unit {uUnitId=uiUnitId} = do
res <- runHelper helper unit
[ "package-id"
- , "package-db-stack"
- , "flags"
, "compiler-id"
+ , "flags"
, "config-flags"
, "non-default-config-flags"
, "component-info"
]
let [ Just (ChResponseVersion uiPackageId),
- Just (ChResponsePkgDbs uiPackageDbStack),
- Just (ChResponseFlags uiPackageFlags),
Just (ChResponseVersion uiCompilerId),
+ Just (ChResponseFlags uiPackageFlags),
Just (ChResponseFlags uiConfigFlags),
Just (ChResponseFlags uiNonDefaultConfigFlags),
Just (ChResponseComponentsInfo uiComponents)
@@ -653,12 +650,13 @@ newtype Helper pt
= Helper { runHelper :: Unit pt -> [String] -> IO [Maybe ChResponse] }
getHelper :: ProjInfo pt -> QueryEnvI c pt -> IO (Helper pt)
-getHelper ProjInfo{piCabalVersion} QueryEnv{..}
+getHelper ProjInfo{piCabalVersion} qe@QueryEnv{..}
| piCabalVersion == bultinCabalVersion = return $ Helper $
\Unit{ uCabalFile=CabalFile cabal_file
, uDistDir=DistDirLib distdir
} args ->
- helper_main $ cabal_file : distdir : args
+ let pt = dispHelperProjectType (projTypeOfQueryEnv qe) in
+ helper_main $ cabal_file : distdir : pt : args
getHelper proj_info qe@QueryEnv{..} = do
withVerbosity $ withProgs (piImpl proj_info) qe $ do
t0 <- Clock.getTime Monotonic
@@ -671,8 +669,17 @@ getHelper proj_info qe@QueryEnv{..} = do
Left rv ->
panicIO $ "compileHelper': compiling helper failed! exit code "++ show rv
Right exe ->
+ let pt = dispHelperProjectType (projTypeOfQueryEnv qe) in
return $ Helper $ \Unit{uCabalFile, uDistDir} args ->
- readHelper qe exe uCabalFile uDistDir args
+ readHelper qe exe uCabalFile uDistDir (pt : args)
+
+dispHelperProjectType :: SProjType pt -> String
+dispHelperProjectType (SCabal SCV1) = "v1"
+-- ^ v1-build needs a last minute addition of the inplace package-db
+-- beyond what lbi has
+dispHelperProjectType (SCabal SCV2) = "v2"
+dispHelperProjectType SStack = "v2"
+-- ^ stack also embeds all necessary options into lbi like v2
mkCompHelperEnv
:: Verbose