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 and modernize nix builds to flake.nix + haskell.nix #29

Merged
merged 14 commits into from
Nov 17, 2023

Conversation

enobayram
Copy link
Contributor

@enobayram enobayram commented Jul 4, 2023

This PR updates the nix build infrastructure to use flakes and haskell.nix through our new hs-nix-infra flake and converts default.nix to be a wrapper around the new flake.nix.

Otherwise the build fails with:

[ 1 of 16] Compiling JsonRpc          ( src/JsonRpc.hs, dist/build/chainweb-mining-client/chainweb-mining-client-tmp/JsonRpc.o, dist/build/chainweb-mining-client/chainweb-mining-client-tmp/JsonRpc.dyn_o )

src/JsonRpc.hs:162:22: error:
    • Expecting one more argument to ‘A.KeyValue kv’
      Expected a constraint,
        but ‘A.KeyValue kv’ has kind ‘* -> Constraint’
    • In the type signature:
        requestProperties :: A.KeyValue kv =>
                             A.ToJSON a => T.Text -> a -> Maybe MsgId -> [kv]
    |
162 | requestProperties :: A.KeyValue kv => A.ToJSON a => T.Text -> a -> Maybe MsgId -> [kv]
    |                      ^^^^^^^^^^^^^
@enobayram
Copy link
Contributor Author

$ nix build --print-out-paths
/nix/store/wb08r3yvimd8bnj70399vskq2cmrcvz6-chainweb-mining-client-exe-chainweb-mining-client-0.5

$ nix-build
/nix/store/wb08r3yvimd8bnj70399vskq2cmrcvz6-chainweb-mining-client-exe-chainweb-mining-client-0.5

@enobayram
Copy link
Contributor Author

Note that even though the old "Build and publish application binaries" action is failing on this branch while they appear to have passed on the latest commit of master, it's not due to any of the changes happening here. I've tested the latest status of that action by pushing a commit on top of master that just touches the README, and this action is failing there too, so it's due to changes in hackage. In fact we're fixing the builds for GHC <9.2.

I've spent a little bit of time trying to fix that action completely, but it seems to be a non-trivial task to find a set of constraints that will satisfy all the GHC versions that we're currently supporting. Seems to me like the breaking changes in aeson-2 makes it tricky to satisfy old GHC versions together with new. So, even though I'd like to update our GHC version, that would start a larger discussion than I'd like to have before merging this PR since this PR is part of a group of PRs opened against multiple repos.

@enobayram enobayram merged commit bdd2c73 into master Nov 17, 2023
10 of 16 checks passed
@enobayram enobayram deleted the enis/update-to-flakes-and-haskellNix branch November 17, 2023 08:57
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