Skip to content

Commit 79e6134

Browse files
committed
Fix Ambiguous module name Distribution.PackageDescription
Using Stack 2.9.1 to build a package with a dependency on `Cabal` and `process` and: ~~~yaml resolver: lts-19.25 # GHC 9.0.2 (comes with Cabal-3.4.1.0) extra-deps: - Cabal-3.8.1.0 - Cabal-syntax-3.8.1.0 - process-1.6.15.0 ~~~ yields error: ~~~ process > configure process > [1 of 2] Compiling Main ( C:\Users\mikep\AppData\Local\Temp\stack-d0efe7ccadb373e9\process-1.6.15.0\Setup.hs, C:\Users\mikep\AppData\Local\Temp\stack-d0efe7ccadb373e9\process-1.6.15.0\.stack-work\dist\d53b6a14\setup\Main.o ) process > [2 of 2] Compiling StackSetupShim ( C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs, C:\Users\mikep\AppData\Local\Temp\stack-d0efe7ccadb373e9\process-1.6.15.0\.stack-work\dist\d53b6a14\setup\StackSetupShim.o ) process > process > C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs:3:1: error: process > Ambiguous module name ‘Distribution.PackageDescription’: process > it was found in multiple packages: process > Cabal-3.4.1.0 Cabal-syntax-3.8.1.0 process > | process > 3 | import Distribution.PackageDescription (PackageDescription, emptyHookedBuildInfo) process > | ~~~ This is because `StackSetupShim` is compiled with (a) the version of `Cabal` that comes with GHC 9.0.2 and (b) the package database that includes `Cabal-syntax-3.8.1.0`, and both export modules named `Distribution.PackageDescription`. This pull request fixes that problem by specifying that the import of `Distribution.PackageDescription` is to come from the `Cabal` package.
1 parent a9b498d commit 79e6134

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/setup-shim/StackSetupShim.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
{-# LANGUAGE PackageImports #-}
12
module StackSetupShim where
23
import Main
3-
import Distribution.PackageDescription (PackageDescription, emptyHookedBuildInfo)
4+
import "Cabal" Distribution.PackageDescription (PackageDescription, emptyHookedBuildInfo)
45
import Distribution.Simple
56
import Distribution.Simple.Build
67
import Distribution.Simple.Setup (ReplFlags, fromFlag, replDistPref, replVerbosity)

0 commit comments

Comments
 (0)