Skip to content

Commit 3f7d5ca

Browse files
committed
Align MODULE.bazel and WORKSPACE dependency versions
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent 97ac63f commit 3f7d5ca

File tree

7 files changed

+68
-23
lines changed

7 files changed

+68
-23
lines changed

bazel/.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
common --enable_bzlmod=0
1+
common --enable_bzlmod

bazel/MODULE.bazel

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,60 @@
11
module(name = "envoy_toolshed", version = "")
22

3-
bazel_dep(name = "aspect_bazel_lib", version = "2.4.2")
4-
bazel_dep(name = "bazel_skylib", version = "1.5.0")
5-
bazel_dep(name = "rules_pkg", version = "0.7.0")
6-
bazel_dep(name = "rules_python", version = "0.31.0")
7-
bazel_dep(name = "rules_perl", version = "0.2.3")
3+
bazel_dep(name = "aspect_bazel_lib", version = "2.16.0")
4+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
5+
bazel_dep(name = "platforms", version = "1.0.0")
6+
bazel_dep(name = "rules_foreign_cc", version = "0.14.0")
7+
bazel_dep(name = "rules_perl", version = "0.4.1")
8+
bazel_dep(name = "rules_pkg", version = "1.0.1")
9+
bazel_dep(name = "rules_python", version = "1.4.1")
10+
bazel_dep(name = "rules_shell", version = "0.6.1")
11+
bazel_dep(name = "toolchains_llvm", version = "1.4.0")
812
# -- bazel_dep definitions -- #
913

1014
bazel_lib_toolchains = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains")
1115
bazel_lib_toolchains.jq()
1216
use_repo(bazel_lib_toolchains, "jq_toolchains")
1317

18+
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
19+
llvm.toolchain()
20+
21+
use_repo(llvm, "llvm_toolchain")
22+
register_toolchains("@llvm_toolchain//:all")
23+
24+
PYTHON_VERSIONS = [
25+
"3.9",
26+
"3.10",
27+
"3.11",
28+
"3.12",
29+
"3.13",
30+
]
31+
1432
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
15-
python.toolchain(python_version = "3.11")
33+
[
34+
python.toolchain(
35+
is_default = python_version == PYTHON_VERSIONS[-1],
36+
python_version = python_version,
37+
)
38+
for python_version in PYTHON_VERSIONS
39+
]
1640

1741
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
18-
pip.parse(
19-
hub_name = "pip3",
20-
python_version = "3.11",
21-
requirements_lock = "//:requirements.txt",
22-
)
23-
pip.parse(
24-
hub_name = "website_pip3",
25-
python_version = "3.11",
26-
requirements_lock = "//website:requirements.txt",
27-
)
42+
43+
[
44+
pip.parse(
45+
hub_name = "pip3",
46+
python_version = python_version,
47+
requirements_lock = "//:requirements.txt",
48+
)
49+
for python_version in PYTHON_VERSIONS
50+
]
51+
[
52+
pip.parse(
53+
hub_name = "website_pip3",
54+
python_version = python_version,
55+
requirements_lock = "//website:requirements.txt",
56+
)
57+
for python_version in PYTHON_VERSIONS
58+
]
59+
2860
use_repo(pip, "pip3", "website_pip3")

bazel/dependency/macros.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
12

23
def updater(
34
name,
@@ -61,7 +62,7 @@ def updater(
6162
data += [post_script]
6263
env["VERSION_UPDATE_POST_SCRIPT"] = "$(location %s)" % post_script
6364

64-
native.sh_binary(
65+
sh_binary(
6566
name = name,
6667
srcs = [update_script],
6768
data = data,

bazel/profiler/macros.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@aspect_bazel_lib//lib:jq.bzl", "jq")
2+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
23

34
def rules_pools(
45
name,
@@ -10,7 +11,7 @@ def rules_pools(
1011
"""Generate a dict with keys being non-`default` pools, and values
1112
are a list of targets configured to use the pool.
1213
"""
13-
native.sh_binary(
14+
sh_binary(
1415
name = "find_rules_pools",
1516
srcs = [pool_script],
1617
data = [
@@ -358,7 +359,7 @@ def ci_changes(
358359
""",
359360
)
360361

361-
native.sh_binary(
362+
sh_binary(
362363
name = "update",
363364
srcs = [update_script],
364365
data = [

bazel/tarball/macros.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
12

23
def unpacker(
34
name,
@@ -52,7 +53,7 @@ def unpacker(
5253
data += [zstd]
5354
env["ZSTD"] = "$(location %s)" % zstd
5455

55-
native.sh_binary(
56+
sh_binary(
5657
name = name,
5758
srcs = [script],
5859
visibility = visibility,

bazel/utils.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
12

23
def cat(name = "cat", flag = "target"):
34
"""
@@ -44,7 +45,7 @@ def cat(name = "cat", flag = "target"):
4445
srcs = [":%s" % flag],
4546
)
4647

47-
native.sh_binary(
48+
sh_binary(
4849
name = name,
4950
srcs = ["%s_sh" % name],
5051
data = [":%s" % flag],
@@ -92,7 +93,7 @@ def jqcat(
9293
build_setting_default = ":jqempty",
9394
)
9495

95-
native.sh_binary(
96+
sh_binary(
9697
name = name,
9798
srcs = [jq_script],
9899
data = [

bazel/versions.bzl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@ VERSIONS = {
117117
"strip_prefix": "{name}-{version}",
118118
},
119119

120+
"rules_shell": {
121+
"type": "github_archive",
122+
"repo": "bazelbuild/rules_shell",
123+
"version": "0.6.1",
124+
"sha256": "e6b87c89bd0b27039e3af2c5da01147452f240f75d505f5b6880874f31036307",
125+
"url": "https://github.com/{repo}/releases/download/v{version}/{name}-v{version}.tar.gz",
126+
"strip_prefix": "{name}-{version}",
127+
},
128+
120129
"toolchains_llvm": {
121130
"type": "github_archive",
122131
"repo": "bazel-contrib/toolchains_llvm",

0 commit comments

Comments
 (0)