Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cabal tries to build package with incompatible dependencies #6166

Closed
chshersh opened this issue Jul 29, 2019 · 3 comments
Closed

cabal tries to build package with incompatible dependencies #6166

chshersh opened this issue Jul 29, 2019 · 3 comments

Comments

@chshersh
Copy link
Member

chshersh commented Jul 29, 2019

Describe the bug

Sometimes bulds on CI fail for a very strange reason even locally everything passes. Cabal tries to find plan and uses incompatible versions of libraries. Here is the error when trying to build htoml-megaparsec dependency for tomland library:

Failed to build htoml-megaparsec-2.1.0.3.
Build log (
/home/travis/.cabal/logs/ghc-8.6.5/htoml-megaparsec-2.1.0.3-4b4579106a015b896d103c21db8f2fac3f5d24b1ecbd2f4464c4ae7e70f1d197.log
):
Configuring library for htoml-megaparsec-2.1.0.3..
Warning: The package has an extraneous version range for a dependency on an
internal library: htoml-megaparsec -any && ==2.1.0.3, htoml-megaparsec -any &&
==2.1.0.3. This version range includes the current package but isn't needed as
the current package's library will always be used.
Warning:
    This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
      package htoml-megaparsec (htoml-megaparsec-2.1.0.3-a43bf81dd4ed16baa7df86402245273a070e296a75935859cc970333decde7c9) requires megaparsec-7.0.5-54d1bdf0ee32051801b7c529a69a41a0acc67473704149889aef5337a11842d2
      package htoml-megaparsec (htoml-megaparsec-2.1.0.3) requires megaparsec-7.0.5-9a3f6cbc12071475f205b18cb99b964689c854f3fb71eaf81d216338d2693951
      package megaparsec (megaparsec-7.0.5-54d1bdf0ee32051801b7c529a69a41a0acc67473704149889aef5337a11842d2) requires parser-combinators-1.1.0-4a323801805b1b1e8dc52a5c2286803ad99ec50727aae4428d88e6488abdd583
      package megaparsec (megaparsec-7.0.5-9a3f6cbc12071475f205b18cb99b964689c854f3fb71eaf81d216338d2693951) requires parser-combinators-1.2.0-81eabffcf72fb987500cc5956d9da1d7de5f06d979d7ea0c2614ddbf9c0421ec
Preprocessing library for htoml-megaparsec-2.1.0.3..
Building library for htoml-megaparsec-2.1.0.3..
[1 of 1] Compiling Text.Toml        ( src/Text/Toml.hs, dist/build/Text/Toml.o )

src/Text/Toml.hs:22:16: error:
    • Couldn't match type ‘ParseErrorBundle Text e0’
                     with ‘megaparsec-7.0.5:Text.Megaparsec.Error.ParseErrorBundle
                             Text Data.Void.Void’

You can find the full log here:

To Reproduce

Cannot reproduce locally. Locally everything works for me.

Expected behavior

Successful builds.

Additional context

Using cabal-3.0 on Travis CI.

@phadej
Copy link
Collaborator

phadej commented Jul 30, 2019

The log says

$ cabal --version
cabal-install version 3.0.0.0

have you tried with cabal-install-3.0 locally?

@chshersh
Copy link
Member Author

@phadej My mistake. Fixed the cabal version in description. Yeah, it works locally with both cabal-2.4 and cabal-3.0.

@Mikolaj
Copy link
Member

Mikolaj commented May 8, 2021

Thank you for reporting. I think this is fixed in cabal 3.4. Please let us know if you can repro this with 3.4 or newer cabals. In any case, closing as a duplicate of #5782.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants