Skip to content

Commit 35327b4

Browse files
committed
bazel/wasm: upgrade wasmtime from 32.0.0 to 42.0.2
Additional changes required by the upgrade: - Bump Rust toolchain from 1.86.0 to 1.91.0 (wasmtime 42 MSRV) - Add PULLEY and ALL_ARCH feature flags to wasmtime.BUILD conf.h template substitutions (new in wasmtime 42) - Remove wasmtime_config_async_support_set() call: async support is now implicit, the separate toggle was deprecated and removed from the C API (bytecodealliance/wasmtime#12371) - Bump rules_rust 0.60.0 -> 0.70.0 and opt in to experimental_use_allocator_libraries_with_mangled_symbols so the mangled __rustc::* allocator shim symbols (introduced in rustc 1.87+) are provided when a Rust staticlib is linked into a cc_binary via cc_common.link. Without this flag the link fails with undefined references to __rustc::__rust_alloc, __rustc::__rust_dealloc, etc. Background: - Issue: bazelbuild/rules_rust#3459 - Fix PR: bazelbuild/rules_rust#3403 - Landed in rules_rust 0.63.0 as an opt-in setting. - Mirror the rustc tarball through vectorized-public to reduce dependence on static.rust-lang.org. - Incidental: bump bazel_skylib 1.8.1 -> 1.8.2 and rules_shell 0.4.1 -> 0.6.1 to silence direct-dependency version warnings pulled in by the new rules_rust.
1 parent 8ca1550 commit 35327b4

7 files changed

Lines changed: 928 additions & 1167 deletions

File tree

.bazelrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ build --@rules_go//go/config:pure
1717
build:gofips --//bazel:gofips=True --@rules_go//go/toolchain:sdk_name=go_sdk_with_systemcrypto
1818
build:gofips --@rules_go//go/config:pure=false
1919

20+
#################
21+
# Rust settings #
22+
#################
23+
24+
# Use rules_rust's Rust-side allocator_library that defines the
25+
# mangled `__rustc::*` allocator shim symbols (rust_alloc,
26+
# rust_dealloc, etc.). The default cc_allocator_library predates the
27+
# allocator-symbol mangling in rustc 1.87+ and leaves those symbols
28+
# undefined when a Rust staticlib is linked into a cc_binary via
29+
# cc_common.link. See bazelbuild/rules_rust#3459.
30+
build --@rules_rust//rust/settings:experimental_use_allocator_libraries_with_mangled_symbols=True
31+
32+
# end of rust settings #
33+
2034
# Improve caching and readability of filepaths that the compiler uses by not using
2135
# absolute paths, and instead use paths that are relative to the redpanda repo.
2236
# https://github.com/bazel-contrib/toolchains_llvm/pull/445#issuecomment-2605443516

MODULE.bazel

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use_repo(
1919

2020
bazel_dep(name = "gazelle", version = "0.45.0")
2121
bazel_dep(name = "abseil-cpp", version = "20250814.0")
22-
bazel_dep(name = "bazel_skylib", version = "1.8.1")
22+
bazel_dep(name = "bazel_skylib", version = "1.8.2")
2323
bazel_dep(name = "crc32c", version = "1.1.0")
2424
bazel_dep(name = "fmt", version = "12.1.0")
2525
bazel_dep(name = "googletest", version = "1.17.0")
@@ -52,7 +52,7 @@ bazel_dep(name = "rules_go", version = "0.59.0")
5252
bazel_dep(name = "rules_pkg", version = "1.0.1")
5353
bazel_dep(name = "rules_proto", version = "7.1.0")
5454
bazel_dep(name = "rules_python", version = "1.6.0")
55-
bazel_dep(name = "rules_rust", version = "0.60.0")
55+
bazel_dep(name = "rules_rust", version = "0.70.0")
5656
bazel_dep(name = "snappy", version = "1.2.1")
5757
bazel_dep(name = "yaml-cpp", version = "0.8.0")
5858
bazel_dep(name = "zlib", version = "1.3.1.bcr.6")
@@ -69,7 +69,7 @@ single_version_override(
6969
],
7070
)
7171

72-
bazel_dep(name = "rules_shell", version = "0.4.1", dev_dependency = True)
72+
bazel_dep(name = "rules_shell", version = "0.6.1", dev_dependency = True)
7373

7474
bazel_dep(name = "protovalidate", version = "1.0.0")
7575

@@ -350,7 +350,16 @@ rust.toolchain(
350350
"aarch64-unknown-linux-gnu",
351351
"x86_64-unknown-linux-gnu",
352352
],
353-
versions = ["1.86.0"],
353+
# Prefer our S3 mirror for the rustc tarball (static.rust-lang.org is
354+
# frequently slow from some POPs). Only the `rustc-*` component is
355+
# mirrored; other components (rust-std, cargo, clippy, rustfmt,
356+
# llvm-tools, rust-src) 404 on the mirror and fall through to the
357+
# upstream URL automatically.
358+
urls = [
359+
"https://vectorized-public.s3.us-west-2.amazonaws.com/dependencies/{}.tar.xz",
360+
"https://static.rust-lang.org/dist/{}.tar.xz",
361+
],
362+
versions = ["1.91.0"],
354363
)
355364
use_repo(rust, "rust_toolchains")
356365

MODULE.bazel.lock

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

0 commit comments

Comments
 (0)