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

Support Cabal 3.0, 3.2 #312

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Support Cabal 3.0, 3.2 #312

merged 1 commit into from
Sep 23, 2024

Conversation

sgraf812
Copy link
Collaborator

Fixes #311.

@leonschoorl
Copy link

leonschoorl commented Sep 23, 2024

I was hoping this might be fixed on hackage with a revision.

But looking at the Hackage Metadata Revisions FAQ it seems you can't change the Cabal spec version outside of very specific range.

And even if you could, the resolver probably isn't smart enough to conclude it can't build any version of happy-lib and then try instead to build an older version of happy, from before happy-lib was split off.

@sgraf812
Copy link
Collaborator Author

I'm cutting a release for happy-lib-2.0.2 anyway because of #309. Furthermore, I have now deprecated versions 2.0 and 2.0.1 of happy-lib. Does that help?

@leonschoorl
Copy link

I now suspect it won't.
I'm not knowledgeable enough about cabal to be sure.

@leonschoorl
Copy link

leonschoorl commented Sep 23, 2024

I could get cabal-3.2 to build happy by removing all happy-lib: prefixes from the happy-lib.cabal file.
And making sure it starts with cabal-version: 3.0, not 3.4.

@sgraf812
Copy link
Collaborator Author

Interesting. Can you try whether the just amended PR works?

@sgraf812 sgraf812 changed the title Require Cabal 3.4 Support Cabal 3.0, 3.2 Sep 23, 2024
@leonschoorl
Copy link

You missed these two:

index 44381cb..209fac8 100644
--- a/lib/happy-lib.cabal
+++ b/lib/happy-lib.cabal
@@ -87,7 +87,7 @@ library frontend
                        Happy.Frontend.AbsSyn,
                        Happy.Frontend.Mangler,
                        Happy.Frontend.PrettyGrammar
-  build-depends:       base < 5, array, transformers, containers, mtl, happy-lib:grammar
+  build-depends:       base < 5, array, transformers, containers, mtl, grammar
   other-modules:
         Happy.Frontend.ParseMonad
         Happy.Frontend.ParseMonad.Class
@@ -107,7 +107,7 @@ library tabular
                        Happy.Tabular.Info,
                        Happy.Tabular.LALR,
                        Happy.Tabular.NameSet
-  build-depends:       base < 5, array, containers, happy-lib:grammar
+  build-depends:       base < 5, array, containers, grammar
 
 
 library backend-lalr

But if you remove them too, then it works.
The testsuite even passes.

@sgraf812
Copy link
Collaborator Author

Thanks! Will release 2.0.2 with the fix soon.

@sgraf812 sgraf812 merged commit 996980f into master Sep 23, 2024
24 of 25 checks passed
@sgraf812 sgraf812 deleted the wip/T311 branch September 23, 2024 17:03
@avdv
Copy link

avdv commented Dec 6, 2024

Hi.

Silly question: does this also work with Cabal 3.10.2.0 ? I'm asking because when trying to configure happy-lib it cannot find its libs:

$ runghc ../Setup.hs configure lib:happy-lib --package-db=clear --package-db=global --flags= 
Configuring library for happy-lib-2.0.2..
Error: Setup.hs: Encountered missing or private dependencies:
happy-lib:{backend-glr, backend-lalr, frontend, grammar, tabular}

\edit: never mind, I understand that this is to be expected when trying to configure a single component.

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

Successfully merging this pull request may close these issues.

cabal 3.2 can't build happy-lib
4 participants