From 562eaa3ddfcd588370cb681ed2bcee5a4039579a Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Thu, 28 Jul 2016 12:05:06 -0700 Subject: [PATCH 1/2] Don't pass -package-db and -package flags to --abi-hash. Signed-off-by: Edward Z. Yang --- Cabal/Distribution/Simple/GHC.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Cabal/Distribution/Simple/GHC.hs b/Cabal/Distribution/Simple/GHC.hs index 47872918f43..4f7096770b3 100644 --- a/Cabal/Distribution/Simple/GHC.hs +++ b/Cabal/Distribution/Simple/GHC.hs @@ -1048,12 +1048,16 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do let comp = compiler lbi platform = hostPlatform lbi - vanillaArgs = + vanillaArgs0 = (componentGhcOptions verbosity lbi libBi clbi (componentBuildDir lbi clbi)) `mappend` mempty { ghcOptMode = toFlag GhcModeAbiHash, ghcOptInputModules = toNubListR $ exposedModules lib } + vanillaArgs = + -- Package DBs unnecessary, and break ghc-cabal. See #3633 + vanillaArgs0 { ghcOptPackageDBs = [] + , ghcOptPackages = mempty } sharedArgs = vanillaArgs `mappend` mempty { ghcOptDynLinkMode = toFlag GhcDynamicOnly, ghcOptFPic = toFlag True, From ec6a1dd18564a57e18b9bac6f4586efbb94b41fd Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Thu, 28 Jul 2016 13:46:56 -0700 Subject: [PATCH 2/2] Adjust to handle GHC 7.4. Signed-off-by: Edward Z. Yang --- Cabal/Distribution/Simple/GHC.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cabal/Distribution/Simple/GHC.hs b/Cabal/Distribution/Simple/GHC.hs index 4f7096770b3..3e7cd634197 100644 --- a/Cabal/Distribution/Simple/GHC.hs +++ b/Cabal/Distribution/Simple/GHC.hs @@ -1056,7 +1056,9 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do } vanillaArgs = -- Package DBs unnecessary, and break ghc-cabal. See #3633 - vanillaArgs0 { ghcOptPackageDBs = [] + -- BUT, put at least the global database so that 7.4 doesn't + -- break. + vanillaArgs0 { ghcOptPackageDBs = [GlobalPackageDB] , ghcOptPackages = mempty } sharedArgs = vanillaArgs `mappend` mempty { ghcOptDynLinkMode = toFlag GhcDynamicOnly,