Giter Club home page Giter Club logo

Comments (13)

phadej avatar phadej commented on June 16, 2024 1

@merijn which cabal-version you are using. How foo:foo is treated has changed in cabal-version: 3.4 exactly to avoid name shadowing issues.

From https://cabal.readthedocs.io/en/stable/file-format-changelog.html#cabal-version-3-4

Dependencies to sublibraries must be specified explicitly, even for current package. For example: build-depends: mypackage:internal-lib This way you can have an internal library with the same name as some external dependency.

Please provide a reproducer.

from cabal.

merijn avatar merijn commented on June 16, 2024

Originally this was cabal-version: 3.0 with cabal-install 3.10. I was just trying cabal-version: 3.4, but the linked change requiring that internal packages are fully qualified does not seem to properly work either, i.e. both using conduit or conduit:conduit as dependency still gets interpreted as a dependency on the internal library.

This is rather "in progress" code, so I will try to shrink it to a reproducer.

from cabal.

merijn avatar merijn commented on June 16, 2024

I created a reproducer here: https://github.com/merijn/cabal-repro

You can try as-is, or trying changing the conduit dependency to conduit:conduit, either will result in the same error:

Error: cabal: The package has an impossible version range for a dependency on
an internal library: conduit ^>=1.3.5. This version range does not include the
current package, and must be removed as the current package's library will
always be used.

If I understand the docs linked by phadej, only repro:conduit should ever refer to the local component in 3.4 and later.

from cabal.

merijn avatar merijn commented on June 16, 2024

This seems to imply that the 3.4 change never actually worked as intended, behaviour is identical to cabal-version 3.0, only the error has slightly changed.

from cabal.

Kleidukos avatar Kleidukos commented on June 16, 2024

I can reproduce this on the 3.6 provided by ghcup and 3.11

from cabal.

phadej avatar phadej commented on June 16, 2024

I cannot reproduce.

[polinukli] /codetmp/cabal-repro master % cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library 
[polinukli] /codetmp/cabal-repro master % cabal build --dry-run
Build profile: -w ghc-8.6.5 -O1
In order, the following would be built (use -v for more details):
 - conduit-1.3.5 (lib) (requires build)
 - repro-0.1.0 (lib) (first run)
 - repro-0.1.0 (lib:conduit) (first run)

cabal-plan prints

% cabal-plan
using '/codetmp/cabal-repro' as project root

Tree
~~~~

repro-0.1.0
 └─ base-4.12.0.0
     ├─ ghc-prim-0.5.3
     │   └─ rts-1.0
     ├─ integer-gmp-1.0.2.0
     │   └─ ghc-prim-0.5.3 ┄┄
     └─ rts-1.0 ┄┄
repro-0.1.0
 [repro-0.1.0:lib:"conduit"]
 ├─ base-4.12.0.0 ┄┄
 └─ conduit-1.3.5

as expected.

Cannot reproduce with cabal-install-3.10.1.0 either:

[polinukli] /codetmp/cabal-repro master % ~/.ghcup/bin/cabal-3.10.1.0 --version      
cabal-install version 3.10.1.0
compiled using version 3.10.1.0 of the Cabal library 
[polinukli] /codetmp/cabal-repro master % ~/.ghcup/bin/cabal-3.10.1.0 build --dry-run
Build profile: -w ghc-8.6.5 -O1
In order, the following would be built (use -v for more details):
 - conduit-1.3.5 (lib) (requires build)
 - repro-0.1.0 (lib) (first run)
 - repro-0.1.0 (lib:conduit) (first run)

from cabal.

phadej avatar phadej commented on June 16, 2024

I see. When you actually try to build the package, something in Cabal building code fails. I.e. the important bit is

cabal: Failed to build repro-0.1.0. The failure occurred during the configure
step.

cabal-install's solver and Cabal-syntax parser work correctly. It's latter stages which seem to fail, i.e. actually executing the build plan.


EDIT: compare with cabal-version: 3.0 behavior:

% cabal build --dry-run 
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: repro (user goal)
[__0] rejecting: repro-0.1.0 (conflict: repro==0.1.0, repro => repro (lib
conduit)^>=1.3.5)
[__0] fail (backjumping, conflict set: repro)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: repro

There the solving fails as name shadowing occurs.

from cabal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.