Skip to content

Conversation

smatting
Copy link
Contributor

@smatting smatting commented Oct 12, 2021

This PR should enable us to try using cabal instead of stack locally.

This PR:

  • adds nix files that provide the stack2cabal tool
  • instructions how to convert the stack project to a cabal project
  • Adds a cabal.project and cabal.freeze file generated by stack2cabal
  • Adds a flag WIRE_BUILD_WITH_CABAL that is, When it is set cabal will be used for make fast and make install from the root Makefile.
  • Adds two make targets that use cabal to build:
   make c package=brig # to build and install all of brig's executables
   make c package=brig test=1 # also run unit tests
   make ci package=brig pattern="delete" # build and run brig's integration tests
  • Deletes package.yaml of types-common-journal and wire-message-proto-lens, because the cabal files generated with hpack don't work with cabal.

For details see tools/convert-to-cabal/README.md included in this PR.

Building with cabal has been tested only locally. For building on CI/withou nix follow-up PRs are needed.

Checklist

  • The PR Title explains the impact of the change.
  • The PR description provides context as to why the change should occur and what the code contributes to that effect. This could also be a link to a JIRA ticket or a Github issue, if there is one.

@fisx
Copy link
Contributor

fisx commented Oct 14, 2021

this will affect #1852, but i think we can work on it in parallel. getting all the dependencies in shape for ghc10 and all the new packages will still be required, right?

@smatting
Copy link
Contributor Author

this will affect #1852, but i think we can work on it in parallel. getting all the dependencies in shape for ghc10 and all the new packages will still be required, right?

Yes, I suggest we finish #1852 first and then rerun stack2cabal (included in this PR) again.

@smatting smatting marked this pull request as ready for review October 29, 2021 16:59
@smatting smatting changed the title Use cabal to build wire-server Use cabal to build wire-server (opt-in) Nov 4, 2021
@smatting smatting mentioned this pull request Nov 4, 2021
12 tasks
Both `cabal test` and `cabal install` "change configuration" so next time `cabal
build` is run, cabal goes over all the packages to make sure nothing needs
compilation which is a significant slowdown. This way we don't have to go
through that slowdown.
@smatting smatting merged commit f3e45af into develop Nov 8, 2021
@smatting smatting deleted the smatting/use-cabal branch November 8, 2021 17:18
@akshaymankar akshaymankar mentioned this pull request Nov 15, 2021
@smatting smatting mentioned this pull request Dec 2, 2021
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.

4 participants