Skip to content

Commit 0592b05

Browse files
committed
refactor: implement the new bzlmod api
1 parent a69bc19 commit 0592b05

12 files changed

+936
-623
lines changed

MODULE.bazel

Lines changed: 70 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ bazel_dep(name = "rules_shell", version = "0.4.1")
1616
bazel_lib_toolchains = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains")
1717
use_repo(bazel_lib_toolchains, "zstd_toolchains")
1818
use_repo(bazel_lib_toolchains, "bsd_tar_toolchains")
19-
use_repo(bazel_lib_toolchains, "yq_darwin_amd64")
20-
use_repo(bazel_lib_toolchains, "yq_darwin_arm64")
21-
use_repo(bazel_lib_toolchains, "yq_linux_amd64")
22-
use_repo(bazel_lib_toolchains, "yq_linux_arm64")
23-
use_repo(bazel_lib_toolchains, "yq_linux_ppc64le")
24-
use_repo(bazel_lib_toolchains, "yq_linux_s390x")
25-
use_repo(bazel_lib_toolchains, "yq_windows_amd64")
19+
2620

2721
# Dev dependencies
2822
bazel_dep(name = "gazelle", version = "0.34.0", dev_dependency = True, repo_name = "bazel_gazelle")
@@ -59,39 +53,79 @@ apt = use_extension(
5953
"apt",
6054
dev_dependency = True,
6155
)
62-
apt.install(
63-
name = "bullseye",
64-
lock = "//examples/debian_snapshot:bullseye.lock.json",
65-
manifest = "//examples/debian_snapshot:bullseye.yaml",
66-
)
67-
apt.install(
68-
name = "bullseye_nolock",
69-
manifest = "//examples/debian_snapshot:bullseye.yaml",
70-
nolock = True,
56+
57+
58+
apt.sources_list(
59+
types = ["deb"],
60+
uris = [
61+
"https://snapshot.ubuntu.com/ubuntu/20240301T030400Z",
62+
"mirror+https://snapshot.ubuntu.com/ubuntu/20240301T030400Z"
63+
],
64+
suites = ["noble", "noble-security", "noble-updates"],
65+
components = ["main"],
66+
architectures = ["amd64"]
67+
# TODO: signed_by
7168
)
72-
apt.install(
73-
name = "noble",
74-
lock = "//examples/ubuntu_snapshot:noble.lock.json",
75-
manifest = "//examples/ubuntu_snapshot:noble.yaml",
69+
70+
apt.sources_list(
71+
types = ["deb"],
72+
uris = ["https://packages.cloud.google.com/apt"],
73+
suites = ["cloud-sdk"],
74+
components = ["main"],
75+
architectures = ["amd64"]
7676
)
77-
apt.install(
78-
name = "resolution_test",
79-
manifest = "apt/tests/resolution/security.yaml",
80-
nolock = True,
77+
78+
apt.sources_list(
79+
types = ["deb"],
80+
uris = ["https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/"],
81+
suites = ["cloud-sdk"],
82+
components = ["main"],
83+
architectures = ["amd64"]
8184
)
82-
apt.install(
83-
name = "resolution_test_empty_lock",
84-
lock = "//apt/tests/resolution:empty.lock.json",
85-
manifest = "apt/tests/resolution/security.yaml",
85+
86+
apt.sources_list(
87+
types = ["deb"],
88+
uris = ["https://snapshot.debian.org/archive/debian/20240210T223313Z"],
89+
suites = ["bookworm", "bookworm-updates"],
90+
components = ["main"],
91+
architectures = ["amd64", "arm64", "i386"]
8692
)
87-
apt.install(
88-
name = "arch_all_test",
89-
manifest = "apt/tests/resolution/arch_all.yaml",
90-
nolock = True,
93+
apt.sources_list(
94+
types = ["deb"],
95+
uris = ["https://snapshot.debian.org/archive/debian-security/20240210T223313Z"],
96+
suites = ["bookworm-security"],
97+
components = ["main"],
98+
architectures = ["amd64", "arm64", "i386"]
9199
)
100+
101+
92102
apt.install(
93-
name = "clang",
94-
manifest = "apt/tests/resolution/clang.yaml",
95-
nolock = True,
103+
# dependency_set isolates these installs into their own scope.
104+
# installing onto default dependency_set only allowed in the
105+
# root module
106+
dependency_set = "bookworm",
107+
suites = ["bookworm", "bookworm-updates", "bookworm-security", "cloud-sdk"],
108+
packages = [
109+
"base-files",
110+
"coreutils:arm64",
111+
"libstdc++6:i386",
112+
"ncurses-base",
113+
"libncurses6",
114+
"tzdata",
115+
"google-cloud-cli:amd64"
116+
]
96117
)
97-
use_repo(apt, "arch_all_test", "arch_all_test_resolve", "bullseye", "bullseye_nolock", "clang", "noble", "resolution_test", "resolution_test_empty_lock_resolve", "resolution_test_resolve")
118+
119+
use_repo(apt, "bookworm")
120+
121+
122+
# TODO: support this style of source_list
123+
#
124+
# apt.sources_list(
125+
# sources = [
126+
# "deb [arch=amd64,arm64] https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble main",
127+
# "deb [arch=amd64,arm64] https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble-security main",
128+
# "deb [arch=amd64,arm64] https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble-updates main",
129+
# ],
130+
# )
131+
#

0 commit comments

Comments
 (0)