Comments (13)
@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.
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.
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.
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.
I can reproduce this on the 3.6 provided by ghcup and 3.11
from cabal.
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.
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)
- Quickstart guide refers to `v2-` commands HOT 6
- RFC: Nix backend HOT 14
- Please document how conflicting configuration options resolve in cabal.project
- Add an issue template for a feature request HOT 1
- Make readFields report if brace syntax is used. HOT 10
- VersionRange abstract, role of VersionRangeF? HOT 5
- testsuite failure for MultiRepl on Windows & GHC 9.4.4
- Deprecate `new-` prefix HOT 20
- RFC: Applying HLint's HOT 17
- Remote packages always downloaded HOT 5
- Skip "HEAD is now at HASH" messages HOT 2
- Feature request: Add `--with-repl` option HOT 6
- Add Weeder HOT 2
- use `--ignore-project` to install an unpacked package
- Package in cabal.project not found among others HOT 6
- Source versions of ghci and ghc-boot should also be removed.
- Local no-index repositories cache leads to bad UX HOT 1
- Consider implementing a "remote cache" in the style of Bazel HOT 4
- Can a project toggle test components? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cabal.