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

Allow building with GHC 9.6 #52

Merged
merged 3 commits into from
Dec 8, 2023
Merged

Allow building with GHC 9.6 #52

merged 3 commits into from
Dec 8, 2023

Conversation

enobayram
Copy link
Contributor

This PR allows us to compile chainweb-api with the latest GHC versions while maintaining the build with the old package set, which is still needed by obelisk projects, like block-explorer.

In order to maintain the build with the old dependency tree alongside the latest packages from hackage, we had to tiptoe around the following breaking changes:

  • aeson doesn't represent its Objects as HashMaps anymore, so this PR rewrites JSON parsing code to not depend on that representation.
  • aeson now hides the Text representation of its object Keys, so we're now going from Text to String and then coming back with fromString, which lets the result work with both representations.
  • base16-bytestring changed the type of its decode function from decode :: ByteString -> (ByteString, ByteString) to ByteString -> Either String ByteString, which we had to work around by resorting to CPP.

While maintaining the build with the old package set, which is
still needed by obelisk projects, like block-explorer
@enobayram enobayram self-assigned this Dec 5, 2023
@enobayram
Copy link
Contributor Author

I've pinned the chainweb-api to this PR's version in these downstream PRs and their builds are passing:
kadena-io/block-explorer#85 (GHC/GHCJS 8.6.5)
kadena-io/chainweb-data#172 (GHC 9.2.8)

Copy link
Contributor

@emmanueldenloye emmanueldenloye left a comment

Choose a reason for hiding this comment

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

LGTM

@enobayram enobayram merged commit 8d66b53 into master Dec 8, 2023
6 checks passed
@enobayram enobayram deleted the enis/compile-with-ghc-9.6 branch December 8, 2023 20:49
enobayram added a commit that referenced this pull request Dec 18, 2023
This PR fixes a regression introduced by #52. The rewrite of the `FromJSON` instance in that PR changed the behavior when the `exec` field doesn't exist.
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.

2 participants