rules_rsAPI docs @0.0.11

@rules_rs//rs:extensions.bzl

Module Extensions

crate
Tag Classes
annotation

A collection of extra attributes and settings for a particular crate.

AttributeTypeDescription
*cratestring

The name of the crate the annotation is applied to

repositorieslist of strings

A list of repository names specified from crate.from_cargo(name=...) that this annotation is applied to. Defaults to all repositories.

Default: []
additive_build_filelabel

A file containing extra contents to write to the bottom of generated BUILD files.

Default: None
additive_build_file_contentstring

Extra contents to write to the bottom of generated BUILD files.

Default: ""
build_script_datalist of strings

A list of labels to add to a crate's cargo_build_script::data attribute.

Default: []
build_script_data_selectdictionary: String → List of strings

A list of labels to add to a crate's cargo_build_script::data attribute. Keys should be the platform triplet. Value should be a list of labels.

Default: {}
build_script_envdictionary: String → String

Additional environment variables to set on a crate's cargo_build_script::env attribute.

Default: {}
build_script_env_selectdictionary: String → String

Additional environment variables to set on a crate's cargo_build_script::env attribute. Key should be the platform triplet. Value should be a JSON encoded dictionary mapping variable names to values, for example {"FOO": "bar"}.

Default: {}
build_script_toolchainslist of labels

A list of labels to set on a crates's cargo_build_script::toolchains attribute.

Default: []
crate_featureslist of strings

A list of strings to add to a crate's rust_library::crate_features attribute.

Default: []
datalist of strings

A list of labels to add to a crate's rust_library::data attribute.

Default: []
depslist of strings

A list of labels to add to a crate's rust_library::deps attribute.

Default: []
gen_build_scriptstring

An authoritative flag to determine whether or not to produce cargo_build_script targets for the current crate. Supported values are 'on', 'off', and 'auto'.

Default: "auto"
patch_argslist of strings

The patch_args attribute of a Bazel repository rule. See http_archive.patch_args

Default: []
patch_toolstring

The patch_tool attribute of a Bazel repository rule. See http_archive.patch_tool

Default: ""
patcheslist of labels

The patches attribute of a Bazel repository rule. See http_archive.patches

Default: []
rustc_flagslist of strings

A list of strings to set on a crate's rust_library::rustc_flags attribute.

Default: []
strip_prefixstring
Default: ""
workspace_cargo_tomlstring

For crates from git, the ruleset assumes the (workspace) Cargo.toml is in the repo root. This attribute overrides the assumption.

Default: "Cargo.toml"
from_cargo

Generates a repo @crates from a Cargo.toml / Cargo.lock pair.

AttributeTypeDescription
namename

The name of the repo to generate

Default: "crates"
cargo_tomllabel

The workspace-level Cargo.toml. There can be multiple crates in the workspace.

Default: None
cargo_locklabel
Default: None
cargo_configlabel
Default: None
use_home_cargo_credentialsboolean

If set, the ruleset will load ~/cargo/credentials.toml and attach those credentials to registry requests.

Default: False
*platform_tripleslist of strings

The set of triples to resolve for. They must correspond to the union of any exec/target platforms that will participate in your build.

debugboolean
Default: False