Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cargo/private/cargo_build_script.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ def _cargo_build_script_impl(ctx):
],
inputs = depset(build_script_inputs, transitive = [runfiles_inputs]),
mnemonic = "CargoBuildScriptRun",
progress_message = "Running Cargo build script {}".format(pkg_name),
progress_message = "Running Cargo build script %{label} (CargoBuildScriptRun)",
env = env,
toolchain = None,
use_default_shell_env = use_default_shell_env,
Expand Down
1 change: 1 addition & 0 deletions cargo/private/cargo_dep_env.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def _cargo_dep_env_impl(ctx):
)
ctx.actions.run(
mnemonic = "CargoDepEnv",
progress_message = "Creating Cargo dep env for %{label} (CargoDepEnv)",
outputs = [empty_dir],
executable = "true",
)
Expand Down
2 changes: 1 addition & 1 deletion cargo/private/cargo_lints.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _extract_cargo_lints(ctx):
inputs = inputs,
arguments = [args],
mnemonic = "CargoLints",
progress_message = "Reading Cargo metadata to get Lints for {}".format(ctx.attr.name),
progress_message = "Extracting Cargo lints for %{label} (CargoLints)",
)

return [
Expand Down
1 change: 1 addition & 0 deletions cargo/private/cargo_toml_env_vars.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def _cargo_toml_env_vars_impl(ctx):
inputs = inputs,
arguments = [args],
mnemonic = "ExtractCargoTomlEnvVars",
progress_message = "Extracting Cargo.toml env vars for %{label} (ExtractCargoTomlEnvVars)",
)

return [
Expand Down
2 changes: 1 addition & 1 deletion extensions/bindgen/private/bindgen.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def _rust_bindgen_impl(ctx):
),
outputs = [output] + ([c_output] if wrap_static_fns else []),
mnemonic = "RustBindgen",
progress_message = "Generating bindings for {}..".format(header.path),
progress_message = "Generating bindings for %{label} (RustBindgen)",
env = env,
arguments = [args],
tools = tools,
Expand Down
1 change: 1 addition & 0 deletions extensions/mdbook/private/mdbook.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def _mdbook_impl(ctx):

ctx.actions.run(
mnemonic = "MdBookBuild",
progress_message = "Building mdBook %{label} (MdBookBuild)",
executable = ctx.executable._process_wrapper,
tools = depset(ctx.files.plugins, transitive = [toolchain.all_files]),
outputs = [output],
Expand Down
2 changes: 1 addition & 1 deletion extensions/prost/private/prost.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _create_proto_lang_toolchain(ctx, prost_toolchain):
provided_proto_sources = depset(),
proto_compiler = ctx.attr._prost_process_wrapper[DefaultInfo].files_to_run,
protoc_opts = prost_toolchain.protoc_opts,
progress_message = "ProstGenProto %{label}",
progress_message = "Generating Prost Rust proto for %{label} (ProstGenProto)",
mnemonic = "ProstGenProto",
)

Expand Down
1 change: 1 addition & 0 deletions extensions/pyo3/private/pyo3.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def _py_pyo3_library_impl(ctx):
args.add(stub, format = "--output=%s")
ctx.actions.run(
mnemonic = "PyO3StubGen",
progress_message = "Generating PyO3 stubs for %{label} (PyO3StubGen)",
outputs = [stub],
inputs = [ext],
executable = ctx.executable._stubgen,
Expand Down
4 changes: 1 addition & 3 deletions extensions/wasm_bindgen/private/wasm_bindgen.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ def rust_wasm_bindgen_action(*, ctx, toolchain, wasm_file, target_output, flags
supported_types,
))

progress_message_label = target.label
input_file = crate_info.output
else:
wasm_files = wasm_file[0][DefaultInfo].files.to_list()
if len(wasm_files) != 1:
fail("Unexpected number of wasm files: {}".format(wasm_files))

progress_message_label = wasm_files[0].path
input_file = wasm_files[0]
else:
fail("wasm_file is expected to be a transitioned label attr on `{}`. Got `{}`".format(
Expand Down Expand Up @@ -92,7 +90,7 @@ def rust_wasm_bindgen_action(*, ctx, toolchain, wasm_file, target_output, flags
inputs = [input_file],
outputs = outputs,
mnemonic = "RustWasmBindgen",
progress_message = "Generating WebAssembly bindings for {}".format(progress_message_label),
progress_message = "Generating WebAssembly bindings for %{label} (RustWasmBindgen)",
arguments = [args],
toolchain = str(Label("//:toolchain_type")),
)
Expand Down
2 changes: 1 addition & 1 deletion rust/private/clippy.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def rust_clippy_action(
tools = [clippy_toolchain.clippy_driver],
arguments = args.all,
mnemonic = "Clippy",
progress_message = "Clippy %{label}",
progress_message = "Running Clippy on %{label}",
toolchain = "@rules_rust//rust:toolchain_type",
execution_requirements = {"supports-path-mapping": ""} if args.supports_path_mapping else None,
)
Expand Down
29 changes: 3 additions & 26 deletions rust/private/rustc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2017,11 +2017,6 @@ def rustc_compile_action(
# this is the final list of env vars
env.update(env_from_args)

if hasattr(attr, "version") and attr.version != "0.0.0":
formatted_version = " v{}".format(attr.version)
else:
formatted_version = ""

# For a cdylib that might be added as a dependency to a cc_* target on Windows, it is important to include the
# interface library that rustc generates in the output files.
interface_library = None
Expand Down Expand Up @@ -2065,13 +2060,7 @@ def rustc_compile_action(
env = env,
arguments = args.all,
mnemonic = "Rustc",
progress_message = "Compiling Rust {} {}{} ({} file{})".format(
crate_info.type,
ctx.label.name,
formatted_version,
len(srcs),
"" if len(srcs) == 1 else "s",
),
progress_message = "Compiling Rust {} %{{label}} (Rustc)".format(crate_info.type),
toolchain = "@rules_rust//rust:toolchain_type",
resource_set = get_rustc_resource_set(toolchain),
execution_requirements = {"supports-path-mapping": ""} if args.supports_path_mapping else None,
Expand All @@ -2084,13 +2073,7 @@ def rustc_compile_action(
env = env,
arguments = args_metadata.all,
mnemonic = "RustcMetadata",
progress_message = "Compiling Rust metadata {} {}{} ({} file{})".format(
crate_info.type,
ctx.label.name,
formatted_version,
len(srcs),
"" if len(srcs) == 1 else "s",
),
progress_message = "Compiling Rust metadata {} %{{label}} (RustcMetadata)".format(crate_info.type),
toolchain = "@rules_rust//rust:toolchain_type",
execution_requirements = {"supports-path-mapping": ""} if args_metadata.supports_path_mapping else None,
)
Expand All @@ -2105,13 +2088,7 @@ def rustc_compile_action(
env = env,
arguments = [args.rustc_path, args.rustc_flags],
mnemonic = "Rustc",
progress_message = "Compiling Rust (without process_wrapper) {} {}{} ({} file{})".format(
crate_info.type,
ctx.label.name,
formatted_version,
len(srcs),
"" if len(srcs) == 1 else "s",
),
progress_message = "Compiling Rust (without process_wrapper) {} %{{label}} (Rustc)".format(crate_info.type),
toolchain = "@rules_rust//rust:toolchain_type",
resource_set = get_rustc_resource_set(toolchain),
execution_requirements = {"supports-path-mapping": ""} if args.supports_path_mapping else None,
Expand Down
9 changes: 4 additions & 5 deletions rust/private/rustdoc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,13 @@ def rustdoc_compile_action(
static_runtime_libs = static_runtime_libs,
)

def _zip_action(ctx, input_dir, output_zip, crate_label):
def _zip_action(ctx, input_dir, output_zip):
"""Creates an archive of the generated documentation from `rustdoc`

Args:
ctx (ctx): The `rust_doc` rule's context object
input_dir (File): A directory containing the outputs from rustdoc
output_zip (File): The location of the output archive containing generated documentation
crate_label (Label): The label of the crate docs are being generated for.
"""
args = ctx.actions.args()
args.add(ctx.executable._zipper)
Expand All @@ -277,7 +276,7 @@ def _zip_action(ctx, input_dir, output_zip, crate_label):
outputs = [output_zip],
arguments = [args],
mnemonic = "RustdocZip",
progress_message = "Creating RustdocZip for {}".format(crate_label),
progress_message = "Creating RustdocZip for %{label}",
tools = [ctx.executable._zipper],
)

Expand Down Expand Up @@ -340,7 +339,7 @@ def _rust_doc_impl(ctx):

ctx.actions.run(
mnemonic = "Rustdoc",
progress_message = "Generating Rustdoc for {}".format(crate.label),
progress_message = "Generating Rustdoc for %{label}",
outputs = [output_dir],
executable = action.executable,
inputs = action.inputs,
Expand All @@ -351,7 +350,7 @@ def _rust_doc_impl(ctx):
)

# This rule does nothing without a single-file output, though the directory should've sufficed.
_zip_action(ctx, output_dir, ctx.outputs.rust_doc_zip, crate.label)
_zip_action(ctx, output_dir, ctx.outputs.rust_doc_zip)

return [
DefaultInfo(
Expand Down
4 changes: 2 additions & 2 deletions rust/private/rustdoc_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _compiled_rust_doc_test_impl(ctx, toolchain, rustdoc_toolchain, crate_info):

ctx.actions.run(
mnemonic = "RustdocTestCompile",
progress_message = "RustdocTestCompile {}".format(ctx.attr.crate.label),
progress_message = "Compiling Rustdoc tests for %{label} (RustdocTestCompile)",
outputs = [doctest_dir, test_metadata],
executable = ctx.executable._rustdoc_compile_wrapper,
inputs = action.inputs,
Expand Down Expand Up @@ -274,7 +274,7 @@ def _legacy_rust_doc_test_impl(ctx, toolchain, rustdoc_toolchain, crate_info):

ctx.actions.run(
mnemonic = "RustdocTestWriter",
progress_message = "Generating Rustdoc test runner for {}".format(ctx.attr.crate.label),
progress_message = "Generating Rustdoc test runner for %{label} (RustdocTestWriter)",
executable = ctx.executable._test_writer,
inputs = action.inputs,
tools = tools,
Expand Down
2 changes: 1 addition & 1 deletion rust/private/rustfmt.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _perform_check(edition, srcs, ctx):
tools = [rustfmt_toolchain.all_files],
arguments = [args],
mnemonic = "Rustfmt",
progress_message = "Rustfmt %{label}",
progress_message = "Checking Rustfmt for %{label}",
toolchain = Label("//rust/rustfmt:toolchain_type"),
)

Expand Down
1 change: 1 addition & 0 deletions rust/private/unpretty.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ def _rust_unpretty_aspect_impl(target, ctx):
env = env,
arguments = args.all,
mnemonic = mnemonic,
progress_message = "Running Rust unpretty ({}) for %{{label}} ({})".format(mode, mnemonic),
toolchain = "@rules_rust//rust:toolchain_type",
execution_requirements = {"supports-path-mapping": ""} if args.supports_path_mapping else None,
)
Expand Down
Loading