From facc8697d0a977e65206a351f96ff775007160ab Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Thu, 17 Jun 2021 16:15:02 -0700 Subject: [PATCH 1/3] Added documentation to `rust_binary::out_binary` --- rust/private/rust.bzl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust/private/rust.bzl b/rust/private/rust.bzl index 62ddced299..2609a6c5fe 100644 --- a/rust/private/rust.bzl +++ b/rust/private/rust.bzl @@ -860,7 +860,10 @@ _rust_binary_attrs = { cfg = "exec", allow_single_file = True, ), - "out_binary": attr.bool(), + "out_binary": attr.bool( + doc = "Force a target, regardless of it's `crate_type`, to always mark the file as executable.", + default = False, + ), } rust_binary = rule( From 1e86cbaff9b848fbb426236d6871c8129cc9942e Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Fri, 9 Jul 2021 06:50:26 -0700 Subject: [PATCH 2/3] Updated comment --- rust/private/rust.bzl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust/private/rust.bzl b/rust/private/rust.bzl index 2609a6c5fe..32fcfdfc55 100644 --- a/rust/private/rust.bzl +++ b/rust/private/rust.bzl @@ -861,7 +861,11 @@ _rust_binary_attrs = { allow_single_file = True, ), "out_binary": attr.bool( - doc = "Force a target, regardless of it's `crate_type`, to always mark the file as executable.", + doc = ( + "Force a target, regardless of it's `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." + ), default = False, ), } From c180946cac225c2dcee2c71a900ddd0c959c14b9 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Fri, 9 Jul 2021 06:51:13 -0700 Subject: [PATCH 3/3] Regenerate documentation --- docs/defs.md | 2 +- docs/flatten.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/defs.md b/docs/defs.md index 6a846d27a1..60ecff4c9f 100644 --- a/docs/defs.md +++ b/docs/defs.md @@ -226,7 +226,7 @@ Hello world | 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 | -| out_binary | - | Boolean | optional | False | +| out_binary | Force a target, regardless of it's 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 | [] | | rustc_env | Dictionary of additional "key": "value" environment variables to set for rustc.

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. | Dictionary: String -> String | optional | {} | | rustc_env_files | Files containing additional environment variables to set for rustc.

These files should contain a single variable per line, of format NAME=value, and newlines may be included in a value by ending a line with a trailing back-slash (\).

The order that these files will be processed is unspecified, so multiple definitions of a particular variable are discouraged. | List of labels | optional | [] | diff --git a/docs/flatten.md b/docs/flatten.md index 4d86b83f12..aca03640fe 100644 --- a/docs/flatten.md +++ b/docs/flatten.md @@ -317,7 +317,7 @@ Hello world | 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 | -| out_binary | - | Boolean | optional | False | +| out_binary | Force a target, regardless of it's 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 | [] | | rustc_env | Dictionary of additional "key": "value" environment variables to set for rustc.

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. | Dictionary: String -> String | optional | {} | | rustc_env_files | Files containing additional environment variables to set for rustc.

These files should contain a single variable per line, of format NAME=value, and newlines may be included in a value by ending a line with a trailing back-slash (\).

The order that these files will be processed is unspecified, so multiple definitions of a particular variable are discouraged. | List of labels | optional | [] |