Skip to content

extensions: enable access to bindgen#31

Closed
bazaah wants to merge 78 commits into
hermeticbuild:mainfrom
bazaah:u/bazaah/open-bindgen-extension
Closed

extensions: enable access to bindgen#31
bazaah wants to merge 78 commits into
hermeticbuild:mainfrom
bazaah:u/bazaah/open-bindgen-extension

Conversation

@bazaah

@bazaah bazaah commented Jul 1, 2026

Copy link
Copy Markdown

This patch also removes the machinery for the "default" toolchain, namely all the llvm bits.

Consumers of bindgen will be expected to provide their own toolchain, which translates to @rules_rs (and users thereof)


See https://bazelbuild.slack.com/archives/C05UNC5AANQ/p1782926171232299?thread_ts=1782822956.695739&cid=C05UNC5AANQ for the context of where this is coming from.

dzbarsky and others added 30 commits June 13, 2026 21:57
Add support for tier 3 targets bpfeb-unknown-none and bpfel-unknown-none
(see

https://github.com/rust-lang/rust/blob/f5e2df7/src/doc/rustc/src/platform-support.md?plain=1#L311-L312).

This is modeled after bazelbuild#3507
and
should probably be updated if/when
bazelbuild/platforms#131 is merged.

(please use rebase merge when landing this as the proper commit message
is in the commit, rather than the PR description)

/cc @avrabe
…hollow rlibs: the RustcMetadata action runs rustc to completion with -Zno-codegen, emitting a .rlib archive. This approach mirrors the one used by buck2 and avoids needing to kill rustc mid-output in order to produce metadata.

While not fixing problems with SVH mismatches when non-determinism, this does simplify the codepath and uses a production tested technique that doesn't have any of the dangers associated with killing the rustc process while it's still active.
Port the sharding wrapper feature from bazelbuild#3774 into the hermeticbuild fork. The implementation wraps rust_test executables when experimental_enable_sharding is set while keeping rustc_compile_action's existing provider-list API for internal and extension callers.

rust_test now scans the returned providers to replace DefaultInfo for the wrapper, so extensions such as prost and wasm-bindgen continue to consume rustc_compile_action without API churn.

Co-authored-by: Brian Duff <bduff@linkedin.com>

Co-authored-by: Codex <noreply@openai.com>
Rustc emits GNU-like Windows staticlibs as lib<crate>.a, but rules_rust was stripping the lib prefix for all Windows non-rlib library outputs. Keep the prefix for staticlib outputs when the target ABI is gnu or gnullvm so declared outputs match rustc.
dzbarsky and others added 24 commits June 13, 2026 22:03
hermeticbuild#25)

rust_shared_library links the cc toolchain's C++ runtime
(libstdc++/libc++ and the unwinder) dynamically, so it becomes an
external DT_NEEDED on the produced shared library. When shipping a
self-contained .so to a consumer that uses a different C++ stdlib,
that dynamic dependency is undesirable.

Add a `cc_runtime_linkage` attribute on rust_shared_library
(dynamic|static, default dynamic so existing behavior is unchanged).
When static, the C++ runtime is linked via
cc_toolchain.static_runtime_lib so it is embedded in the shared
library and no libstdc++/libc++/libunwind DT_NEEDED is emitted.

get_cc_toolchain_runtime_libs gains a `linkage` parameter resolved
from the attribute. Non-shared crate types are unchanged.
Add documentation extraction targets for the public cargo and rust Starlark packages. Declare the bazel_features, selects, and cc_debug_helper_bzl dependencies required by those targets.
This patch also removes the machinery for the "default" toolchain,
namely all the llvm bits.

Consumers of bindgen will be expected to provide their own toolchain,
which translates to @rules_rs (and users thereof)
@bazaah

bazaah commented Jul 10, 2026

Copy link
Copy Markdown
Author

Closing (bindgen is now handled upstream in rules_rs entirely)

@bazaah bazaah closed this Jul 10, 2026
@bazaah bazaah deleted the u/bazaah/open-bindgen-extension branch July 10, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants