Skip to content

Commit 8f6c207

Browse files
Updated Rust example 8 to run on downstream CI. (#555)
Fixes Rust example 8 on downstream CI, as discussed in #540 Replaces the previous PR #554 Signed-off-by: Marvin Hansen <[email protected]>
1 parent cd71fc8 commit 8f6c207

File tree

7 files changed

+150
-189
lines changed

7 files changed

+150
-189
lines changed

Diff for: .bazelci/tutorial-rust.yml

-4
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,12 @@ tasks:
5454
name: "Rust grpc"
5555
platform: ubuntu2204
5656
working_directory: ../rust-examples/08-grpc-client-server
57-
run_targets: # This step is needed to generate the vendor directory required for the build to succeed.
58-
- "//thirdparty:crates_vendor"
5957
build_targets:
6058
- "//..."
6159
rust-08-grpc-client-server-macos:
6260
name: "Rust grpc"
6361
platform: macos_arm64
6462
working_directory: ../rust-examples/08-grpc-client-server
65-
run_targets: # This step is needed to generate the vendor directory required for the build to succeed.
66-
- "//thirdparty:crates_vendor"
6763
build_targets:
6864
- "//..."
6965
rust-09-oci-container-linux:

Diff for: rust-examples/.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.0.1
1+
8.1.0

Diff for: rust-examples/08-grpc-client-server/MODULE.bazel

+67-12
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ bazel_dep(name = "toolchains_llvm", version = "1.2.0", dev_dependency = True)
2222
###############################################################################
2323
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
2424
llvm.toolchain(
25-
llvm_version = "18.1.8",
25+
llvm_version = "19.1.6-1",
2626
sha256 = {
2727
# Generate checksums with shasum -a 256 filename.tar.zst
28-
"darwin-aarch64": "41d8dea52d18c4e8b90c4fcd31965f9f297df9f40a38a33d60748dbe7f8330b8",
29-
"darwin-x86_64": "",
30-
"linux-aarch64": "",
31-
"linux-x86_64": "",
28+
"darwin-aarch64": "94ed965925dbdc25b29e6fcfa9a84b28d915d5c9da7c71405fc20bbcf8396bd1",
29+
"darwin-x86_64": "9395b07fd5018816bcaee84522d9c9386fdbefe62fdf8afff89b57e1b7095463",
30+
"linux-aarch64": "24fd3405f65ccbc39f0d14a5126ee2edb5904d7a9525ae483f34a510a1bdce3e",
31+
"linux-x86_64": "bad3d776c222c99056eba8b64c085a1e08edd783cb102e1b6eba43b78ce2fe2b",
3232
},
3333
stdlib = {
3434
"linux-x86_64": "stdc++",
3535
"linux-aarch64": "stdc++",
3636
},
3737
urls = {
38-
"darwin-aarch64": ["https://github.com/MaterializeInc/toolchains/releases/download/clang-18.1.8-4/darwin_aarch64.tar.zst"],
39-
"darwin-x86_64": ["https://github.com/MaterializeInc/toolchains/releases/download/clang-18.1.8-4/darwin_x86_64.tar.zst"],
40-
"linux-aarch64": ["https://github.com/MaterializeInc/toolchains/releases/download/clang-18.1.8-4/linux_aarch64.tar.zst"],
41-
"linux-x86_64": ["https://github.com/MaterializeInc/toolchains/releases/download/clang-18.1.8-4/linux_x86_64.tar.zst"],
38+
"darwin-aarch64": ["https://github.com/MaterializeInc/toolchains/releases/download/clang-19.1.6-1/darwin_aarch64.tar.zst"],
39+
"darwin-x86_64": ["https://github.com/MaterializeInc/toolchains/releases/download/clang-19.1.6-1/darwin_x86_64.tar.zst"],
40+
"linux-aarch64": ["https://github.com/MaterializeInc/toolchains/releases/download/clang-19.1.6-1/linux_aarch64.tar.zst"],
41+
"linux-x86_64": ["https://github.com/MaterializeInc/toolchains/releases/download/clang-19.1.6-1/linux_x86_64.tar.zst"],
4242
},
4343
)
4444

@@ -59,7 +59,62 @@ use_repo(rust, "rust_toolchains")
5959

6060
register_toolchains("@rust_toolchains//:all")
6161

62-
# Custom Rust Prost toolchain
63-
register_toolchains("@//build/prost_toolchain")
62+
# Custom Prost toolchain
63+
register_toolchains(
64+
"@//build/prost_toolchain",
65+
)
66+
67+
###############################################################################
68+
# Rust direct dependencies.
69+
# https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html#direct-dependencies
70+
###############################################################################
71+
crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
72+
73+
crate.spec(
74+
package = "prost",
75+
version = "0.13.0",
76+
)
77+
crate.spec(
78+
default_features = False,
79+
package = "prost-types",
80+
version = "0.13.0",
81+
)
82+
crate.spec(
83+
features = ["transport"],
84+
package = "tonic",
85+
version = "0.12.0",
86+
)
87+
crate.spec(
88+
package = "tonic-build",
89+
version = "0.12.0",
90+
)
91+
crate.spec(
92+
package = "protoc-gen-prost",
93+
version = "0.4",
94+
)
95+
crate.annotation(
96+
crate = "protoc-gen-prost",
97+
gen_binaries = ["protoc-gen-prost"],
98+
)
99+
crate.spec(
100+
package = "protoc-gen-tonic",
101+
version = "0.4",
102+
)
103+
crate.annotation(
104+
crate = "protoc-gen-tonic",
105+
gen_binaries = ["protoc-gen-tonic"],
106+
)
64107

65-
# Rust dependencies. See thirdparty/BUILD.bazel
108+
crate.spec(
109+
default_features = False,
110+
features = [
111+
"macros",
112+
"net",
113+
"rt-multi-thread",
114+
"signal",
115+
],
116+
package = "tokio",
117+
version = "1.39.3",
118+
)
119+
crate.from_specs()
120+
use_repo(crate, "crates")

0 commit comments

Comments
 (0)