diff --git a/docs/defs.md b/docs/defs.md index 6d562010d6..f8c9895edb 100644 --- a/docs/defs.md +++ b/docs/defs.md @@ -72,8 +72,8 @@ Add additional rustc_flags from the command line with `--@rules_rust//:extra_rus
rust_binary(name, aliases, compile_data, crate_features, crate_name, crate_root, crate_type, data, - deps, edition, linker_script, out_binary, proc_macro_deps, rustc_env, rustc_env_files, - rustc_flags, srcs, stamp, version) + deps, edition, experimental_use_whole_archive_for_native_deps, linker_script, out_binary, + proc_macro_deps, rustc_env, rustc_env_files, rustc_flags, srcs, stamp, version)Builds a Rust binary crate. @@ -178,6 +178,7 @@ is available under the key `dsym_folder` in `OutputGroupInfo`. | data | List of files used by this rule at compile time and runtime.
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.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 | "" |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.crate_type
, to always mark the file as executable. This attribute is only used to support wasm targets but is expected to be removed following a resolution to https://github.com/bazelbuild/rules_rust/issues/771. | Boolean | optional | False |
| proc_macro_deps | List of rust_library
targets with kind proc-macro
used to help build this library target. | List of labels | optional | [] |
@@ -195,7 +196,8 @@ is available under the key `dsym_folder` in `OutputGroupInfo`.
rust_library(name, aliases, compile_data, crate_features, crate_name, crate_root, data, deps, - edition, proc_macro_deps, rustc_env, rustc_env_files, rustc_flags, srcs, stamp, version) + edition, experimental_use_whole_archive_for_native_deps, proc_macro_deps, rustc_env, + rustc_env_files, rustc_flags, srcs, stamp, version)Builds a Rust library crate. @@ -276,6 +278,7 @@ INFO: Elapsed time: 1.245s, Critical Path: 1.01s | data | List of files used by this rule at compile time and runtime.
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.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 | "" |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.rust_library
targets with kind proc-macro
used to help build this library target. | List of labels | optional | [] |
| rustc_env | Dictionary of additional "key": "value"
environment variables to set for rustc.NAME=value
, and newlines may be included in a value by ending a line with a trailing back-slash (\\
).stamp
attribute be enabled. Stamp variables should be wrapped in brackets in order to be resolved. E.g. NAME={WORKSPACE_STATUS_VARIABLE}
. | List of labels | optional | [] |
@@ -291,8 +294,8 @@ INFO: Elapsed time: 1.245s, Critical Path: 1.01s
rust_proc_macro(name, aliases, compile_data, crate_features, crate_name, crate_root, data, deps, - edition, proc_macro_deps, rustc_env, rustc_env_files, rustc_flags, srcs, stamp, - version) + edition, experimental_use_whole_archive_for_native_deps, proc_macro_deps, rustc_env, + rustc_env_files, rustc_flags, srcs, stamp, version)Builds a Rust proc-macro crate. @@ -312,6 +315,7 @@ Builds a Rust proc-macro crate. | data | List of files used by this rule at compile time and runtime.
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.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 | "" |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.rust_library
targets with kind proc-macro
used to help build this library target. | List of labels | optional | [] |
| rustc_env | Dictionary of additional "key": "value"
environment variables to set for rustc.NAME=value
, and newlines may be included in a value by ending a line with a trailing back-slash (\\
).stamp
attribute be enabled. Stamp variables should be wrapped in brackets in order to be resolved. E.g. NAME={WORKSPACE_STATUS_VARIABLE}
. | List of labels | optional | [] |
@@ -327,8 +331,8 @@ Builds a Rust proc-macro crate.
rust_shared_library(name, aliases, compile_data, crate_features, crate_name, crate_root, data, deps, - edition, proc_macro_deps, rustc_env, rustc_env_files, rustc_flags, srcs, stamp, - version) + edition, experimental_use_whole_archive_for_native_deps, proc_macro_deps, + rustc_env, rustc_env_files, rustc_flags, srcs, stamp, version)Builds a Rust shared library. @@ -356,6 +360,7 @@ When building the whole binary in Bazel, use `rust_library` instead. | data | List of files used by this rule at compile time and runtime.
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.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 | "" |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.rust_library
targets with kind proc-macro
used to help build this library target. | List of labels | optional | [] |
| rustc_env | Dictionary of additional "key": "value"
environment variables to set for rustc.NAME=value
, and newlines may be included in a value by ending a line with a trailing back-slash (\\
).stamp
attribute be enabled. Stamp variables should be wrapped in brackets in order to be resolved. E.g. NAME={WORKSPACE_STATUS_VARIABLE}
. | List of labels | optional | [] |
@@ -371,8 +376,8 @@ When building the whole binary in Bazel, use `rust_library` instead.
rust_static_library(name, aliases, compile_data, crate_features, crate_name, crate_root, data, deps, - edition, proc_macro_deps, rustc_env, rustc_env_files, rustc_flags, srcs, stamp, - version) + edition, experimental_use_whole_archive_for_native_deps, proc_macro_deps, + rustc_env, rustc_env_files, rustc_flags, srcs, stamp, version)Builds a Rust static library. @@ -400,6 +405,7 @@ When building the whole binary in Bazel, use `rust_library` instead. | data | List of files used by this rule at compile time and runtime.
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.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 | "" |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.rust_library
targets with kind proc-macro
used to help build this library target. | List of labels | optional | [] |
| rustc_env | Dictionary of additional "key": "value"
environment variables to set for rustc.NAME=value
, and newlines may be included in a value by ending a line with a trailing back-slash (\\
).stamp
attribute be enabled. Stamp variables should be wrapped in brackets in order to be resolved. E.g. NAME={WORKSPACE_STATUS_VARIABLE}
. | List of labels | optional | [] |
@@ -415,8 +421,8 @@ When building the whole binary in Bazel, use `rust_library` instead.
rust_test(name, aliases, compile_data, crate, crate_features, crate_name, crate_root, data, deps, - edition, env, proc_macro_deps, rustc_env, rustc_env_files, rustc_flags, srcs, stamp, - use_libtest_harness, version) + edition, env, experimental_use_whole_archive_for_native_deps, proc_macro_deps, rustc_env, + rustc_env_files, rustc_flags, srcs, stamp, use_libtest_harness, version)Builds a Rust test crate. @@ -559,6 +565,7 @@ Run the test with `bazel build //hello_lib:hello_lib_test`. | deps | List of other libraries to be linked to this library target.
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 | "" |
| env | Specifies additional environment variables to set when the test is executed by bazel test. Values are subject to $(rootpath)
, $(execpath)
, location, and ["Make variable"](https://docs.bazel.build/versions/master/be/make-variables.html) substitution.rust_library
targets with kind proc-macro
used to help build this library target. | List of labels | optional | [] |
| rustc_env | Dictionary of additional "key": "value"
environment variables to set for rustc.NAME=value
, and newlines may be included in a value by ending a line with a trailing back-slash (\\
).stamp
attribute be enabled. Stamp variables should be wrapped in brackets in order to be resolved. E.g. NAME={WORKSPACE_STATUS_VARIABLE}
. | List of labels | optional | [] |
diff --git a/docs/flatten.md b/docs/flatten.md
index f650bc92bb..4ccaacf620 100644
--- a/docs/flatten.md
+++ b/docs/flatten.md
@@ -182,8 +182,8 @@ Deprecated: gen_rust_project can now create a rust-project.json without a rust_a
rust_binary(name, aliases, compile_data, crate_features, crate_name, crate_root, crate_type, data, - deps, edition, linker_script, out_binary, proc_macro_deps, rustc_env, rustc_env_files, - rustc_flags, srcs, stamp, version) + deps, edition, experimental_use_whole_archive_for_native_deps, linker_script, out_binary, + proc_macro_deps, rustc_env, rustc_env_files, rustc_flags, srcs, stamp, version)Builds a Rust binary crate. @@ -288,6 +288,7 @@ is available under the key `dsym_folder` in `OutputGroupInfo`. | data | List of files used by this rule at compile time and runtime.
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.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 | "" |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.crate_type
, to always mark the file as executable. This attribute is only used to support wasm targets but is expected to be removed following a resolution to https://github.com/bazelbuild/rules_rust/issues/771. | Boolean | optional | False |
| proc_macro_deps | List of rust_library
targets with kind proc-macro
used to help build this library target. | List of labels | optional | [] |
@@ -404,7 +405,8 @@ rust_clippy(
## rust_doc
-rust_doc(name, crate, html_after_content, html_before_content, html_in_header, markdown_css) +rust_doc(name, crate, experimental_use_whole_archive_for_native_deps, html_after_content, + html_before_content, html_in_header, markdown_css)Generates code documentation. @@ -451,6 +453,7 @@ Running `bazel build //hello_lib:hello_lib_doc` will build a zip file containing | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | crate | The label of the target to generate code documentation for.
rust_doc
can generate HTML code documentation for the source files of rust_library
or rust_binary
targets. | Label | required | |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.<body>
, after content. | Label | optional | None |
| html_before_content | File to add in <body>
, before content. | Label | optional | None |
| html_in_header | File to add to <head>
. | Label | optional | None |
@@ -462,7 +465,7 @@ Running `bazel build //hello_lib:hello_lib_doc` will build a zip file containing
## rust_doc_test
-rust_doc_test(name, crate) +rust_doc_test(name, crate, experimental_use_whole_archive_for_native_deps)Runs Rust documentation tests. @@ -510,6 +513,7 @@ Running `bazel test //hello_lib:hello_lib_doc_test` will run all documentation t | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | crate | The label of the target to generate code documentation for.
rust_doc_test
can generate HTML code documentation for the source files of rust_library
or rust_binary
targets. | Label | required | |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.rust_library(name, aliases, compile_data, crate_features, crate_name, crate_root, data, deps, - edition, proc_macro_deps, rustc_env, rustc_env_files, rustc_flags, srcs, stamp, version) + edition, experimental_use_whole_archive_for_native_deps, proc_macro_deps, rustc_env, + rustc_env_files, rustc_flags, srcs, stamp, version)Builds a Rust library crate. @@ -642,6 +647,7 @@ INFO: Elapsed time: 1.245s, Critical Path: 1.01s | data | List of files used by this rule at compile time and runtime.
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.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 | "" |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.rust_library
targets with kind proc-macro
used to help build this library target. | List of labels | optional | [] |
| rustc_env | Dictionary of additional "key": "value"
environment variables to set for rustc.NAME=value
, and newlines may be included in a value by ending a line with a trailing back-slash (\\
).stamp
attribute be enabled. Stamp variables should be wrapped in brackets in order to be resolved. E.g. NAME={WORKSPACE_STATUS_VARIABLE}
. | List of labels | optional | [] |
@@ -657,8 +663,8 @@ INFO: Elapsed time: 1.245s, Critical Path: 1.01s
rust_proc_macro(name, aliases, compile_data, crate_features, crate_name, crate_root, data, deps, - edition, proc_macro_deps, rustc_env, rustc_env_files, rustc_flags, srcs, stamp, - version) + edition, experimental_use_whole_archive_for_native_deps, proc_macro_deps, rustc_env, + rustc_env_files, rustc_flags, srcs, stamp, version)Builds a Rust proc-macro crate. @@ -678,6 +684,7 @@ Builds a Rust proc-macro crate. | data | List of files used by this rule at compile time and runtime.
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.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 | "" |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.rust_library
targets with kind proc-macro
used to help build this library target. | List of labels | optional | [] |
| rustc_env | Dictionary of additional "key": "value"
environment variables to set for rustc.NAME=value
, and newlines may be included in a value by ending a line with a trailing back-slash (\\
).stamp
attribute be enabled. Stamp variables should be wrapped in brackets in order to be resolved. E.g. NAME={WORKSPACE_STATUS_VARIABLE}
. | List of labels | optional | [] |
@@ -793,8 +800,8 @@ See @rules_rust//proto:BUILD for examples of defining the toolchain.
rust_shared_library(name, aliases, compile_data, crate_features, crate_name, crate_root, data, deps, - edition, proc_macro_deps, rustc_env, rustc_env_files, rustc_flags, srcs, stamp, - version) + edition, experimental_use_whole_archive_for_native_deps, proc_macro_deps, + rustc_env, rustc_env_files, rustc_flags, srcs, stamp, version)Builds a Rust shared library. @@ -822,6 +829,7 @@ When building the whole binary in Bazel, use `rust_library` instead. | data | List of files used by this rule at compile time and runtime.
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.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 | "" |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.rust_library
targets with kind proc-macro
used to help build this library target. | List of labels | optional | [] |
| rustc_env | Dictionary of additional "key": "value"
environment variables to set for rustc.NAME=value
, and newlines may be included in a value by ending a line with a trailing back-slash (\\
).stamp
attribute be enabled. Stamp variables should be wrapped in brackets in order to be resolved. E.g. NAME={WORKSPACE_STATUS_VARIABLE}
. | List of labels | optional | [] |
@@ -837,8 +845,8 @@ When building the whole binary in Bazel, use `rust_library` instead.
rust_static_library(name, aliases, compile_data, crate_features, crate_name, crate_root, data, deps, - edition, proc_macro_deps, rustc_env, rustc_env_files, rustc_flags, srcs, stamp, - version) + edition, experimental_use_whole_archive_for_native_deps, proc_macro_deps, + rustc_env, rustc_env_files, rustc_flags, srcs, stamp, version)Builds a Rust static library. @@ -866,6 +874,7 @@ When building the whole binary in Bazel, use `rust_library` instead. | data | List of files used by this rule at compile time and runtime.
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.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 | "" |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.rust_library
targets with kind proc-macro
used to help build this library target. | List of labels | optional | [] |
| rustc_env | Dictionary of additional "key": "value"
environment variables to set for rustc.NAME=value
, and newlines may be included in a value by ending a line with a trailing back-slash (\\
).stamp
attribute be enabled. Stamp variables should be wrapped in brackets in order to be resolved. E.g. NAME={WORKSPACE_STATUS_VARIABLE}
. | List of labels | optional | [] |
@@ -900,8 +909,8 @@ A dedicated filegroup-like rule for Rust stdlib artifacts.
rust_test(name, aliases, compile_data, crate, crate_features, crate_name, crate_root, data, deps, - edition, env, proc_macro_deps, rustc_env, rustc_env_files, rustc_flags, srcs, stamp, - use_libtest_harness, version) + edition, env, experimental_use_whole_archive_for_native_deps, proc_macro_deps, rustc_env, + rustc_env_files, rustc_flags, srcs, stamp, use_libtest_harness, version)Builds a Rust test crate. @@ -1044,6 +1053,7 @@ Run the test with `bazel build //hello_lib:hello_lib_test`. | deps | List of other libraries to be linked to this library target.
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 | "" |
| env | Specifies additional environment variables to set when the test is executed by bazel test. Values are subject to $(rootpath)
, $(execpath)
, location, and ["Make variable"](https://docs.bazel.build/versions/master/be/make-variables.html) substitution.rust_library
targets with kind proc-macro
used to help build this library target. | List of labels | optional | [] |
| rustc_env | Dictionary of additional "key": "value"
environment variables to set for rustc.NAME=value
, and newlines may be included in a value by ending a line with a trailing back-slash (\\
).stamp
attribute be enabled. Stamp variables should be wrapped in brackets in order to be resolved. E.g. NAME={WORKSPACE_STATUS_VARIABLE}
. | List of labels | optional | [] |
diff --git a/docs/rust_doc.md b/docs/rust_doc.md
index cf5bf017bd..b8b5e71a9a 100644
--- a/docs/rust_doc.md
+++ b/docs/rust_doc.md
@@ -9,7 +9,8 @@
## rust_doc
-rust_doc(name, crate, html_after_content, html_before_content, html_in_header, markdown_css) +rust_doc(name, crate, experimental_use_whole_archive_for_native_deps, html_after_content, + html_before_content, html_in_header, markdown_css)Generates code documentation. @@ -56,6 +57,7 @@ Running `bazel build //hello_lib:hello_lib_doc` will build a zip file containing | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | crate | The label of the target to generate code documentation for.
rust_doc
can generate HTML code documentation for the source files of rust_library
or rust_binary
targets. | Label | required | |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.<body>
, after content. | Label | optional | None |
| html_before_content | File to add in <body>
, before content. | Label | optional | None |
| html_in_header | File to add to <head>
. | Label | optional | None |
@@ -67,7 +69,7 @@ Running `bazel build //hello_lib:hello_lib_doc` will build a zip file containing
## rust_doc_test
-rust_doc_test(name, crate) +rust_doc_test(name, crate, experimental_use_whole_archive_for_native_deps)Runs Rust documentation tests. @@ -115,5 +117,6 @@ Running `bazel test //hello_lib:hello_lib_doc_test` will run all documentation t | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | crate | The label of the target to generate code documentation for.
rust_doc_test
can generate HTML code documentation for the source files of rust_library
or rust_binary
targets. | Label | required | |
+| experimental_use_whole_archive_for_native_deps | Whether to use +whole-archive linking modifier for native dependencies.