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

Fix ghc version CPP #123

Merged
merged 1 commit into from
Jul 17, 2023
Merged

Fix ghc version CPP #123

merged 1 commit into from
Jul 17, 2023

Conversation

newhoggy
Copy link
Collaborator

@newhoggy newhoggy commented Jul 17, 2023

Changelog

- description: |
    Fix ghc version CPP
  compatibility: compatible
  type: bugfix

Context

This is necessary to compile cardano-cli with ghc-9.2.x.

Moreover, __GLASGOW_HASKELL__ seemed to be working unreliably for me, so it has been switched to use MIN_VERSION_base instead.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • The change log section in the PR description has been filled in
  • New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • roundtrip tests
  • The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-8.10.7 and ghc-9.2.7
  • The changelog section in the PR is updated to describe the change
  • Self-reviewed the diff

Note on CI

If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.

@newhoggy newhoggy marked this pull request as ready for review July 17, 2023 11:37
Copy link
Contributor

@erikd erikd left a comment

Choose a reason for hiding this comment

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

Sorry, why is this needed?

I checked that this compiled with ghc-9.2.8.

In fact I just compiled HEAD with ghc-8.10,7, ghc-9.2.8 and ghc-9.6.2.

@newhoggy newhoggy force-pushed the newhoggy/fix-ghc-version-cpp branch 2 times, most recently from fb482b2 to ba020ab Compare July 17, 2023 13:02
@newhoggy newhoggy force-pushed the newhoggy/fix-ghc-version-cpp branch from ba020ab to 0eecaa8 Compare July 17, 2023 13:06
@newhoggy
Copy link
Collaborator Author

newhoggy commented Jul 17, 2023

Sorry, why is this needed?

I checked that this compiled with ghc-9.2.8.

In fact I just compiled HEAD with ghc-8.10,7, ghc-9.2.8 and ghc-9.6.2.

cardano-api was compiling okay for me also.

Compiling on those three compilers was not the problem. (I was, however, for some strange reason, I was getting a redundant pattern match warning.)

The actual problem was that when I came to try to compile cardano-cli against it, the additional constraints were not needed for cardano-cli when compiling on ghc-8.2.x and it was causing problems for me, so I've removed them for that version.

This is the failing job that shows cardano-cli stopped compiling on ghc-8.2.8: https://github.com/input-output-hk/fusion-flamingo/actions/runs/5573992848

I've also broken up the constraints so that the CPP only wraps around those constaints that differ so we don't have to repeat them for both CPP cases.

@newhoggy newhoggy requested a review from erikd July 17, 2023 13:21
@newhoggy newhoggy enabled auto-merge July 17, 2023 13:25
@newhoggy newhoggy added this pull request to the merge queue Jul 17, 2023
@newhoggy
Copy link
Collaborator Author

For reference:

ghc   8.10.1   base-4.14.0.0
ghc   8.10.2   base-4.14.1.0
ghc   8.10.3   base-4.14.1.0
ghc   8.10.4   base-4.14.1.0
ghc   8.10.5   base-4.14.2.0
ghc   8.10.6   base-4.14.3.0
ghc   8.10.7   base-4.14.3.0
ghc   9.0.1    base-4.15.0.0
ghc   9.0.2    base-4.15.1.0
ghc   9.2.1    base-4.16.0.0
ghc   9.2.2    base-4.16.1.0
ghc   9.2.3    base-4.16.2.0
ghc   9.2.4    base-4.16.3.0
ghc   9.2.5    base-4.16.4.0
ghc   9.2.6    base-4.16.4.0
ghc   9.2.7    base-4.16.4.0
ghc   9.2.8    base-4.16.4.0
ghc   9.4.1    base-4.17.0.0
ghc   9.4.2    base-4.17.0.0
ghc   9.4.3    base-4.17.0.0
ghc   9.4.4    base-4.17.0.0
ghc   9.4.5    base-4.17.1.0
ghc   9.6.1    base-4.18.0.0

Merged via the queue into main with commit 68f20a6 Jul 17, 2023
@newhoggy newhoggy deleted the newhoggy/fix-ghc-version-cpp branch July 17, 2023 13:40
newhoggy added a commit that referenced this pull request Mar 11, 2024
…able-latest

Temporarily disable `latest` era default logic
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