haskell / haskell/cabal

Spurious warning: The package has an extraneous version range for a dependency on an internal library

Open
#5,119 47 comments 18 reactions 0 assignees View on GitHub
priority: low type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

```
% cabal new-build cabal-plan:exe:cabal-plan
Resolving dependencies...
Build profile: -w ghc-8.2.2 -O1
In order, the following will be built (use -v for more details):
- cabal-plan-0.3.0.0 (lib) (first run)
- cabal-plan-0.3.0.0 (lib:topograph) (first run)
- cabal-plan-0.3.0.0 (exe:cabal-plan) (first run)
Configuring library for cabal-plan-0.3.0.0..
Configuring library 'topograph' for cabal-plan-0.3.0.0..
Preprocessing library for cabal-plan-0.3.0.0..
Building library for cabal-plan-0.3.0.0..
Preprocessing library 'topograph' for cabal-plan-0.3.0.0..
Building library 'topograph' for cabal-plan-0.3.0.0..
[1 of 1] Compiling Cabal.Plan ( src/Cabal/Plan.hs, /home/ogre/Documents/shared-haskell/cabal-plan/dist-newstyle/build/x86_64-linux/ghc-8.2.2/cabal-plan-0.3.0.0/build/Cabal/Plan.o )
[1 of 1] Compiling Topograph ( src-topograph/Topograph.hs, /home/ogre/Documents/shared-haskell/cabal-plan/dist-newstyle/build/x86_64-linux/ghc-8.2.2/cabal-plan-0.3.0.0/l/topograph/build/topograph/Topograph.o )
Configuring executable 'cabal-plan' for cabal-plan-0.3.0.0..
Warning: The package has an extraneous version range for a dependency on an
internal library: cabal-plan -any && ==0.3.0.0 && ==0.3.0.0. This version
range includes the current package but isn't needed as the current package's
library will always be used.
```

There aren't such additional version restriction:

```
executable cabal-plan
default-language: Haskell2010
other-extensions: RecordWildCards

main-is: src-exe/cabal-plan.hs
other-modules: Paths_cabal_plan

if flag(exe)
-- dependencies w/ inherited version ranges via 'cabal-plan' library
build-depends: cabal-plan
, topograph
....
```

To help bisecting:
```
ii cabal-install-head 2.1+git20180202.0.2773999-5~16.04 amd64 Command-line interface for Cabal and Hackage
```

previous `cabal-install-head` (from around 2017-01-15) didn't had this issue, IIRC.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with `cabal new-build cabal-plan:exe:cabal-plan` using the shown executable dependencies and capture the warning. Trace the dependency-resolution path that reports the internal-library version range; done means the spurious warning is no longer emitted without adding restrictions to the `.cabal` file.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.