Skip to content

Commit

Permalink
rules_haskell_tests: Add the stackage-zlib snapshot in MODULE.bazel
Browse files Browse the repository at this point in the history
This makes use of the multiple snapshot support.
  • Loading branch information
avdv committed Sep 18, 2023
1 parent 3f191b9 commit 344a1f9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 14 deletions.
10 changes: 10 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,13 @@ stack_snapshot(
"ghc-paths": "@rules_haskell//tools/ghc-paths",
},
)

# In a separate repo because not all platforms support zlib.
stack_snapshot(
name = "stackage-zlib",
extra_deps = {"zlib": ["//tests:zlib"]},
label_builder = label_builder,
local_snapshot = "//:stackage_snapshot.yaml",
packages = ["zlib"],
stack_snapshot_json = "//:stackage-zlib-snapshot.json" if not is_windows else None,
)
27 changes: 23 additions & 4 deletions rules_haskell_tests/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,8 @@ use_repo(
"alex",
"ghcide",
"ghcide-exe",
"rules_haskell_stack",
"rules_haskell_stack_update",
"stackage-pinning-test",
"stackage-pinning-test-unpinned",
"stackage-zlib",
"stackage-zlib-unpinned",
"stackage_asterius",
"stackage_asterius-unpinned",
)
Expand Down Expand Up @@ -339,9 +335,13 @@ stack_snapshot = use_extension(
)
use_repo(
stack_snapshot,
"rules_haskell_stack",
"rules_haskell_stack_update",
"stackage",
"stackage-exe",
"stackage-unpinned",
"stackage-zlib",
"stackage-zlib-unpinned",
)
stack_snapshot.package(
name = "proto-lens-protoc",
Expand Down Expand Up @@ -439,3 +439,22 @@ stack_snapshot.stack_snapshot_json(
"mac",
],
)

# In a separate repo because not all platforms support zlib.
stack_snapshot.snapshot(
name = "stackage-zlib",
local_snapshot = "//:stackage_snapshot.yaml",
)
stack_snapshot.package(
name = "zlib",
snapshot = "stackage-zlib",
extra_deps = ["//tests:zlib"],
)
stack_snapshot.stack_snapshot_json(
label = "//:stackage-zlib-snapshot.json",
snapshot = "stackage-zlib",
os = [
"linux",
"mac",
],
)
10 changes: 0 additions & 10 deletions rules_haskell_tests/non_module_deps_2.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ _empty_repo = repository_rule(
)

def repositories(*, bzlmod):
# In a separate repo because not all platforms support zlib.
stack_snapshot(
name = "stackage-zlib",
extra_deps = {"zlib": ["//tests:zlib"]},
local_snapshot = "//:stackage_snapshot.yaml",
packages = ["zlib"],
stack_snapshot_json = "//:stackage-zlib-snapshot.json" if not is_windows else None,
label_builder = label_builder,
)

stack_snapshot(
name = "ghcide",
setup_stack = False,
Expand Down

0 comments on commit 344a1f9

Please sign in to comment.