Skip to content

Commit 97c5e5c

Browse files
authored
bazel: Upgrade rules_rust and a few other rule sets (#32098)
This PR upgrades our use of `rules_rust` to `v0.59.3`, which is a custom version I released on our [fork](https://github.com/MaterializeInc/rules_rust/releases/tag/mz-0.59.3). As described on the release, it's a fork of the upstream `v0.59.2` and includes two PRs I made upstream: 1. bazelbuild/rules_rust#3386 2. bazelbuild/rules_rust#3387 In addition to `rules_rust` we upgrade (out of necessity) * `rules_cc` - rules for building C/C++ dependencies * `protobuf` - required by the upgrade of `rules_cc` * `bazel_skylib` - stdlib like Bazel rules Note: This regresses our support for Apple x86_64 because I didn't have a machine I could use to rebuild the `cargo-bazel` binary. But AFAIK everyone using a Macbook now has an ARM based machine so this shouldn't be an issue. ### Motivation Unblocks our upgrade to Rust 1.86.0 and Edition 2024 ### Checklist - [ ] This PR has adequate test coverage / QA involvement has been duly considered. ([trigger-ci for additional test/nightly runs](https://trigger-ci.dev.materialize.com/)) - [ ] This PR has an associated up-to-date [design doc](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/README.md), is a design doc ([template](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/00000000_template.md)), or is sufficiently small to not require a design. <!-- Reference the design in the description. --> - [ ] If this PR evolves [an existing `$T ⇔ Proto$T` mapping](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/command-and-response-binary-encoding.md) (possibly in a backwards-incompatible way), then it is tagged with a `T-proto` label. - [ ] If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label ([example](MaterializeInc/cloud#5021)). <!-- Ask in #team-cloud on Slack if you need help preparing the cloud PR. --> - [ ] If this PR includes major [user-facing behavior changes](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/guide-changes.md#what-changes-require-a-release-note), I have pinged the relevant PM to schedule a changelog post.
1 parent 54a721f commit 97c5e5c

File tree

16 files changed

+85
-63
lines changed

16 files changed

+85
-63
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ exclude = [
242242
# All WASM crates are split into their own workspace to avoid needles cache
243243
# invalidations for the core Mz crates.
244244
"misc/wasm/*",
245+
# Ignore any Rust dependencies that python packages might pull in.
246+
"misc/python/venv/*",
245247
]
246248

247249
# Use Cargo's new feature resolver, which can handle target-specific features.

WORKSPACE

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ included by calling a `*_dependencies()` macro.
3131
#
3232
# Note: In an ideal world the two rule sets would be combined into one.
3333

34-
BAZEL_SKYLIB_VERSION = "1.6.1"
34+
BAZEL_SKYLIB_VERSION = "1.7.1"
3535

36-
BAZEL_SKYLIB_INTEGRITY = "sha256-nziIakBUjG6WwQa3UvJCEw7hGqoGila6flb0UR8z5PI="
36+
BAZEL_SKYLIB_INTEGRITY = "sha256-vCg8381SalLDIBJ5zaS8KYZS76iYsQtNsIN9xRZSdW8="
3737

3838
maybe(
3939
http_archive,
@@ -65,15 +65,22 @@ aspect_bazel_lib_dependencies()
6565
# Register bazel-lib toolchains
6666
aspect_bazel_lib_register_toolchains()
6767

68+
# C Repositories
69+
#
70+
# Loads all of the C dependencies that we rely on.
71+
load("//misc/bazel/c_deps:repositories.bzl", "c_repositories")
72+
73+
c_repositories()
74+
6875
# `rules_cc`
6976
#
7077
# Rules for building C/C++ projects. These are slowly being upstreamed into the
7178
# Bazel source tree, but some projects (e.g. protobuf) still depend on this
7279
# rule set.
7380

74-
RULES_CC_VERSION = "0.0.9"
81+
RULES_CC_VERSION = "0.1.1"
7582

76-
RULES_CC_INTEGRITY = "sha256-IDeHW5pEVtzkp50RKorohbvEqtlo5lh9ym5k86CQDN8="
83+
RULES_CC_INTEGRITY = "sha256-cS13hosxUt1hjE1k+q3e/MWWX5D13m5t0dXdzQvoLUI="
7784

7885
maybe(
7986
http_archive,
@@ -300,29 +307,22 @@ load("//misc/bazel/c_deps:extra_setup.bzl", "protoc_setup")
300307

301308
protoc_setup()
302309

303-
# C Repositories
304-
#
305-
# Loads all of the C dependencies that we rely on.
306-
load("//misc/bazel/c_deps:repositories.bzl", "c_repositories")
307-
308-
c_repositories()
309-
310310
# `rules_rust`
311311
#
312312
# Rules for building Rust crates, and several convienence macros for building all transitive
313313
# dependencies.
314314

315-
RULES_RUST_VERSION = "0.54.2"
315+
RULES_RUST_VERSION = "0.59.3"
316316

317-
RULES_RUST_INTEGRITY = "sha256-6hXbBNIbd6EvuBc/B5RMmAEhxLy5cs8EGuHpjqwjcz4="
317+
RULES_RUST_INTEGRITY = "sha256-pPPz9Yewxoqs6ZhcQAaI8AeFCy/S/ipQTEkTbZ3syz4="
318318

319319
maybe(
320320
http_archive,
321321
name = "rules_rust",
322322
integrity = RULES_RUST_INTEGRITY,
323-
strip_prefix = "rules_rust-v{0}".format(RULES_RUST_VERSION),
323+
strip_prefix = "rules_rust-mz-{0}".format(RULES_RUST_VERSION),
324324
urls = [
325-
"https://github.com/MaterializeInc/rules_rust/releases/download/v{0}/rules_rust-v{0}.tar.zst".format(RULES_RUST_VERSION),
325+
"https://github.com/MaterializeInc/rules_rust/releases/download/mz-{0}/rules_rust-mz-{0}.tar.zst".format(RULES_RUST_VERSION),
326326
],
327327
)
328328

@@ -419,7 +419,17 @@ rust_toolchains(
419419
# Rules and Toolchains for running [`bindgen`](https://github.com/rust-lang/rust-bindgen)
420420
# a tool for generating Rust FFI bindings to C.
421421

422-
load("@rules_rust//bindgen:repositories.bzl", "rust_bindgen_dependencies")
422+
maybe(
423+
http_archive,
424+
name = "rules_rust_bindgen",
425+
integrity = RULES_RUST_INTEGRITY,
426+
strip_prefix = "rules_rust-mz-{0}/extensions/bindgen".format(RULES_RUST_VERSION),
427+
urls = [
428+
"https://github.com/MaterializeInc/rules_rust/releases/download/mz-{0}/rules_rust-mz-{0}.tar.zst".format(RULES_RUST_VERSION),
429+
],
430+
)
431+
432+
load("@rules_rust_bindgen//:repositories.bzl", "rust_bindgen_dependencies")
423433

424434
rust_bindgen_dependencies()
425435

@@ -461,6 +471,7 @@ crates_repository(
461471
# Note: The below targets are from the additive build file.
462472
additive_build_file = "@//misc/bazel/c_deps:rust-sys/BUILD.rocksdb.bazel",
463473
compile_data = [":out_dir"],
474+
compile_data_glob_excludes = ["rocksdb/**"],
464475
gen_build_script = False,
465476
rustc_env = {
466477
"OUT_DIR": "$(execpath :out_dir)",
@@ -564,16 +575,14 @@ crates_repository(
564575
cargo_config = "//:.cargo/config.toml",
565576
cargo_lockfile = "//:Cargo.lock",
566577
generator_sha256s = {
567-
"aarch64-apple-darwin": "8204746334a17823bd6a54ce2c3821b0bdca96576700d568e2ca2bd8224dc0ea",
568-
"x86_64-apple-darwin": "2ee14b230d32c05415852b7a388b76e700c87c506459e5b31ced19d6c131b6d0",
569-
"aarch64-unknown-linux-gnu": "3792feb084bd43b9a7a9cd75be86ee9910b46db59360d6b29c9cca2f8889a0aa",
570-
"x86_64-unknown-linux-gnu": "2b9d07f34694f63f0cc704989ad6ec148ff8d126579832f4f4d88edea75875b2",
578+
"aarch64-apple-darwin": "c38c9c0efc11fcf9c32b9e0f4f4849df7c823f207c7f5ba5f6ab1e0e2167693d",
579+
"aarch64-unknown-linux-gnu": "5bdc9a10ec5f17f5140a81ce7cb0c0ce6e82d4d862d3ce3a301ea23f72f20630",
580+
"x86_64-unknown-linux-gnu": "abcd8212d64ea4c0f5e856af663c05ebeb2800a02c251f6eb62061f4e8ca1735",
571581
},
572582
generator_urls = {
573-
"aarch64-apple-darwin": "https://github.com/MaterializeInc/rules_rust/releases/download/v{0}/cargo-bazel-aarch64-apple-darwin".format(RULES_RUST_VERSION),
574-
"x86_64-apple-darwin": "https://github.com/MaterializeInc/rules_rust/releases/download/v{0}/cargo-bazel-x86_64-apple-darwin".format(RULES_RUST_VERSION),
575-
"aarch64-unknown-linux-gnu": "https://github.com/MaterializeInc/rules_rust/releases/download/v{0}/cargo-bazel-aarch64-unknown-linux-gnu".format(RULES_RUST_VERSION),
576-
"x86_64-unknown-linux-gnu": "https://github.com/MaterializeInc/rules_rust/releases/download/v{0}/cargo-bazel-x86_64-unknown-linux-gnu".format(RULES_RUST_VERSION),
583+
"aarch64-apple-darwin": "https://github.com/MaterializeInc/rules_rust/releases/download/mz-{0}/cargo-bazel-aarch64-apple-darwin".format(RULES_RUST_VERSION),
584+
"aarch64-unknown-linux-gnu": "https://github.com/MaterializeInc/rules_rust/releases/download/mz-{0}/cargo-bazel-aarch64-unknown-linux-gnu".format(RULES_RUST_VERSION),
585+
"x86_64-unknown-linux-gnu": "https://github.com/MaterializeInc/rules_rust/releases/download/mz-{0}/cargo-bazel-x86_64-unknown-linux-gnu".format(RULES_RUST_VERSION),
577586
},
578587
# When `isolated` is true, Bazel will create a new `$CARGO_HOME`, i.e. it
579588
# won't use `~/.cargo`, when re-pinning. This is nice but not totally

misc/bazel/c_deps/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ build_test(
3535
"@jemalloc//:jemalloc",
3636
"@lz4//:lz4",
3737
"@openssl//:openssl",
38-
"@protobuf//:protoc",
38+
"@com_google_protobuf//:protoc",
3939
"@zlib//:zlib",
4040
"@zstd//:zstd",
4141
],

misc/bazel/c_deps/extra_setup.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def protoc_setup():
2323
they're specific to building `protoc` we split them out to reduce noise in
2424
that relatively crowded file.
2525
26-
Note: We could use "@protobuf//:protobuf_deps.bzl", but that pulls in
26+
Note: We could use "@com_google_protobuf//:protobuf_deps.bzl", but that pulls in
2727
unneccessary toolchains that we don't need, like Java, so we manually
2828
specify dependencies here.
2929
"""

misc/bazel/c_deps/repositories.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ def c_repositories():
8181
],
8282
)
8383

84-
PROTOC_VERSION = "26.1"
85-
PROTOC_INTEGRITY = "sha256-T8X/Gywzn7hs06JfC1MRR4qwgeZa0ljGeJNZzYTUIfg="
84+
PROTOC_VERSION = "27.0"
85+
PROTOC_INTEGRITY = "sha256-2iiL8dqmwE0DqQUXgcqlKs65FjWGv/mqbPsS9puTlao="
8686
maybe(
8787
http_archive,
88-
name = "protobuf",
88+
name = "com_google_protobuf",
8989
integrity = PROTOC_INTEGRITY,
9090
strip_prefix = "protobuf-{}".format(PROTOC_VERSION),
9191
urls = [

misc/bazel/c_deps/rust-sys/BUILD.protobuf-native.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ cc_library(
3737
":lib-bridge/include",
3838
"@com_google_absl//absl/strings",
3939
"@crates_io__cxx-1.0.122//:cxx_cc",
40-
"@protobuf//src/google/protobuf/compiler:code_generator",
41-
"@protobuf//src/google/protobuf/compiler:importer",
40+
"@com_google_protobuf//src/google/protobuf/compiler:code_generator",
41+
"@com_google_protobuf//src/google/protobuf/compiler:importer",
4242
],
4343
)
4444

misc/bazel/c_deps/rust-sys/BUILD.rocksdb.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
1919
load("@bazel_skylib//rules:select_file.bzl", "select_file")
2020
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
21-
load("@rules_rust//bindgen:defs.bzl", "rust_bindgen")
21+
load("@rules_rust_bindgen//:defs.bzl", "rust_bindgen")
2222

2323
# Derived from <https://github.com/rust-rocksdb/rust-rocksdb/blob/7f9cba4a819e76d8022733b4c82509aec6056938/librocksdb-sys/build.rs>
2424

misc/bazel/rust_deps/cxxbridge-cmd/Cargo.cxxbridge-cmd.lock

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"checksum": "b2b75eaba9abbc55071dcf7f2ded98069da446c19b24e7ac327c70bc8edf867e",
2+
"checksum": "c17ea32c7611b5b8f4d91ef5bb280e78b142db085fdcc4ec608d3eb5303562a5",
33
"crates": {
44
"anstyle 1.0.4": {
55
"name": "anstyle",
@@ -374,6 +374,9 @@
374374
"compile_data_glob": [
375375
"**"
376376
],
377+
"compile_data_glob_excludes": [
378+
"**/*.rs"
379+
],
377380
"data_glob": [
378381
"**"
379382
]
@@ -742,6 +745,9 @@
742745
"compile_data_glob": [
743746
"**"
744747
],
748+
"compile_data_glob_excludes": [
749+
"**/*.rs"
750+
],
745751
"data_glob": [
746752
"**"
747753
]
@@ -810,6 +816,9 @@
810816
"compile_data_glob": [
811817
"**"
812818
],
819+
"compile_data_glob_excludes": [
820+
"**/*.rs"
821+
],
813822
"data_glob": [
814823
"**"
815824
]
@@ -928,6 +937,9 @@
928937
"compile_data_glob": [
929938
"**"
930939
],
940+
"compile_data_glob_excludes": [
941+
"**/*.rs"
942+
],
931943
"data_glob": [
932944
"**"
933945
]
@@ -971,5 +983,6 @@
971983
"quote 1.0.33",
972984
"syn 2.0.38"
973985
],
974-
"direct_dev_deps": []
986+
"direct_dev_deps": [],
987+
"unused_patches": []
975988
}

misc/bazel/rust_deps/cxxbridge-cmd/include.BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ rust_binary(
2020
name = "cxxbridge-cmd",
2121
srcs = glob(["src/**/*.rs"]),
2222
aliases = aliases(),
23-
data = [
23+
compile_data = [
2424
"src/gen/include/cxx.h",
2525
],
2626
edition = "2021",

misc/bazel/rust_deps/repositories.bzl

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,15 @@ def rust_repositories():
5151
"x86_64-apple-darwin",
5252
"wasm32-unknown-unknown",
5353
],
54-
generator_urls = {
55-
"aarch64-apple-darwin": "https://github.com/MaterializeInc/rules_rust/releases/download/v0.54.2/cargo-bazel-aarch64-apple-darwin",
56-
"x86_64-apple-darwin": "https://github.com/MaterializeInc/rules_rust/releases/download/v0.54.2/cargo-bazel-x86_64-apple-darwin",
57-
"aarch64-unknown-linux-gnu": "https://github.com/MaterializeInc/rules_rust/releases/download/v0.54.2/cargo-bazel-aarch64-unknown-linux-gnu",
58-
"x86_64-unknown-linux-gnu": "https://github.com/MaterializeInc/rules_rust/releases/download/v0.54.2/cargo-bazel-x86_64-unknown-linux-gnu",
59-
},
6054
generator_sha256s = {
61-
"aarch64-apple-darwin": "8204746334a17823bd6a54ce2c3821b0bdca96576700d568e2ca2bd8224dc0ea",
62-
"x86_64-apple-darwin": "2ee14b230d32c05415852b7a388b76e700c87c506459e5b31ced19d6c131b6d0",
63-
"aarch64-unknown-linux-gnu": "3792feb084bd43b9a7a9cd75be86ee9910b46db59360d6b29c9cca2f8889a0aa",
64-
"x86_64-unknown-linux-gnu": "2b9d07f34694f63f0cc704989ad6ec148ff8d126579832f4f4d88edea75875b2",
55+
"aarch64-apple-darwin": "c38c9c0efc11fcf9c32b9e0f4f4849df7c823f207c7f5ba5f6ab1e0e2167693d",
56+
"aarch64-unknown-linux-gnu": "5bdc9a10ec5f17f5140a81ce7cb0c0ce6e82d4d862d3ce3a301ea23f72f20630",
57+
"x86_64-unknown-linux-gnu": "abcd8212d64ea4c0f5e856af663c05ebeb2800a02c251f6eb62061f4e8ca1735",
58+
},
59+
generator_urls = {
60+
"aarch64-apple-darwin": "https://github.com/MaterializeInc/rules_rust/releases/download/mz-0.59.3/cargo-bazel-aarch64-apple-darwin",
61+
"aarch64-unknown-linux-gnu": "https://github.com/MaterializeInc/rules_rust/releases/download/mz-0.59.3/cargo-bazel-aarch64-unknown-linux-gnu",
62+
"x86_64-unknown-linux-gnu": "https://github.com/MaterializeInc/rules_rust/releases/download/mz-0.59.3/cargo-bazel-x86_64-unknown-linux-gnu",
6563
},
6664
isolated = False,
6765
# Only used if developing rules_rust.

misc/bazel/toolchains/BUILD.bazel

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Note: These registrations live here, and not in the `WORKSPACE` file or a
2727
See: <https://bazel.build/extending/toolchains>
2828
"""
2929

30-
load("@rules_rust//bindgen:defs.bzl", "rust_bindgen_toolchain")
30+
load("@rules_rust_bindgen//:defs.bzl", "rust_bindgen_toolchain")
3131

3232
# Rust Bindgen Toolchains
3333
#
@@ -38,7 +38,7 @@ load("@rules_rust//bindgen:defs.bzl", "rust_bindgen_toolchain")
3838
# Darwin aarch64
3939
rust_bindgen_toolchain(
4040
name = "bindgen_toolchain_darwin__aarch64",
41-
bindgen = "@rules_rust//bindgen/3rdparty:bindgen",
41+
bindgen = "@rules_rust_bindgen//3rdparty:bindgen",
4242
clang = "@rust_bindgen__darwin_aarch64//:clang",
4343
libclang = "@rust_bindgen__darwin_aarch64//:libclang",
4444
libstdcxx = "@rust_bindgen__darwin_aarch64//:libc++",
@@ -50,14 +50,14 @@ toolchain(
5050
"@platforms//os:macos",
5151
],
5252
toolchain = "bindgen_toolchain_darwin__aarch64",
53-
toolchain_type = "@rules_rust//bindgen:toolchain_type",
53+
toolchain_type = "@rules_rust_bindgen//:toolchain_type",
5454
visibility = ["//visibility:public"],
5555
)
5656

5757
# Darwin x86_64
5858
rust_bindgen_toolchain(
5959
name = "bindgen_toolchain_darwin__x86_64",
60-
bindgen = "@rules_rust//bindgen/3rdparty:bindgen",
60+
bindgen = "@rules_rust_bindgen//3rdparty:bindgen",
6161
clang = "@rust_bindgen__darwin_x86_64//:clang",
6262
libclang = "@rust_bindgen__darwin_x86_64//:libclang",
6363
libstdcxx = "@rust_bindgen__darwin_x86_64//:libc++",
@@ -70,14 +70,14 @@ toolchain(
7070
"@platforms//cpu:x86_64",
7171
],
7272
toolchain = "bindgen_toolchain_darwin__x86_64",
73-
toolchain_type = "@rules_rust//bindgen:toolchain_type",
73+
toolchain_type = "@rules_rust_bindgen//:toolchain_type",
7474
visibility = ["//visibility:public"],
7575
)
7676

7777
# Linux aarch64
7878
rust_bindgen_toolchain(
7979
name = "bindgen_toolchain_linux__aarch64",
80-
bindgen = "@rules_rust//bindgen/3rdparty:bindgen",
80+
bindgen = "@rules_rust_bindgen//3rdparty:bindgen",
8181
clang = "@rust_bindgen__linux_aarch64//:clang",
8282
libclang = "@rust_bindgen__linux_aarch64//:libclang",
8383
libstdcxx = "@rust_bindgen__linux_aarch64//:libc++",
@@ -90,14 +90,14 @@ toolchain(
9090
"@platforms//cpu:aarch64",
9191
],
9292
toolchain = "bindgen_toolchain_linux__aarch64",
93-
toolchain_type = "@rules_rust//bindgen:toolchain_type",
93+
toolchain_type = "@rules_rust_bindgen//:toolchain_type",
9494
visibility = ["//visibility:public"],
9595
)
9696

9797
# Linux x86_64
9898
rust_bindgen_toolchain(
9999
name = "bindgen_toolchain_linux__x86_64",
100-
bindgen = "@rules_rust//bindgen/3rdparty:bindgen",
100+
bindgen = "@rules_rust_bindgen//3rdparty:bindgen",
101101
clang = "@rust_bindgen__linux_x86_64//:clang",
102102
libclang = "@rust_bindgen__linux_x86_64//:libclang",
103103
libstdcxx = "@rust_bindgen__linux_x86_64//:libc++",
@@ -110,6 +110,6 @@ toolchain(
110110
"@platforms//cpu:x86_64",
111111
],
112112
toolchain = "bindgen_toolchain_linux__x86_64",
113-
toolchain_type = "@rules_rust//bindgen:toolchain_type",
113+
toolchain_type = "@rules_rust_bindgen//:toolchain_type",
114114
visibility = ["//visibility:public"],
115115
)

misc/python/materialize/cargo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def __init__(self, root: Path):
148148
self.crates[crate.name] = crate
149149
self.exclude: dict[str, Crate] = {}
150150
for path in workspace_config.get("exclude", []):
151-
if path.endswith("*"):
151+
if path.endswith("*") and (root / path.rstrip("*")).exists():
152152
for item in (root / path.rstrip("*")).iterdir():
153153
if item.is_dir() and (item / "Cargo.toml").exists():
154154
crate = Crate(root, root / item)

src/build-tools/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ rust_library(
2828
"bazel",
2929
],
3030
data = [
31-
"@protobuf//:protoc",
32-
"@protobuf//:well_known_type_protos",
31+
"@com_google_protobuf//:protoc",
32+
"@com_google_protobuf//:well_known_type_protos",
3333
],
3434
lint_config = ":lints",
3535
proc_macro_deps = [] + all_crate_deps(proc_macro = True),

src/build-tools/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ normal = ["workspace-hack"]
2626
features_override = ["default", "bazel"]
2727
extra_deps = ["@rules_rust//tools/runfiles"]
2828
data = [
29-
"@protobuf//:protoc",
30-
"@protobuf//:well_known_type_protos",
29+
"@com_google_protobuf//:protoc",
30+
"@com_google_protobuf//:well_known_type_protos",
3131
]
3232
rustc_flags = ["--cfg=bazel"]
3333

src/build-tools/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub fn protoc() -> PathBuf {
4949
cfg_if! {
5050
if #[cfg(bazel)] {
5151
let r = runfiles::Runfiles::create().unwrap();
52-
r.rlocation("protobuf/protoc").expect("set by Bazel")
52+
r.rlocation("com_google_protobuf/protoc").expect("set by Bazel")
5353
} else if #[cfg(feature = "protobuf-src")] {
5454
protobuf_src::protoc()
5555
} else {
@@ -70,7 +70,7 @@ pub fn protoc_include() -> PathBuf {
7070
cfg_if! {
7171
if #[cfg(bazel)] {
7272
let r = runfiles::Runfiles::create().unwrap();
73-
r.rlocation("protobuf/src").expect("set by Bazel")
73+
r.rlocation("com_google_protobuf/src").expect("set by Bazel")
7474
} else if #[cfg(feature = "protobuf-src")] {
7575
protobuf_src::include()
7676
} else {

0 commit comments

Comments
 (0)