diff --git a/docs/src/cargo.md b/docs/src/cargo.md index e54f5328d9..b82f17dee2 100644 --- a/docs/src/cargo.md +++ b/docs/src/cargo.md @@ -179,8 +179,9 @@ str: A json encoded string of the environment variables
 cargo_bootstrap_repository(name, srcs, binary, build_mode, cargo_config, cargo_lockfile, cargo_toml,
-                           env, env_label, repo_mapping, rust_toolchain_cargo_template,
-                           rust_toolchain_rustc_template, timeout, version)
+                           compressed_windows_toolchain_names, env, env_label, repo_mapping,
+                           rust_toolchain_cargo_template, rust_toolchain_rustc_template, timeout,
+                           version)
 
A rule for bootstrapping a Rust binary using [Cargo](https://doc.rust-lang.org/cargo/) @@ -197,6 +198,7 @@ A rule for bootstrapping a Rust binary using [Cargo](https://doc.rust-lang.org/c | cargo_config | The path of the Cargo configuration (`Config.toml`) file. | Label | optional | `None` | | cargo_lockfile | The lockfile of the crate_universe resolver | Label | required | | | cargo_toml | The path of the `Cargo.toml` file. | Label | required | | +| compressed_windows_toolchain_names | Wether or not the toolchain names of windows toolchains are expected to be in a `compressed` format. | Boolean | optional | `True` | | env | A mapping of platform triple to a set of environment variables. See [cargo_env](#cargo_env) for usage details. Additionally, the platform triple `*` applies to all platforms. | Dictionary: String -> String | optional | `{}` | | env_label | A mapping of platform triple to a set of environment variables. This attribute differs from `env` in that all variables passed here must be fully qualified labels of files. See [cargo_env](#cargo_env) for usage details. Additionally, the platform triple `*` applies to all platforms. | Dictionary: String -> String | optional | `{}` | | repo_mapping | In `WORKSPACE` context only: a dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.

For example, an entry `"@foo": "@bar"` declares that, for any time this repository depends on `@foo` (such as a dependency on `@foo//some:target`, it should actually resolve that dependency within globally-declared `@bar` (`@bar//some:target`).

This attribute is _not_ supported in `MODULE.bazel` context (when invoking a repository rule inside a module extension's implementation function). | Dictionary: String -> String | optional | | diff --git a/docs/src/crate_universe.md b/docs/src/crate_universe.md index 834f3f6b1b..11b7831c26 100644 --- a/docs/src/crate_universe.md +++ b/docs/src/crate_universe.md @@ -750,12 +750,12 @@ str: A json encoded string of the parameters provided ## crates_repository
-crates_repository(name, annotations, cargo_config, cargo_lockfile, generate_binaries,
-                  generate_build_scripts, generate_target_compatible_with, generator,
-                  generator_sha256s, generator_urls, isolated, lockfile, manifests, packages, quiet,
-                  render_config, repin_instructions, repo_mapping, rust_toolchain_cargo_template,
-                  rust_toolchain_rustc_template, rust_version, splicing_config,
-                  supported_platform_triples)
+crates_repository(name, annotations, cargo_config, cargo_lockfile,
+                  compressed_windows_toolchain_names, generate_binaries, generate_build_scripts,
+                  generate_target_compatible_with, generator, generator_sha256s, generator_urls,
+                  isolated, lockfile, manifests, packages, quiet, render_config, repin_instructions,
+                  repo_mapping, rust_toolchain_cargo_template, rust_toolchain_rustc_template,
+                  rust_version, splicing_config, supported_platform_triples)
 
A rule for defining and downloading Rust dependencies (crates). This rule @@ -856,6 +856,7 @@ CARGO_BAZEL_REPIN=1 CARGO_BAZEL_REPIN_ONLY=crate_index bazel sync --only=crate_i | annotations | Extra settings to apply to crates. See [crate.annotation](#crateannotation). | Dictionary: String -> List of strings | optional | `{}` | | cargo_config | A [Cargo configuration](https://doc.rust-lang.org/cargo/reference/config.html) file | Label | optional | `None` | | cargo_lockfile | The path used to store the `crates_repository` specific [Cargo.lock](https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html) file. In the case that your `crates_repository` corresponds directly with an existing `Cargo.toml` file which has a paired `Cargo.lock` file, that `Cargo.lock` file should be used here, which will keep the versions used by cargo and bazel in sync. | Label | required | | +| compressed_windows_toolchain_names | Wether or not the toolchain names of windows toolchains are expected to be in a `compressed` format. | Boolean | optional | `True` | | generate_binaries | Whether to generate `rust_binary` targets for all the binary crates in every package. By default only the `rust_library` targets are generated. | Boolean | optional | `False` | | generate_build_scripts | Whether or not to generate [cargo build scripts](https://doc.rust-lang.org/cargo/reference/build-scripts.html) by default. | Boolean | optional | `True` | | generate_target_compatible_with | DEPRECATED: Moved to `render_config`. | Boolean | optional | `True` | diff --git a/docs/src/flatten.md b/docs/src/flatten.md index ac77bf0aa5..7171503d0d 100644 --- a/docs/src/flatten.md +++ b/docs/src/flatten.md @@ -1362,7 +1362,7 @@ str: The name of a registerable rust_analyzer_toolchain. rust_register_toolchains(dev_components, edition, allocator_library, global_allocator_library, register_toolchains, rustfmt_version, rust_analyzer_version, sha256s, extra_target_triples, extra_rustc_flags, extra_exec_rustc_flags, urls, - versions, aliases, hub_name) + versions, aliases, hub_name, compact_windows_names) Emits a default set of toolchains for Linux, MacOS, and Freebsd @@ -1402,6 +1402,7 @@ See `load_arbitrary_tool` in `@rules_rust//rust:repositories.bzl` for more detai | versions | A list of toolchain versions to download. This parameter only accepts one versions per channel. E.g. `["1.65.0", "nightly/2022-11-02", "beta/2020-12-30"]`. | `["1.83.0", "nightly/2024-11-28"]` | | aliases | A mapping of "full" repository name to another name to use instead. | `{}` | | hub_name | The name of the bzlmod hub repository for toolchains. | `None` | +| compact_windows_names | Whether or not to produce compact repository names for windows toolchains. This is to avoid MAX_PATH issues. | `True` | @@ -1431,7 +1432,7 @@ rust_repository_set(name, global_allocator_library, extra_target_triples, rustfmt_version, edition, dev_components, extra_rustc_flags, extra_exec_rustc_flags, opt_level, sha256s, urls, auth, netrc, auth_patterns, register_toolchain, exec_compatible_with, - default_target_compatible_with, aliases) + default_target_compatible_with, aliases, compact_windows_names) Assembles a remote repository for the given toolchain params, produces a proxy repository to contain the toolchain declaration, and registers the toolchains. @@ -1463,6 +1464,7 @@ Assembles a remote repository for the given toolchain params, produces a proxy r | exec_compatible_with | A list of constraints for the execution platform for this toolchain. | `None` | | default_target_compatible_with | A list of constraints for the target platform for this toolchain when the exec platform is the same as the target platform. | `None` | | aliases | Replacement names to use for toolchains created by this macro. | `{}` | +| compact_windows_names | Whether or not to produce compact repository names for windows toolchains. This is to avoid MAX_PATH issues. | `True` | @@ -1697,8 +1699,9 @@ generated source files are also ignored by this aspect.
 cargo_bootstrap_repository(name, srcs, binary, build_mode, cargo_config, cargo_lockfile, cargo_toml,
-                           env, env_label, repo_mapping, rust_toolchain_cargo_template,
-                           rust_toolchain_rustc_template, timeout, version)
+                           compressed_windows_toolchain_names, env, env_label, repo_mapping,
+                           rust_toolchain_cargo_template, rust_toolchain_rustc_template, timeout,
+                           version)
 
A rule for bootstrapping a Rust binary using [Cargo](https://doc.rust-lang.org/cargo/) @@ -1715,6 +1718,7 @@ A rule for bootstrapping a Rust binary using [Cargo](https://doc.rust-lang.org/c | cargo_config | The path of the Cargo configuration (`Config.toml`) file. | Label | optional | `None` | | cargo_lockfile | The lockfile of the crate_universe resolver | Label | required | | | cargo_toml | The path of the `Cargo.toml` file. | Label | required | | +| compressed_windows_toolchain_names | Wether or not the toolchain names of windows toolchains are expected to be in a `compressed` format. | Boolean | optional | `True` | | env | A mapping of platform triple to a set of environment variables. See [cargo_env](#cargo_env) for usage details. Additionally, the platform triple `*` applies to all platforms. | Dictionary: String -> String | optional | `{}` | | env_label | A mapping of platform triple to a set of environment variables. This attribute differs from `env` in that all variables passed here must be fully qualified labels of files. See [cargo_env](#cargo_env) for usage details. Additionally, the platform triple `*` applies to all platforms. | Dictionary: String -> String | optional | `{}` | | repo_mapping | In `WORKSPACE` context only: a dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.

For example, an entry `"@foo": "@bar"` declares that, for any time this repository depends on `@foo` (such as a dependency on `@foo//some:target`, it should actually resolve that dependency within globally-declared `@bar` (`@bar//some:target`).

This attribute is _not_ supported in `MODULE.bazel` context (when invoking a repository rule inside a module extension's implementation function). | Dictionary: String -> String | optional | | diff --git a/docs/src/rust_repositories.md b/docs/src/rust_repositories.md index 28f9b7bc39..c3c259e434 100644 --- a/docs/src/rust_repositories.md +++ b/docs/src/rust_repositories.md @@ -177,7 +177,7 @@ str: The name of a registerable rust_analyzer_toolchain. rust_register_toolchains(dev_components, edition, allocator_library, global_allocator_library, register_toolchains, rustfmt_version, rust_analyzer_version, sha256s, extra_target_triples, extra_rustc_flags, extra_exec_rustc_flags, urls, - versions, aliases, hub_name) + versions, aliases, hub_name, compact_windows_names) Emits a default set of toolchains for Linux, MacOS, and Freebsd @@ -217,6 +217,7 @@ See `load_arbitrary_tool` in `@rules_rust//rust:repositories.bzl` for more detai | versions | A list of toolchain versions to download. This parameter only accepts one versions per channel. E.g. `["1.65.0", "nightly/2022-11-02", "beta/2020-12-30"]`. | `["1.83.0", "nightly/2024-11-28"]` | | aliases | A mapping of "full" repository name to another name to use instead. | `{}` | | hub_name | The name of the bzlmod hub repository for toolchains. | `None` | +| compact_windows_names | Whether or not to produce compact repository names for windows toolchains. This is to avoid MAX_PATH issues. | `True` | @@ -246,7 +247,7 @@ rust_repository_set(name, global_allocator_library, extra_target_triples, rustfmt_version, edition, dev_components, extra_rustc_flags, extra_exec_rustc_flags, opt_level, sha256s, urls, auth, netrc, auth_patterns, register_toolchain, exec_compatible_with, - default_target_compatible_with, aliases) + default_target_compatible_with, aliases, compact_windows_names) Assembles a remote repository for the given toolchain params, produces a proxy repository to contain the toolchain declaration, and registers the toolchains. @@ -278,6 +279,7 @@ Assembles a remote repository for the given toolchain params, produces a proxy r | exec_compatible_with | A list of constraints for the execution platform for this toolchain. | `None` | | default_target_compatible_with | A list of constraints for the target platform for this toolchain when the exec platform is the same as the target platform. | `None` | | aliases | Replacement names to use for toolchains created by this macro. | `{}` | +| compact_windows_names | Whether or not to produce compact repository names for windows toolchains. This is to avoid MAX_PATH issues. | `True` |