Skip to content

Commit

Permalink
Merge pull request #2122 from tweag/philipp/use_stack-documentation
Browse files Browse the repository at this point in the history
fix `use_stack` documentation
  • Loading branch information
mergify[bot] authored Feb 15, 2024
2 parents ef9eba2 + ef1ddd8 commit d63bfde
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions haskell/cabal.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2746,7 +2746,8 @@ def use_stack(stack):
Globally override the `stack` version used by all instances of `stack_snapshot`.
WARNING: This should only be used in the top-level repository.
Example:
### Examples
```
# WORKSPACE
# Order is important! Placing `use_stack()` after any occurrence of `stack_snapshot`
Expand All @@ -2758,13 +2759,16 @@ def use_stack(stack):
stack = "@y_stack:stack",
# ...
)
```
# BUILD
```
# BUILD.bazel
haskell_binary(
# ...
# targets in `x` will be built using `x_stack`, NOT `y_stack`
deps = ["@x//:all"],
)
```
"""
if native.existing_rule("rules_haskell_stack"):
fail("`rules_haskell_stack` already defined. call `use_stack()` before `stack_snapshot()` in `WORKSPACE`")
Expand Down

0 comments on commit d63bfde

Please sign in to comment.