kadena-io / chainweb-mining-client

A mining client for Kadena
BSD 3-Clause "New" or "Revised" License
43 stars 11 forks source link

Fix and modernize nix builds to flake.nix + haskell.nix #29

Closed enobayram closed 1 year ago

enobayram commented 1 year ago

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.

enobayram commented 1 year ago
$ 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 commented 1 year ago

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.