haskell / haskell/cabal

Cannot reference internal libraries with cabal-version: 3.4

Open
#7,565 7 comments 1 reaction 0 assignees View on GitHub
attention: pr-welcome documentation re: internal library type: user-question
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**

When using `cabal-version: 3.4` it seems like I cannot directly reference internal libraries anymore. I can only use the experimental `package:internal-lib` notation.

**To Reproduce**
Steps to reproduce the behavior:

1. Make a cabal file with these contents:

```cabal
cabal-version: 3.4
name: my-lib
version: 0.1.0.0

library my-lib-internal

library
build-depends: my-lib-internal
```
2. `cabal v2-build`

```
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: my-lib-0.1.0.0 (user goal)
[__1] unknown package: my-lib-internal (dependency of my-lib)
[__1] fail (backjumping, conflict set: my-lib, my-lib-internal)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: my-lib, my-lib-internal
```

**Expected behavior**

A successful build like if I use `cabal-version: 3.0` or as if I use the experimental `my-lib:my-lib-internal` notation in the `build-depends` field.

**System information**
- Operating system: NixOS 21.05
- `cabal`, `ghc` versions

```
cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library
```

```
The Glorious Glasgow Haskell Compilation System, version 8.10.4
```

**Additional context**

From this stackoverflow question: https://stackoverflow.com/q/68880126/15207568

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.