Skip to content

Use rules_rs from_cargo for Jrsonnet - #282

Open
zbarsky-openai wants to merge 2 commits into
bazel-contrib:masterfrom
zbarsky-openai:codex/rules-rs-migration
Open

Use rules_rs from_cargo for Jrsonnet#282
zbarsky-openai wants to merge 2 commits into
bazel-contrib:masterfrom
zbarsky-openai:codex/rules-rs-migration

Conversation

@zbarsky-openai

@zbarsky-openai zbarsky-openai commented Jul 22, 2026

Copy link
Copy Markdown

Migrate the Jrsonnet toolchain from rules_rust and crate-universe
from_specs to rules_rs and from_cargo. Add the minimal Cargo
package and lockfile, generate the existing Jrsonnet binary, use the
shared default Rust toolchain, cover Linux and macOS architectures, and
mark the Jsonnet extension and repository rule reproducible. This
removes the nightly host-tool downloads and avoids toolchain repository
name conflicts for consuming root modules.

Require rules_rs 0.0.95 because earlier releases generate an invalid
library target for the binary-only Jrsonnet crate and can mark ordinary
Linux hosts incompatible. The lockfile resolves Jrsonnet
0.5.0-pre97 from the existing ^0.5.0-pre95 requirement.

Update jsonnet and jsonnet_go to 0.22.0 for Bazel 9. Their earlier
versions use removed native C++ rules and select rules_go 0.53.0,
whose CcInfo reference aborts analysis for every compiler. The update
selects the compatible rules_go 0.59.0 without adding a redundant
direct dependency.

Validated on Linux with Bazel 9.1.0 and 9.2.0: the root build and all
25 Go, 25 C++, and 25 Rust example tests pass with test caching disabled.
The original migration was also validated with Bazel 8.4.2. Locked Cargo
metadata and strict Bzlmod resolution pass. Bazel reports the existing
bazel_skylib minimum-version warning; it does not affect the build.

@zbarsky-openai
zbarsky-openai marked this pull request as ready for review July 22, 2026 17:50
Bump jsonnet and jsonnet_go to 0.22.0 so their C++ and Go rules
load the external C++ providers required by Bazel 9. This also
updates the transitive rules_go version from 0.53.0 to 0.59.0.
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.

1 participant