You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building with a GHC version that ships with an older verison of bytestring, e.g. GHC 8.0.2 or 7.10.3, you get an install-plan that triggers the warning:
$ rm -rf dist-newstyle/; cnb -w ghc-8.0.2 -j1
Resolving dependencies...
Build profile: -w ghc-8.0.2 -O1
In order, the following will be built (use -v for more details):
- bug-0 (lib) (first run)
Configuring library for bug-0..
Warning:
This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
package unix (unix-2.7.2.1) requires bytestring-0.10.8.1
package bug (bug-0) requires bytestring-0.10.8.2-68d107c33f90edfa54bc6fcd2019a8a688f3a6194a9237130242d6c2fc06e65f
Preprocessing library for bug-0..
Building library for bug-0..
If we dump the install-plan in plan.json, we get the following structure:
which shows that lib:bug does indeed appear to link two different versions of bytestring!
Another rather critical thing to point out here is that even despite build-depends: hspec-discover == 2.5.2, lib:bug ends up depending on lib:hspec-discover-2.5.1!
I'm traveling now, so I probably won't have time to debug this further for a few weeks, though I spent a little time looking into it earlier. I reproduced the warning with GHC 8.0.2. The solver log looked correct: cabal chose hspec-discover-2.5.2 and bytestring-0.10.8.2 for the build-depends dependencies and chose hspec-discover-2.5.1 and the installed bytestring for the dependencies of the hspec-discover executable. I also printed the install plan returned from the solver, and it seemed correct. My guess is that the hspec-discover build-depends dependency is replaced by the build-tool-depends dependency somewhere after the solver, though I'm not sure where new-build modifies the plan. This is a strange bug!
haskell#5409).
new-build had assumed that each component could only directly depend on one
version of each package. However, a component can depend on two different
versions of a package by listing it as a build-depends and build-tool-depends
dependency. The incorrect assumption caused new-build to mix up the two
instances of the dependency when converting the solver's package-based install
plan (SolverInstallPlan) to the component-based install plan
(ElaboratedInstallPlan). This commit fixes the bug by keeping build-depends and
build-tool-depends dependencies separate between reading them from the
SolverPackage and passing them to
D.Backpack.ConfiguredComponent.toConfiguredComponent.
This commit changes the signature of
D.Backpack.ConfiguredComponent.toConfiguredComponent to allow distinguishing
between the two types of dependencies.
The following minimal
.cabal
file exposes the isssue:When building with a GHC version that ships with an older verison of
bytestring
, e.g. GHC 8.0.2 or 7.10.3, you get an install-plan that triggers the warning:If we dump the install-plan in
plan.json
, we get the following structure:which shows that
lib:bug
does indeed appear to link two different versions ofbytestring
!Another rather critical thing to point out here is that even despite
build-depends: hspec-discover == 2.5.2
,lib:bug
ends up depending onlib:hspec-discover-2.5.1
!/cc @grayjay
The text was updated successfully, but these errors were encountered: