Files
codex/patches/rules_rs_workspace_package_version.patch
T
Dmitriy Kovalenko 6ea82c59c6 Preserve Cargo package names in Bazel Rust builds (#51847)
## What changed

Expose resolved Cargo package names in `DEP_DATA`, set `CARGO_PKG_NAME` for Rust compilation, and pass the package name to build scripts. Propagate `rustc_env` to generated binary targets so they receive the same package metadata as libraries.

## Testing

Strengthen the packaged CLI smoke test to require `--version` to print exactly `codex-cli <version>`, using the workspace package version from `codex-rs/Cargo.toml`.

GitOrigin-RevId: 274b741067af76313358f44c1bd9b2521938fa9c
2026-10-07 22:08:04 +00:00

16 lines
667 B
Diff

# What: expose resolved Cargo workspace package names and versions in DEP_DATA.
# Scope: rules_rs workspace metadata only.
diff --git a/rs/private/cargo_workspace_graph.bzl b/rs/private/cargo_workspace_graph.bzl
--- a/rs/private/cargo_workspace_graph.bzl
+++ b/rs/private/cargo_workspace_graph.bzl
@@ -762,6 +762,8 @@ def workspace_dep_data(
"deps": deps,
"deps_by_platform": deps_by_platform,
"dev_deps": dev_deps,
"dev_deps_by_platform": dev_deps_by_platform,
+ "package_name": package["name"],
"shared_libraries": shared_libraries,
+ "version": package["version"],
}