Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
debug-ito opened this issue Nov 1, 2024 · 5 comments

Comments

@debug-ito
Copy link
Contributor

debug-ito commented Nov 1, 2024

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

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?

@effectfully
Copy link

I'm running into the same problem with the same cabal version (3.12.1.0) and GHC-9.6.6. Ubuntu 20.04.

@ulysses4ever
Copy link
Collaborator

Thanks for the report and independent reproduction!

Could you check if cabal-3.10 suffers the same?

@debug-ito
Copy link
Contributor Author

I tried cabal-install-3.10.1.0 and cabal-install-3.10.3.0 with ghc-9.2.1, but had the same error.

@harryaskham
Copy link

I was seeing this same issue the last few weeks, but only on my aarch64-linux NixOS machines (a VPS and a nix-on-droid install). A number of similarly configured x86 machines are fine on the same versions of GHC / Cabal / surrounding machinery (the config is identical from machine to machine, only nixpkgs itself changes).

GHC 9.8.1
Cabal 3.12.1.0
nixpkgs following unstable

I figured it out in my case while typing this: I had the following in my cabal.project which was needed I believe in order to use Cabal 3.12 when it was in prerelease:

-- For Cabal 3.12 prerelease
allow-newer:
  *:Cabal,
  *:Cabal-syntax

I'd added this to most of my projects so I could use multi-repl as soon as it dropped. Removing this on cabal 3.12.1.0 fixed things for me.

@debug-ito
Copy link
Contributor Author

Thanks for valuable input. I think allow-newer was part of the cause.

When I got the error, my cabal.project had allow-newer: all to try testing with some new packages. I updated the original description so that the "To reproduce" section referred to the right commit that had allow-newer: all.

When I removed the allow-newer: all from cabal.project, cabal freeze succeeded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants