From 59ff4e364dbd8973937c08066254dfdec1130810 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Mon, 21 Jan 2019 23:48:46 +0100 Subject: Fix package-envs conflicting with -package flags --- src/CabalHelper/Compiletime/Program/GHC.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/CabalHelper/Compiletime/Program/GHC.hs b/src/CabalHelper/Compiletime/Program/GHC.hs index e21a258..79dd1b3 100644 --- a/src/CabalHelper/Compiletime/Program/GHC.hs +++ b/src/CabalHelper/Compiletime/Program/GHC.hs @@ -139,13 +139,16 @@ invokeGhc GhcInvocation {..} = do , "-o", giOutput ] , map ("-optP"++) giCPPOptions - , case giPackageSource of - GPSAmbient -> [] - GPSPackageDBs dbs -> map ("-package-conf="++) $ unPackageDbDir <$> dbs + , if giHideAllPackages then ["-hide-all-packages"] else [] + , let packageFlags = concatMap (\p -> ["-package", p]) giPackages in + case giPackageSource of + GPSAmbient -> packageFlags + GPSPackageDBs dbs -> concat + [ map ("-package-conf="++) $ unPackageDbDir <$> dbs + , packageFlags + ] GPSPackageEnv env -> [ "-package-env=" ++ unPackageEnvFile env ] , map ("-i"++) $ nub $ "" : giIncludeDirs - , if giHideAllPackages then ["-hide-all-packages"] else [] - , concatMap (\p -> ["-package", p]) giPackages , giWarningFlags , ["--make"] , giInputs -- cgit v1.2.3