Skip to content

Enable builds on both GHC 9.2 and GHC 9.4#427

Merged
jeicher merged 7 commits intomasterfrom
compat-9.4
Aug 31, 2022
Merged

Enable builds on both GHC 9.2 and GHC 9.4#427
jeicher merged 7 commits intomasterfrom
compat-9.4

Conversation

@matthew-healy
Copy link
Copy Markdown

@matthew-healy matthew-healy commented Aug 26, 2022

This PR allows linear-base to be built with both GHC 9.2 and 9.4. There were two main changes which had to be accounted for: firstly that the ~type equality operator is now a "regular" type operator, exported from Data.Type.Equality, and secondly that GHC.Generic now exports Generically and Generically1.

Both of these issues were fixed in a similar way: we defined source directories ghc92 and ghc94 which are included in the build based on the current GHC version. This allows us to, for example, define Generically in GHC 9.2 builds but re-export it when building with 9.4.

One caveat with this approach is that we also had to move the entry point to Generics.Linear into one of these shim modules, as it re-exports GHC.Generic, which meant that we were getting unused import warnings in places that imported both Generics.Linear and Prelude.Linear.Internal. This seems like a reasonable cost to pay, especially since it can be removed when support for GHC 9.2 is dropped.

@matthew-healy matthew-healy force-pushed the compat-9.4 branch 4 times, most recently from ac0e520 to abeed16 Compare August 26, 2022 14:03
@aspiwack
Copy link
Copy Markdown
Member

As a note: let's make sure that we enable GHC 9.4 in the nix-shell for the cabal-based CI. To test both versions.

@matthew-healy matthew-healy changed the base branch from master to compat-9.4-update-nix-shell August 29, 2022 09:50
@matthew-healy matthew-healy marked this pull request as ready for review August 29, 2022 12:42
@aspiwack
Copy link
Copy Markdown
Member

warning This PR is based off of the branch compat-9.4-update-nix-shell which makes it possible to try to compile linear-base with GHC 9.4. That PR should ideally be merged first.

It's not tremendously important, but just so you kno, we have dpulls installed in the org, so you can use this to mark dependencies instead of managing them manually.

@jeicher
Copy link
Copy Markdown
Contributor

jeicher commented Aug 30, 2022

Depends on #429

Base automatically changed from compat-9.4-update-nix-shell to master August 30, 2022 07:49
Copy link
Copy Markdown
Member

@aspiwack aspiwack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor comments from me before we merge.

@jeicher
Copy link
Copy Markdown
Contributor

jeicher commented Aug 31, 2022

I now get a build error with cabal build --allow-newer because cabal: Failed to build tasty-hedgehog-1.3.0.0 (which is required by test. This is not caught by CI because it does cabal build --allow-newer --disable-tests.

Limiting cabal to --allow-newer=template-haskell does build successfully.

Copy link
Copy Markdown
Member

@aspiwack aspiwack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the --allow-newer issue, I'm ok with tests not working (though I wonder why this particular failure is happening). But you can also use the fixed version in the workflow.

I'm indifferent to the solution. Merge when you have chosen.

@jeicher jeicher merged commit 6869779 into master Aug 31, 2022
@jeicher jeicher deleted the compat-9.4 branch August 31, 2022 10:45
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.

3 participants