You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build scripts are executed in the exec configuration, not the target
configuration, which means it's currently impossible to use values which
were generated as a result of the `--stamp` flag when creating a
`rust_binary`. This means that embedding things like build timestamps,
git shas, and dynamic version numbers, is impossible.
This change allows you to depend, in the target configuration (because
no transition occurs on the attribute) on the output of a genrule which
consumes data from the stable and volatile workspace status commands.
@@ -149,6 +149,7 @@ Run the benchmark test using: `bazel run //fibonacci:fibonacci_bench`.
149
149
| <aid="rust_benchmark-out_dir_tar"></a>out_dir_tar |__Deprecated__, do not use, see [#cargo_build_script] instead. | <ahref="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | None |
150
150
| <aid="rust_benchmark-proc_macro_deps"></a>proc_macro_deps | List of <code>rust_library</code> targets with kind <code>proc-macro</code> used to help build this library target. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
151
151
| <aid="rust_benchmark-rustc_env"></a>rustc_env | Dictionary of additional <code>"key": "value"</code> environment variables to set for rustc.<br><br>rust_test()/rust_binary() rules can use $(rootpath //package:target) to pass in the location of a generated file or external tool. Cargo build scripts that wish to expand locations should use cargo_build_script()'s build_script_env argument instead, as build scripts are run in a different environment - see cargo_build_script()'s documentation for more. | <ahref="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> String</a> | optional | {} |
152
+
| <aid="rust_benchmark-rustc_env_files"></a>rustc_env_files | Files containing additional environment variables to set for rustc.<br><br>These files should contain a single variable per line, of format <code>NAME=value</code>, and newlines may be included in a value by ending a line with a trailing back-slash (<code>\</code>).<br><br>The order that these files will be processed is unspecified, so multiple definitions of a particular variable are discouraged. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
152
153
| <aid="rust_benchmark-rustc_flags"></a>rustc_flags | List of compiler flags passed to <code>rustc</code>. | List of strings | optional |[]|
153
154
| <aid="rust_benchmark-srcs"></a>srcs | List of Rust <code>.rs</code> source files used to build the library.<br><br>If <code>srcs</code> contains more than one file, then there must be a file either named <code>lib.rs</code>. Otherwise, <code>crate_root</code> must be set to the source file that is the root of the crate to be passed to rustc to build this crate. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
154
155
| <aid="rust_benchmark-version"></a>version | A version to inject in the cargo environment variable. | String | optional | "0.0.0" |
@@ -160,8 +161,8 @@ Run the benchmark test using: `bazel run //fibonacci:fibonacci_bench`.
| <aid="rust_binary-out_dir_tar"></a>out_dir_tar |__Deprecated__, do not use, see [#cargo_build_script] instead. | <ahref="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | None |
268
269
| <aid="rust_binary-proc_macro_deps"></a>proc_macro_deps | List of <code>rust_library</code> targets with kind <code>proc-macro</code> used to help build this library target. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
269
270
| <aid="rust_binary-rustc_env"></a>rustc_env | Dictionary of additional <code>"key": "value"</code> environment variables to set for rustc.<br><br>rust_test()/rust_binary() rules can use $(rootpath //package:target) to pass in the location of a generated file or external tool. Cargo build scripts that wish to expand locations should use cargo_build_script()'s build_script_env argument instead, as build scripts are run in a different environment - see cargo_build_script()'s documentation for more. | <ahref="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> String</a> | optional | {} |
271
+
| <aid="rust_binary-rustc_env_files"></a>rustc_env_files | Files containing additional environment variables to set for rustc.<br><br>These files should contain a single variable per line, of format <code>NAME=value</code>, and newlines may be included in a value by ending a line with a trailing back-slash (<code>\</code>).<br><br>The order that these files will be processed is unspecified, so multiple definitions of a particular variable are discouraged. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
270
272
| <aid="rust_binary-rustc_flags"></a>rustc_flags | List of compiler flags passed to <code>rustc</code>. | List of strings | optional |[]|
271
273
| <aid="rust_binary-srcs"></a>srcs | List of Rust <code>.rs</code> source files used to build the library.<br><br>If <code>srcs</code> contains more than one file, then there must be a file either named <code>lib.rs</code>. Otherwise, <code>crate_root</code> must be set to the source file that is the root of the crate to be passed to rustc to build this crate. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
272
274
| <aid="rust_binary-version"></a>version | A version to inject in the cargo environment variable. | String | optional | "0.0.0" |
| <aid="rust_library-out_dir_tar"></a>out_dir_tar |__Deprecated__, do not use, see [#cargo_build_script] instead. | <ahref="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | None |
619
622
| <aid="rust_library-proc_macro_deps"></a>proc_macro_deps | List of <code>rust_library</code> targets with kind <code>proc-macro</code> used to help build this library target. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
620
623
| <aid="rust_library-rustc_env"></a>rustc_env | Dictionary of additional <code>"key": "value"</code> environment variables to set for rustc.<br><br>rust_test()/rust_binary() rules can use $(rootpath //package:target) to pass in the location of a generated file or external tool. Cargo build scripts that wish to expand locations should use cargo_build_script()'s build_script_env argument instead, as build scripts are run in a different environment - see cargo_build_script()'s documentation for more. | <ahref="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> String</a> | optional | {} |
624
+
| <aid="rust_library-rustc_env_files"></a>rustc_env_files | Files containing additional environment variables to set for rustc.<br><br>These files should contain a single variable per line, of format <code>NAME=value</code>, and newlines may be included in a value by ending a line with a trailing back-slash (<code>\</code>).<br><br>The order that these files will be processed is unspecified, so multiple definitions of a particular variable are discouraged. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
621
625
| <aid="rust_library-rustc_flags"></a>rustc_flags | List of compiler flags passed to <code>rustc</code>. | List of strings | optional |[]|
622
626
| <aid="rust_library-srcs"></a>srcs | List of Rust <code>.rs</code> source files used to build the library.<br><br>If <code>srcs</code> contains more than one file, then there must be a file either named <code>lib.rs</code>. Otherwise, <code>crate_root</code> must be set to the source file that is the root of the crate to be passed to rustc to build this crate. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
623
627
| <aid="rust_library-version"></a>version | A version to inject in the cargo environment variable. | String | optional | "0.0.0" |
@@ -727,7 +731,7 @@ See @rules_rust//proto:BUILD for examples of defining the toolchain.
@@ -877,6 +881,7 @@ Run the test with `bazel build //hello_lib:hello_lib_test`.
877
881
| <aid="rust_test-out_dir_tar"></a>out_dir_tar |__Deprecated__, do not use, see [#cargo_build_script] instead. | <ahref="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | None |
878
882
| <aid="rust_test-proc_macro_deps"></a>proc_macro_deps | List of <code>rust_library</code> targets with kind <code>proc-macro</code> used to help build this library target. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
879
883
| <aid="rust_test-rustc_env"></a>rustc_env | Dictionary of additional <code>"key": "value"</code> environment variables to set for rustc.<br><br>rust_test()/rust_binary() rules can use $(rootpath //package:target) to pass in the location of a generated file or external tool. Cargo build scripts that wish to expand locations should use cargo_build_script()'s build_script_env argument instead, as build scripts are run in a different environment - see cargo_build_script()'s documentation for more. | <ahref="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> String</a> | optional | {} |
884
+
| <aid="rust_test-rustc_env_files"></a>rustc_env_files | Files containing additional environment variables to set for rustc.<br><br>These files should contain a single variable per line, of format <code>NAME=value</code>, and newlines may be included in a value by ending a line with a trailing back-slash (<code>\</code>).<br><br>The order that these files will be processed is unspecified, so multiple definitions of a particular variable are discouraged. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
880
885
| <aid="rust_test-rustc_flags"></a>rustc_flags | List of compiler flags passed to <code>rustc</code>. | List of strings | optional |[]|
881
886
| <aid="rust_test-srcs"></a>srcs | List of Rust <code>.rs</code> source files used to build the library.<br><br>If <code>srcs</code> contains more than one file, then there must be a file either named <code>lib.rs</code>. Otherwise, <code>crate_root</code> must be set to the source file that is the root of the crate to be passed to rustc to build this crate. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
882
887
| <aid="rust_test-version"></a>version | A version to inject in the cargo environment variable. | String | optional | "0.0.0" |
0 commit comments