Skip to content

cannot build with ghc-9.12.2 (Variable not in scope: hasLEUpperBound) #10916

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

Closed
jwaldmann opened this issue Apr 8, 2025 · 9 comments · Fixed by #10917
Closed

cannot build with ghc-9.12.2 (Variable not in scope: hasLEUpperBound) #10916

jwaldmann opened this issue Apr 8, 2025 · 9 comments · Fixed by #10917
Labels
re: dependencies Concerning Cabal's dependencies release type: bug

Comments

@jwaldmann
Copy link

$ cabal install cabal-install-3.14.2.0

...

[134 of 151] Compiling Distribution.PackageDescription.Check.Target ( src/Distribution/PackageDescription/Check/Target.hs, dist/build/Distribution/PackageDescription/Check/Target.o, dist/build/Distribution/PackageDescription/Check/Target.dyn_o )
src/Distribution/PackageDescription/Check/Target.hs:351:45: error: [GHC-88464]
    Variable not in scope: hasLEUpperBound :: VersionRange -> Bool
    Suggested fix:
      Perhaps use one of these:
        ‘hasUpperBound’ (imported from Distribution.Version),
        data constructor ‘LEUpperBounds’ (imported from Distribution.PackageDescription.Check.Monad),
        ‘hasLowerBound’ (imported from Distribution.Version)
    |
351 |     (checkPVPs (checkDependencyVersionRange hasLEUpperBound) leuck ds)
    |                                             ^^^^^^^^^^^^^^^

src/Distribution/PackageDescription/Check/Target.hs:354:45: error: [GHC-88464]
    Variable not in scope:
      hasTrailingZeroUpperBound :: VersionRange -> Bool
    Suggested fix:
      Perhaps use data constructor ‘TrailingZeroUpperBounds’ (imported from Distribution.PackageDescription.Check.Monad)
    |
354 |     (checkPVPs (checkDependencyVersionRange hasTrailingZeroUpperBound) tzuck ds)
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^

src/Distribution/PackageDescription/Check/Target.hs:357:45: error: [GHC-88464]
    Variable not in scope: hasGTLowerBound :: VersionRange -> Bool
    Suggested fix:
      Perhaps use one of these:
        ‘hasLowerBound’ (imported from Distribution.Version),
        data constructor ‘GTLowerBounds’ (imported from Distribution.PackageDescription.Check.Monad)
    |
357 |     (checkPVPs (checkDependencyVersionRange hasGTLowerBound) gtlck ds)
    |                                             ^^^^^^^^^^^^^^^

with

$ cabal --version
cabal-install version 3.14.1.1
compiled using version 3.14.1.0 of the Cabal library 
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.12.2
$ uname -a
Linux ...... 6.14.0-63.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Mar 24 19:53:37 UTC 2025 x86_64 GNU/Linux

Build seems to work fine with

cabal install cabal-install -w /opt/ghc/ghc-9.10.1/bin/ghc
@jwaldmann
Copy link
Author

perhaps

$ /opt/ghc/ghc-9.10.1/bin/ghc-pkg list | head -3
/opt/ghc/ghc-9.10.1/lib/ghc-9.10.1/lib/package.conf.d
    Cabal-3.12.0.0
    Cabal-syntax-3.12.0.0

$ /opt/ghc/ghc-9.12.2/bin/ghc-pkg list | head -3
/opt/ghc/ghc-9.12.2/lib/ghc-9.12.2/lib/package.conf.d
    Cabal-3.14.1.0
    Cabal-syntax-3.14.1.0

but then why can I build with 9.10.1?

@geekosaur
Copy link
Collaborator

Note that it's using Cabal 3.12, which is too old for cabal-install 3.14, so it installs Cabal from Hackage instead.

What I don't understand is that, in order to avoid a different incompatibility, we bumped the dependency in cabal-install-3.14.2.0 to require Cabal 3.14.2.0 or later, so the same thing (install from Hackage) should be happening here.

@jwaldmann
Copy link
Author

jwaldmann commented Apr 9, 2025

Well, Cabal-3.14.2.0.cabal:

library
...
  build-depends:
    Cabal-syntax ^>= 3.14,

(not enforcing >= 3.14.2)

@geekosaur
Copy link
Collaborator

@Mikolaj opined that the symbols were from Cabal instead of Cabal-syntax on Matrix; if they're from Cabal-syntax then we'll have to hotfix a verbump on that.

@geekosaur
Copy link
Collaborator

(I think Artem and I are the only ones around this time of night.)

@ulysses4ever
Copy link
Collaborator

@jwaldmann, thanks a lot for the swift discovery and report. We overlooked one lower bound bump: Cabal should have Cabal-syntax >= 3.14.2. Sadly, I can't do a revision now because Hackage is under maintenance. We'll fix it when it's done, but in the meantime, you can use the --constraint="Cabal-syntax >= 3.14.2" option.

@ulysses4ever ulysses4ever added release re: dependencies Concerning Cabal's dependencies and removed needs triage labels Apr 9, 2025
@ulysses4ever
Copy link
Collaborator

Revision is up, so please check it now.

@jwaldmann
Copy link
Author

yes it's looking fine: cabal install cabal-install does pull in Cabal-syntax-3.14.2.0 now.

@ulysses4ever ulysses4ever linked a pull request Apr 9, 2025 that will close this issue
2 tasks
@ulysses4ever
Copy link
Collaborator

Let's close then. Thanks again for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
re: dependencies Concerning Cabal's dependencies release type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants