[codex] Preserve build-script dependencies in rules_rs annotations (#27322)

## Why

Bazel compiles Cargo build scripts in the exec configuration. For
`openssl-sys`, that means the target-specific optional `openssl-src`
dependency can disappear when producing musl release binaries, even
though the build script still needs the vendored source crate.

## What changed

Patch `rules_rs` to expose its existing unconditional
`build_script_deps` input through `crate.annotation`, then annotate
`openssl-sys` with the pinned `openssl-src` target. Target-derived build
dependencies continue to use the existing selected dependency path.

## Validation

- `just bazel-lock-check`

Stack: 2 of 6. Follows #27321.
This commit is contained in:
Adam Perry @ OpenAI
2026-06-10 17:08:35 -07:00
committed by GitHub
parent b39f943a63
commit ac9c534c21
3 changed files with 67 additions and 0 deletions

View File

@@ -94,6 +94,7 @@ single_version_override(
module_name = "rules_rs",
patch_strip = 1,
patches = [
"//patches:rules_rs_build_script_deps_annotation.patch",
"//patches:rules_rs_windows_gnullvm_exec.patch",
"//patches:rules_rs_windows_exec_linker.patch",
],
@@ -295,6 +296,11 @@ bazel_dep(name = "openssl", version = "3.5.4.bcr.0")
inject_repo(crate, "xz")
crate.annotation(
# Build scripts compile in Bazel's exec configuration, so target-specific
# optional build deps are otherwise dropped for the musl release platforms.
build_script_deps = [
"@crates//:openssl-src-300.5.5+3.5.5",
],
build_script_data = [
"@openssl//:gen_dir",
],