asterius
asterius copied to clipboard
Add official support for building and using with cabal instead of stack
Is your feature request related to a problem? Please describe.
In the early days of this project, we chose stack as the official build system mainly because it's capable of managing sandboxed GHC installations, and it can install the bindists of our GHC fork with a single command. There are downsides though:
- A
stack-based build system is harder to migrate tobazelornix, compared tocabal. The IOHK fork needs to set up a propercabalproject for the tree first. - When it comes to profiling,
stackmakes things harder to get right (e.g.-fno-prof-autodoesn't seem to work properly).
We can still live with stack from now on, but having official cabal build support can be handy at times, and it seems to be helpful with the ongoing bazel/nix efforts too.
Describe the solution you'd like
- [ ] Check in the generated
.cabalfiles and the cabal freeze file for the stackage snapshot we're using. - [ ] Set up the
cabalproject file. - [ ] Test
cabalbuild support. We need to be cautious whetherahc-cabalwill pollute the host~/.cabal; if so, we need to find a way to isolate host/wasmcabalartifacts - [ ] Move to
cabal-based building for thebase/stackageprebuilt images.
This would be super nice, especially paired with GHC 8.10 support!
To be honest, as argued in detail in #617, neither Stack nor Cabal are appropriate for a project of this complexity. We are currently abusing Setup.hs scripts in ways that make build and execution very brittle, and destroy any ability to remote cache.