Skip to content

Commit 310b5b4

Browse files
committed
Update Bazel workspace dependencies to 7.6.2 compatibility with MODULE.bazel support
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent ba23ab4 commit 310b5b4

File tree

7 files changed

+156
-13
lines changed

7 files changed

+156
-13
lines changed

.bazelrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# Disable Bzlmod
2-
common --noenable_bzlmod
1+
# Enable Bzlmod for modern dependency management
2+
# To use legacy WORKSPACE instead, add: --noenable_bzlmod
3+
common --enable_bzlmod
34

45
# Force Bazel to use --target=wasm32-wasip1
56
build --platforms=@rules_rust//rust/platform:wasi

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.6.1
1+
7.6.2

MODULE.bazel

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
module(
16+
name = "proxy_wasm_rust_sdk",
17+
version = "0.2.5-dev",
18+
)
19+
20+
# Regular dependencies (sorted alphabetically)
21+
bazel_dep(name = "bazel_features", version = "1.38.0")
22+
bazel_dep(name = "bazel_skylib", version = "1.8.2")
23+
bazel_dep(name = "rules_cc", version = "0.2.14")
24+
bazel_dep(name = "rules_rust", version = "0.67.0")
25+
26+
# Configure Rust toolchain
27+
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
28+
rust.toolchain(edition = "2018")
29+
use_repo(rust, "rust_toolchains")
30+
31+
register_toolchains("@rust_toolchains//:all")

MODULE.bazel.lock

Lines changed: 95 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WORKSPACE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ load("@proxy_wasm_rust_sdk//bazel:repositories.bzl", "proxy_wasm_rust_sdk_reposi
44

55
proxy_wasm_rust_sdk_repositories()
66

7+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
8+
9+
bazel_features_deps()
10+
11+
load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")
12+
13+
compatibility_proxy_repo()
14+
715
load("@proxy_wasm_rust_sdk//bazel:dependencies.bzl", "proxy_wasm_rust_sdk_dependencies")
816

917
proxy_wasm_rust_sdk_dependencies()

bazel/repositories.bzl

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,34 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1616
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
1717

1818
def proxy_wasm_rust_sdk_repositories():
19+
maybe(
20+
http_archive,
21+
name = "bazel_features",
22+
sha256 = "07271d0f6b12633777b69020c4cb1eb67b1939c0cf84bb3944dc85cc250c0c01",
23+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.38.0/bazel_features-v1.38.0.tar.gz",
24+
strip_prefix = "bazel_features-1.38.0",
25+
)
26+
1927
maybe(
2028
http_archive,
2129
name = "rules_cc",
22-
sha256 = "4b12149a041ddfb8306a8fd0e904e39d673552ce82e4296e96fac9cbf0780e59",
23-
url = "https://github.com/bazelbuild/rules_cc/releases/download/0.1.0/rules_cc-0.1.0.tar.gz",
24-
strip_prefix = "rules_cc-0.1.0",
30+
sha256 = "a2fdfde2ab9b2176bd6a33afca14458039023edb1dd2e73e6823810809df4027",
31+
url = "https://github.com/bazelbuild/rules_cc/releases/download/0.2.14/rules_cc-0.2.14.tar.gz",
32+
strip_prefix = "rules_cc-0.2.14",
2533
)
2634

2735
maybe(
2836
http_archive,
2937
name = "rules_rust",
30-
sha256 = "53c1bac7ec48f7ce48c4c1c6aa006f27515add2aeb05725937224e6e00ec7cea",
31-
url = "https://github.com/bazelbuild/rules_rust/releases/download/0.61.0/rules_rust-0.61.0.tar.gz",
38+
sha256 = "dc287e3eca80b29d5cc95e261cae273eedf1af4a00a96ae937e234534dadb24c",
39+
url = "https://github.com/bazelbuild/rules_rust/releases/download/0.67.0/rules_rust-0.67.0.tar.gz",
3240
patches = ["//bazel:rules_rust.patch"],
3341
patch_args = ["-p1"],
3442
)
3543

3644
maybe(
3745
http_archive,
3846
name = "bazel_skylib",
39-
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
40-
url = "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
47+
sha256 = "6e78f0e57de26801f6f564fa7c4a48dc8b36873e416257a92bbb0937eeac8446",
48+
url = "https://github.com/bazelbuild/bazel-skylib/releases/download/1.8.2/bazel-skylib-1.8.2.tar.gz",
4149
)

bazel/rules_rust.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl
44
index 20a09f94..53122967 100644
55
--- a/rust/private/rustc.bzl
66
+++ b/rust/private/rustc.bzl
7-
@@ -1518,7 +1518,7 @@ def rustc_compile_action(
8-
})
9-
crate_info = rust_common.create_crate_info(**crate_info_dict)
7+
@@ -1615,7 +1615,7 @@ def rustc_compile_action(
8+
**crate_info_dict
9+
)
1010

1111
- if crate_info.type in ["staticlib", "cdylib"]:
1212
+ if crate_info.type in ["staticlib", "cdylib"] and not out_binary:

0 commit comments

Comments
 (0)