From 22d443e5a2f3461a84d45db3cf0c5ae560b8314d Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Tue, 31 Oct 2023 16:34:34 +0800 Subject: [PATCH 1/2] Revert #3639 (Don't pass -package-db and -package flags to --abi-hash) With ghc>=9.6 `ghc --abi-hash` initialises the plugins so it will fail if a cabal file specifies `ghc-options: -fplugin=Foo`. Closes: #9375 --- Cabal/src/Distribution/Simple/GHCJS.hs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Cabal/src/Distribution/Simple/GHCJS.hs b/Cabal/src/Distribution/Simple/GHCJS.hs index 58194f5ffa3..5ed2d9327e9 100644 --- a/Cabal/src/Distribution/Simple/GHCJS.hs +++ b/Cabal/src/Distribution/Simple/GHCJS.hs @@ -1739,20 +1739,12 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do libBi = libBuildInfo lib comp = compiler lbi platform = hostPlatform lbi - vanillaArgs0 = + vanillaArgs = (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 - -- BUT, put at least the global database so that 7.4 doesn't - -- break. - vanillaArgs0 - { ghcOptPackageDBs = [GlobalPackageDB] - , ghcOptPackages = mempty - } sharedArgs = vanillaArgs `mappend` mempty From c362ba50b1722ab0a521782fe0f4fecc21b85c84 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Wed, 1 Nov 2023 16:03:11 +1300 Subject: [PATCH 2/2] Also revert in GHC.hs --- Cabal/src/Distribution/Simple/GHC.hs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Cabal/src/Distribution/Simple/GHC.hs b/Cabal/src/Distribution/Simple/GHC.hs index 3c380a41a86..f218d7c117a 100644 --- a/Cabal/src/Distribution/Simple/GHC.hs +++ b/Cabal/src/Distribution/Simple/GHC.hs @@ -2052,20 +2052,12 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do libBi = libBuildInfo lib comp = compiler lbi platform = hostPlatform lbi - vanillaArgs0 = + vanillaArgs = (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 - -- BUT, put at least the global database so that 7.4 doesn't - -- break. - vanillaArgs0 - { ghcOptPackageDBs = [GlobalPackageDB] - , ghcOptPackages = mempty - } sharedArgs = vanillaArgs `mappend` mempty