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

Support Cabal setup dependencies #1347

Merged
merged 8 commits into from Jun 2, 2020
Merged

Support Cabal setup dependencies #1347

merged 8 commits into from Jun 2, 2020

Conversation

aherrmann
Copy link
Member

Closes #1314

  • Adds an attribute setup_deps to haskell_cabal_library|binary to pass in setup-depends libraries for custom-setup.
  • Adds an attribute setup_deps to stack_snapshot which allows to specify per package setup_deps. This is implementated in a way that allows using targets from within the same snapshot. E.g. if polysemy depends on cabal-doctest then both those packages can be built by the same stack_snapshot.
  • Adds a test case for setup_deps on haskell_cabal_library
  • Adds a regression test for Support library dependencies in custom Cabal setup scripts #1314.

Copy link
Contributor

@hanshoglund hanshoglund left a comment

Choose a reason for hiding this comment

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

Looks great.

We should maybe add a line to the docs stating that "Setup.hs dependencies need to be declared explicitly" but that can be handled in a later PR.

@hanshoglund hanshoglund added the merge-queue merge on green CI label Jun 2, 2020
Otherwise, it is not legal to depend on a package from within the same
snapshot. E.g. the package `polysemy` from `@stackage` could not have a
`setup_deps` dependency on `@stackage//:cabal-doctest`, which is very
inconvenint.

The dependency does not have to be resolved at repository rule
evaluation time, only at build time of the Cabal target, hence it is
sufficient to pass the labels as strings.
The versions are determined by the GHC toolchain and Stack snapshot.
@mergify mergify bot merged commit 1726f67 into master Jun 2, 2020
@mergify mergify bot deleted the cabal-setup-deps branch June 2, 2020 14:41
@mergify mergify bot removed the merge-queue merge on green CI label Jun 2, 2020
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.

Support library dependencies in custom Cabal setup scripts
2 participants