haskell / haskell/cabal

`cabal freeze` fails with some GHC versions due to missing `Distribution.Compat.Typeable`

Open
#10,500 5 comments 0 reactions 0 assignees View on GitHub
cabal-install: cmd/freeze type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I used cabal-install-3.12.1.0, and found a problem in `cabal freeze`.

# To reproduce

- Install `ghc-9.2.1` and `cabal-install-3.12.1.0` by ghcup.
- Clone https://github.com/debug-ito/greskell.git and checkout cba2d6c9dddbf24adf9901dd9b6b0d48356df70c (EDITED: checking out this specific commit is necessary, because it contains cabal.project with `allow-newer: all`)
- Run `cabal freeze`.

Then I got the following error.

```
Error:
Problem with module re-exports:
- The module 'Distribution.Compat.Typeable'
is not exported by any suitable package.
It occurs in neither the 'exposed-modules' of this package,
nor any of its 'build-depends' dependencies.
In the stanza 'library'
In the package 'Cabal-3.12.1.0'
```

It looked like cabal tried to evaluate metadata of Cabal-3.12.1.0 with Cabal-syntax-3.14.0.0 in mind, and complained that `Distribution.Compat.Typeable` was missing.

See also: [One of my GitHub CI runs](https://github.com/debug-ito/greskell/actions/runs/11606902134)

# System information

I used Xubuntu Linux 22.04 64-bit.

# Affected GHC versions

According to my experiments, the following GHC versions had this bug.

- 9.2.1
- 9.6.1
- 9.8.1

The following GHC versions didn't have this bug.

- 9.4.1
- 9.10.1

# Struggle

I tried running `cabal freeze -c 'Cabal==3.12.0.0' -c 'Cabal-syntax==3.12.0.0'` with ghc-9.2.1, but it had the same issue.
I also tried writing the equivalent `constraints` stanza in `cabal.project.local` or `cabal.project.freeze`, but it had the same issue.

Any ideas? Is there any way to run `cabal freeze` with ghc-9.2.1?

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.