Skip to content

Commit 576181d

Browse files
committed
bazel/wasm: upgrade wasmtime from 32.0.0 to 42.0.2
Re-land of 08fc3c5, which was reverted in 6116d3a (PR #30387) because the upgrade broke the `--config=lto` / `--config=pgo-instrument` link with: ld.lld: error: undefined symbol: __rustc::__rust_no_alloc_shim_is_unstable_v2 That LTO failure is fixed by the preceding commit switching the rust LTO mode from fat to thin; this commit re-introduces the upgrade unchanged. 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 33dc207 commit 576181d

7 files changed

Lines changed: 893 additions & 1080 deletions

File tree

.bazelrc

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

38+
#################
39+
# Rust settings #
40+
#################
41+
42+
# Use rules_rust's Rust-side allocator_library that defines the
43+
# mangled `__rustc::*` allocator shim symbols (rust_alloc,
44+
# rust_dealloc, etc.). The default cc_allocator_library predates the
45+
# allocator-symbol mangling in rustc 1.87+ and leaves those symbols
46+
# undefined when a Rust staticlib is linked into a cc_binary via
47+
# cc_common.link. See bazelbuild/rules_rust#3459.
48+
build --@rules_rust//rust/settings:experimental_use_allocator_libraries_with_mangled_symbols=True
49+
50+
# end of rust settings #
51+
3852
# Improve caching and readability of filepaths that the compiler uses by not using
3953
# absolute paths, and instead use paths that are relative to the redpanda repo.
4054
# https://github.com/bazel-contrib/toolchains_llvm/pull/445#issuecomment-2605443516

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ rust.toolchain(
351351
"aarch64-unknown-linux-gnu",
352352
"x86_64-unknown-linux-gnu",
353353
],
354-
versions = ["1.86.0"],
354+
versions = ["1.91.0"],
355355
)
356356
use_repo(rust, "rust_toolchains")
357357

MODULE.bazel.lock

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

0 commit comments

Comments
 (0)