diff --git a/docs/flatten.md b/docs/flatten.md index e4d6c4006c..79232250a6 100644 --- a/docs/flatten.md +++ b/docs/flatten.md @@ -27,8 +27,8 @@ ## rust_benchmark
-rust_benchmark(name, aliases, crate_features, crate_root, data, deps, edition, out_dir_tar,
-               proc_macro_deps, rustc_env, rustc_flags, srcs, version)
+rust_benchmark(name, aliases, compile_data, crate_features, crate_root, data, deps, edition,
+               out_dir_tar, proc_macro_deps, rustc_env, rustc_flags, srcs, version)
 
Builds a Rust benchmark test. @@ -114,9 +114,10 @@ Run the benchmark test using: `bazel run //fibonacci:fibonacci_bench`. | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | aliases | Remap crates to a new name or moniker for linkage to this target

These are other rust_library targets and will be presented as the new name given. | Dictionary: Label -> String | optional | {} | +| compile_data | List of files used by this rule at compile time.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | | crate_features | List of features to enable for this crate.

Features are defined in the code using the #[cfg(feature = "foo")] configuration option. The features listed here will be passed to rustc with --cfg feature="${feature_name}" flags. | List of strings | optional | [] | | crate_root | The file that will be passed to rustc to be used for building this crate.

If crate_root is not set, then this rule will look for a lib.rs file (or main.rs for rust_binary) or the single file in srcs if srcs contains only one file. | Label | optional | None | -| data | List of files used by this rule at runtime.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | +| data | List of files used by this rule at compile time and runtime.

If including data at compile time with include_str!() and similar, prefer compile_data over data, to prevent the data also being included in the runfiles. | List of labels | optional | [] | | deps | List of other libraries to be linked to this library target.

These can be either other rust_library targets or cc_library targets if linking a native library. | List of labels | optional | [] | | edition | The rust edition to use for this crate. Defaults to the edition specified in the rust_toolchain. | String | optional | "" | | out_dir_tar | __Deprecated__, do not use, see [#cargo_build_script] instead. | Label | optional | None | @@ -132,9 +133,9 @@ Run the benchmark test using: `bazel run //fibonacci:fibonacci_bench`. ## rust_binary
-rust_binary(name, aliases, crate_features, crate_root, crate_type, data, deps, edition,
-            linker_script, out_binary, out_dir_tar, proc_macro_deps, rustc_env, rustc_flags, srcs,
-            version)
+rust_binary(name, aliases, compile_data, crate_features, crate_root, crate_type, data, deps,
+            edition, linker_script, out_binary, out_dir_tar, proc_macro_deps, rustc_env, rustc_flags,
+            srcs, version)
 
Builds a Rust binary crate. @@ -228,10 +229,11 @@ Hello world | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | aliases | Remap crates to a new name or moniker for linkage to this target

These are other rust_library targets and will be presented as the new name given. | Dictionary: Label -> String | optional | {} | +| compile_data | List of files used by this rule at compile time.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | | crate_features | List of features to enable for this crate.

Features are defined in the code using the #[cfg(feature = "foo")] configuration option. The features listed here will be passed to rustc with --cfg feature="${feature_name}" flags. | List of strings | optional | [] | | crate_root | The file that will be passed to rustc to be used for building this crate.

If crate_root is not set, then this rule will look for a lib.rs file (or main.rs for rust_binary) or the single file in srcs if srcs contains only one file. | Label | optional | None | | crate_type | - | String | optional | "bin" | -| data | List of files used by this rule at runtime.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | +| data | List of files used by this rule at compile time and runtime.

If including data at compile time with include_str!() and similar, prefer compile_data over data, to prevent the data also being included in the runfiles. | List of labels | optional | [] | | deps | List of other libraries to be linked to this library target.

These can be either other rust_library targets or cc_library targets if linking a native library. | List of labels | optional | [] | | edition | The rust edition to use for this crate. Defaults to the edition specified in the rust_toolchain. | String | optional | "" | | linker_script | Link script to forward into linker via rustc options. | Label | optional | None | @@ -451,8 +453,8 @@ rust_binary( ## rust_library
-rust_library(name, aliases, crate_features, crate_root, crate_type, data, deps, edition,
-             out_dir_tar, proc_macro_deps, rustc_env, rustc_flags, srcs, version)
+rust_library(name, aliases, compile_data, crate_features, crate_root, crate_type, data, deps,
+             edition, out_dir_tar, proc_macro_deps, rustc_env, rustc_flags, srcs, version)
 
Builds a Rust library crate. @@ -526,10 +528,11 @@ INFO: Elapsed time: 1.245s, Critical Path: 1.01s | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | aliases | Remap crates to a new name or moniker for linkage to this target

These are other rust_library targets and will be presented as the new name given. | Dictionary: Label -> String | optional | {} | +| compile_data | List of files used by this rule at compile time.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | | crate_features | List of features to enable for this crate.

Features are defined in the code using the #[cfg(feature = "foo")] configuration option. The features listed here will be passed to rustc with --cfg feature="${feature_name}" flags. | List of strings | optional | [] | | crate_root | The file that will be passed to rustc to be used for building this crate.

If crate_root is not set, then this rule will look for a lib.rs file (or main.rs for rust_binary) or the single file in srcs if srcs contains only one file. | Label | optional | None | | crate_type | The type of linkage to use for building this library. Options include "lib", "rlib", "dylib", "cdylib", "staticlib", and "proc-macro".

The exact output file will depend on the toolchain used. | String | optional | "rlib" | -| data | List of files used by this rule at runtime.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | +| data | List of files used by this rule at compile time and runtime.

If including data at compile time with include_str!() and similar, prefer compile_data over data, to prevent the data also being included in the runfiles. | List of labels | optional | [] | | deps | List of other libraries to be linked to this library target.

These can be either other rust_library targets or cc_library targets if linking a native library. | List of labels | optional | [] | | edition | The rust edition to use for this crate. Defaults to the edition specified in the rust_toolchain. | String | optional | "" | | out_dir_tar | __Deprecated__, do not use, see [#cargo_build_script] instead. | Label | optional | None | @@ -643,8 +646,8 @@ See @io_bazel_rules_rust//proto:BUILD for examples of defining the toolchain. ## rust_test
-rust_test(name, aliases, crate, crate_features, crate_root, data, deps, edition, out_dir_tar,
-          proc_macro_deps, rustc_env, rustc_flags, srcs, version)
+rust_test(name, aliases, compile_data, crate, crate_features, crate_root, data, deps, edition,
+          out_dir_tar, proc_macro_deps, rustc_env, rustc_flags, srcs, version)
 
Builds a Rust test crate. @@ -783,10 +786,11 @@ Run the test with `bazel build //hello_lib:hello_lib_test`. | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | aliases | Remap crates to a new name or moniker for linkage to this target

These are other rust_library targets and will be presented as the new name given. | Dictionary: Label -> String | optional | {} | +| compile_data | List of files used by this rule at compile time.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | | crate | Target inline tests declared in the given crate

These tests are typically those that would be held out under #[cfg(test)] declarations. | Label | optional | None | | crate_features | List of features to enable for this crate.

Features are defined in the code using the #[cfg(feature = "foo")] configuration option. The features listed here will be passed to rustc with --cfg feature="${feature_name}" flags. | List of strings | optional | [] | | crate_root | The file that will be passed to rustc to be used for building this crate.

If crate_root is not set, then this rule will look for a lib.rs file (or main.rs for rust_binary) or the single file in srcs if srcs contains only one file. | Label | optional | None | -| data | List of files used by this rule at runtime.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | +| data | List of files used by this rule at compile time and runtime.

If including data at compile time with include_str!() and similar, prefer compile_data over data, to prevent the data also being included in the runfiles. | List of labels | optional | [] | | deps | List of other libraries to be linked to this library target.

These can be either other rust_library targets or cc_library targets if linking a native library. | List of labels | optional | [] | | edition | The rust edition to use for this crate. Defaults to the edition specified in the rust_toolchain. | String | optional | "" | | out_dir_tar | __Deprecated__, do not use, see [#cargo_build_script] instead. | Label | optional | None | diff --git a/docs/rust.md b/docs/rust.md index 405af98da1..44c6a261c7 100644 --- a/docs/rust.md +++ b/docs/rust.md @@ -9,8 +9,8 @@ ## rust_benchmark
-rust_benchmark(name, aliases, crate_features, crate_root, data, deps, edition, out_dir_tar,
-               proc_macro_deps, rustc_env, rustc_flags, srcs, version)
+rust_benchmark(name, aliases, compile_data, crate_features, crate_root, data, deps, edition,
+               out_dir_tar, proc_macro_deps, rustc_env, rustc_flags, srcs, version)
 
Builds a Rust benchmark test. @@ -96,9 +96,10 @@ Run the benchmark test using: `bazel run //fibonacci:fibonacci_bench`. | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | aliases | Remap crates to a new name or moniker for linkage to this target

These are other rust_library targets and will be presented as the new name given. | Dictionary: Label -> String | optional | {} | +| compile_data | List of files used by this rule at compile time.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | | crate_features | List of features to enable for this crate.

Features are defined in the code using the #[cfg(feature = "foo")] configuration option. The features listed here will be passed to rustc with --cfg feature="${feature_name}" flags. | List of strings | optional | [] | | crate_root | The file that will be passed to rustc to be used for building this crate.

If crate_root is not set, then this rule will look for a lib.rs file (or main.rs for rust_binary) or the single file in srcs if srcs contains only one file. | Label | optional | None | -| data | List of files used by this rule at runtime.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | +| data | List of files used by this rule at compile time and runtime.

If including data at compile time with include_str!() and similar, prefer compile_data over data, to prevent the data also being included in the runfiles. | List of labels | optional | [] | | deps | List of other libraries to be linked to this library target.

These can be either other rust_library targets or cc_library targets if linking a native library. | List of labels | optional | [] | | edition | The rust edition to use for this crate. Defaults to the edition specified in the rust_toolchain. | String | optional | "" | | out_dir_tar | __Deprecated__, do not use, see [#cargo_build_script] instead. | Label | optional | None | @@ -114,9 +115,9 @@ Run the benchmark test using: `bazel run //fibonacci:fibonacci_bench`. ## rust_binary
-rust_binary(name, aliases, crate_features, crate_root, crate_type, data, deps, edition,
-            linker_script, out_binary, out_dir_tar, proc_macro_deps, rustc_env, rustc_flags, srcs,
-            version)
+rust_binary(name, aliases, compile_data, crate_features, crate_root, crate_type, data, deps,
+            edition, linker_script, out_binary, out_dir_tar, proc_macro_deps, rustc_env, rustc_flags,
+            srcs, version)
 
Builds a Rust binary crate. @@ -210,10 +211,11 @@ Hello world | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | aliases | Remap crates to a new name or moniker for linkage to this target

These are other rust_library targets and will be presented as the new name given. | Dictionary: Label -> String | optional | {} | +| compile_data | List of files used by this rule at compile time.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | | crate_features | List of features to enable for this crate.

Features are defined in the code using the #[cfg(feature = "foo")] configuration option. The features listed here will be passed to rustc with --cfg feature="${feature_name}" flags. | List of strings | optional | [] | | crate_root | The file that will be passed to rustc to be used for building this crate.

If crate_root is not set, then this rule will look for a lib.rs file (or main.rs for rust_binary) or the single file in srcs if srcs contains only one file. | Label | optional | None | | crate_type | - | String | optional | "bin" | -| data | List of files used by this rule at runtime.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | +| data | List of files used by this rule at compile time and runtime.

If including data at compile time with include_str!() and similar, prefer compile_data over data, to prevent the data also being included in the runfiles. | List of labels | optional | [] | | deps | List of other libraries to be linked to this library target.

These can be either other rust_library targets or cc_library targets if linking a native library. | List of labels | optional | [] | | edition | The rust edition to use for this crate. Defaults to the edition specified in the rust_toolchain. | String | optional | "" | | linker_script | Link script to forward into linker via rustc options. | Label | optional | None | @@ -231,8 +233,8 @@ Hello world ## rust_library
-rust_library(name, aliases, crate_features, crate_root, crate_type, data, deps, edition,
-             out_dir_tar, proc_macro_deps, rustc_env, rustc_flags, srcs, version)
+rust_library(name, aliases, compile_data, crate_features, crate_root, crate_type, data, deps,
+             edition, out_dir_tar, proc_macro_deps, rustc_env, rustc_flags, srcs, version)
 
Builds a Rust library crate. @@ -306,10 +308,11 @@ INFO: Elapsed time: 1.245s, Critical Path: 1.01s | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | aliases | Remap crates to a new name or moniker for linkage to this target

These are other rust_library targets and will be presented as the new name given. | Dictionary: Label -> String | optional | {} | +| compile_data | List of files used by this rule at compile time.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | | crate_features | List of features to enable for this crate.

Features are defined in the code using the #[cfg(feature = "foo")] configuration option. The features listed here will be passed to rustc with --cfg feature="${feature_name}" flags. | List of strings | optional | [] | | crate_root | The file that will be passed to rustc to be used for building this crate.

If crate_root is not set, then this rule will look for a lib.rs file (or main.rs for rust_binary) or the single file in srcs if srcs contains only one file. | Label | optional | None | | crate_type | The type of linkage to use for building this library. Options include "lib", "rlib", "dylib", "cdylib", "staticlib", and "proc-macro".

The exact output file will depend on the toolchain used. | String | optional | "rlib" | -| data | List of files used by this rule at runtime.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | +| data | List of files used by this rule at compile time and runtime.

If including data at compile time with include_str!() and similar, prefer compile_data over data, to prevent the data also being included in the runfiles. | List of labels | optional | [] | | deps | List of other libraries to be linked to this library target.

These can be either other rust_library targets or cc_library targets if linking a native library. | List of labels | optional | [] | | edition | The rust edition to use for this crate. Defaults to the edition specified in the rust_toolchain. | String | optional | "" | | out_dir_tar | __Deprecated__, do not use, see [#cargo_build_script] instead. | Label | optional | None | @@ -325,8 +328,8 @@ INFO: Elapsed time: 1.245s, Critical Path: 1.01s ## rust_test
-rust_test(name, aliases, crate, crate_features, crate_root, data, deps, edition, out_dir_tar,
-          proc_macro_deps, rustc_env, rustc_flags, srcs, version)
+rust_test(name, aliases, compile_data, crate, crate_features, crate_root, data, deps, edition,
+          out_dir_tar, proc_macro_deps, rustc_env, rustc_flags, srcs, version)
 
Builds a Rust test crate. @@ -465,10 +468,11 @@ Run the test with `bazel build //hello_lib:hello_lib_test`. | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | aliases | Remap crates to a new name or moniker for linkage to this target

These are other rust_library targets and will be presented as the new name given. | Dictionary: Label -> String | optional | {} | +| compile_data | List of files used by this rule at compile time.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | | crate | Target inline tests declared in the given crate

These tests are typically those that would be held out under #[cfg(test)] declarations. | Label | optional | None | | crate_features | List of features to enable for this crate.

Features are defined in the code using the #[cfg(feature = "foo")] configuration option. The features listed here will be passed to rustc with --cfg feature="${feature_name}" flags. | List of strings | optional | [] | | crate_root | The file that will be passed to rustc to be used for building this crate.

If crate_root is not set, then this rule will look for a lib.rs file (or main.rs for rust_binary) or the single file in srcs if srcs contains only one file. | Label | optional | None | -| data | List of files used by this rule at runtime.

This attribute can be used to specify any data files that are embedded into the library, such as via the [include_str!](https://doc.rust-lang.org/std/macro.include_str!.html) macro. | List of labels | optional | [] | +| data | List of files used by this rule at compile time and runtime.

If including data at compile time with include_str!() and similar, prefer compile_data over data, to prevent the data also being included in the runfiles. | List of labels | optional | [] | | deps | List of other libraries to be linked to this library target.

These can be either other rust_library targets or cc_library targets if linking a native library. | List of labels | optional | [] | | edition | The rust edition to use for this crate. Defaults to the edition specified in the rust_toolchain. | String | optional | "" | | out_dir_tar | __Deprecated__, do not use, see [#cargo_build_script] instead. | Label | optional | None |