From ef1ddd83a3ec899ef9b0a2d03df88ad6dd1f4946 Mon Sep 17 00:00:00 2001 From: Philipp Zander Date: Wed, 14 Feb 2024 21:47:33 +0100 Subject: [PATCH] fix `use_stack` documentation --- haskell/cabal.bzl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/haskell/cabal.bzl b/haskell/cabal.bzl index 2f162f552..0cdcee1d7 100644 --- a/haskell/cabal.bzl +++ b/haskell/cabal.bzl @@ -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` @@ -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`")