Skip to content

Conversation

@UebelAndre
Copy link
Collaborator

This allows users of rules_rust to define their own rust_host_tools modules and use it with crate_universe to control the versions of rustc and cargo used by it.

For example:

rust_host_tools = use_extension("@rules_rust//rust:extensions.bzl", "rust_host_tools")
rust_host_tools.host_tools(
    name = "my_rust_host_tools",
    version = "1.86.0",
)
use_repo(
    rust_host_tools,
    "my_rust_host_tools",
)

crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")

crate.from_cargo(
    name = "crate_index",
    manifests = ["//:Cargo.toml"],
    cargo_lockfile = "//:Cargo.lock",
    lockfile = "//:cargo-bazel-lock.json",
    host_tools = "@my_rust_host_tools",
)

use_repo(
    crate,
    "crate_index",
)

@UebelAndre UebelAndre requested a review from illicitonion April 25, 2025 13:38
@UebelAndre UebelAndre force-pushed the crate_universe_platforms branch from cc46a66 to c443978 Compare April 25, 2025 13:43
@UebelAndre UebelAndre force-pushed the crate_universe_platforms branch from c443978 to 749b93f Compare April 25, 2025 13:45
@UebelAndre UebelAndre marked this pull request as ready for review April 25, 2025 14:34
@UebelAndre UebelAndre enabled auto-merge April 25, 2025 14:34
@UebelAndre UebelAndre added this pull request to the merge queue Apr 25, 2025
Merged via the queue into bazelbuild:main with commit 0d6aac3 Apr 26, 2025
3 checks passed
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.

2 participants