Skip to content

Commit a814d85

Browse files
authored
Added documentation to rust_binary::out_binary (#772)
* Added documentation to `rust_binary::out_binary` * Updated comment * Regenerate documentation
1 parent 8cca226 commit a814d85

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

docs/defs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Hello world
226226
| <a id="rust_binary-deps"></a>deps | List of other libraries to be linked to this library target.<br><br>These can be either other <code>rust_library</code> targets or <code>cc_library</code> targets if linking a native library. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
227227
| <a id="rust_binary-edition"></a>edition | The rust edition to use for this crate. Defaults to the edition specified in the rust_toolchain. | String | optional | "" |
228228
| <a id="rust_binary-linker_script"></a>linker_script | Link script to forward into linker via rustc options. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | None |
229-
| <a id="rust_binary-out_binary"></a>out_binary | - | Boolean | optional | False |
229+
| <a id="rust_binary-out_binary"></a>out_binary | Force a target, regardless of it's <code>crate_type</code>, 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 |
230230
| <a id="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. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
231231
| <a id="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. | <a href="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> String</a> | optional | {} |
232232
| <a id="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. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |

docs/flatten.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ Hello world
317317
| <a id="rust_binary-deps"></a>deps | List of other libraries to be linked to this library target.<br><br>These can be either other <code>rust_library</code> targets or <code>cc_library</code> targets if linking a native library. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
318318
| <a id="rust_binary-edition"></a>edition | The rust edition to use for this crate. Defaults to the edition specified in the rust_toolchain. | String | optional | "" |
319319
| <a id="rust_binary-linker_script"></a>linker_script | Link script to forward into linker via rustc options. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | None |
320-
| <a id="rust_binary-out_binary"></a>out_binary | - | Boolean | optional | False |
320+
| <a id="rust_binary-out_binary"></a>out_binary | Force a target, regardless of it's <code>crate_type</code>, 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 |
321321
| <a id="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. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
322322
| <a id="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. | <a href="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> String</a> | optional | {} |
323323
| <a id="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. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |

rust/private/rust.bzl

+8-1
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,14 @@ _rust_binary_attrs = {
860860
cfg = "exec",
861861
allow_single_file = True,
862862
),
863-
"out_binary": attr.bool(),
863+
"out_binary": attr.bool(
864+
doc = (
865+
"Force a target, regardless of it's `crate_type`, to always mark the " +
866+
"file as executable. This attribute is only used to support wasm targets but is " +
867+
"expected to be removed following a resolution to https://github.com/bazelbuild/rules_rust/issues/771."
868+
),
869+
default = False,
870+
),
864871
}
865872

866873
rust_binary = rule(

0 commit comments

Comments
 (0)