diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl index 5f4b2267c7..561ee54f46 100644 --- a/rust/private/rustc.bzl +++ b/rust/private/rustc.bzl @@ -1424,11 +1424,12 @@ def rustc_compile_action( env = env, arguments = args.all, mnemonic = "Rustc", - progress_message = "Compiling Rust {} {}{} ({} files)".format( + progress_message = "Compiling Rust {} {}{} ({} file{})".format( crate_info.type, ctx.label.name, formatted_version, len(srcs), + "" if len(srcs) == 1 else "s", ), toolchain = "@rules_rust//rust:toolchain_type", resource_set = get_rustc_resource_set(toolchain), @@ -1441,11 +1442,12 @@ def rustc_compile_action( env = env, arguments = args_metadata.all, mnemonic = "RustcMetadata", - progress_message = "Compiling Rust metadata {} {}{} ({} files)".format( + progress_message = "Compiling Rust metadata {} {}{} ({} file{})".format( crate_info.type, ctx.label.name, formatted_version, len(srcs), + "" if len(srcs) == 1 else "s", ), toolchain = "@rules_rust//rust:toolchain_type", ) @@ -1460,11 +1462,12 @@ def rustc_compile_action( env = env, arguments = [args.rustc_path, args.rustc_flags], mnemonic = "Rustc", - progress_message = "Compiling Rust (without process_wrapper) {} {}{} ({} files)".format( + 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", ), toolchain = "@rules_rust//rust:toolchain_type", resource_set = get_rustc_resource_set(toolchain), diff --git a/test/unit/is_proc_macro_dep/is_proc_macro_dep_test.bzl b/test/unit/is_proc_macro_dep/is_proc_macro_dep_test.bzl index 26e2dcd7a1..e93c5dec0a 100644 --- a/test/unit/is_proc_macro_dep/is_proc_macro_dep_test.bzl +++ b/test/unit/is_proc_macro_dep/is_proc_macro_dep_test.bzl @@ -65,7 +65,7 @@ is_proc_macro_dep_is_not_in_env_for_top_level_action_test = analysistest.make(_i def _is_proc_macro_dep_is_false_for_proc_macro(ctx): env = analysistest.begin(ctx) tut = analysistest.target_under_test(env) - proc_macro_dep_action = [a for a in tut[DepActionsInfo].actions if str(a) == "action 'Compiling Rust proc-macro proc_macro_crate (1 files)'"][0] + proc_macro_dep_action = [a for a in tut[DepActionsInfo].actions if str(a) == "action 'Compiling Rust proc-macro proc_macro_crate (1 file)'"][0] asserts.equals(env, proc_macro_dep_action.env["BAZEL_RULES_RUST_IS_PROC_MACRO_DEP"], "0") return analysistest.end(env) @@ -74,7 +74,7 @@ is_proc_macro_dep_is_false_for_proc_macro_test = analysistest.make(_is_proc_macr def _is_proc_macro_dep_is_false_for_top_level_library(ctx): env = analysistest.begin(ctx) tut = analysistest.target_under_test(env) - top_level_library_action = [a for a in tut[DepActionsInfo].actions if str(a) == "action 'Compiling Rust rlib top_level_library (1 files)'"][0] + top_level_library_action = [a for a in tut[DepActionsInfo].actions if str(a) == "action 'Compiling Rust rlib top_level_library (1 file)'"][0] asserts.equals(env, top_level_library_action.env["BAZEL_RULES_RUST_IS_PROC_MACRO_DEP"], "0") return analysistest.end(env) @@ -83,7 +83,7 @@ is_proc_macro_dep_is_false_for_top_level_library_test = analysistest.make(_is_pr def _is_proc_macro_dep_is_true_for_proc_macro_dep(ctx): env = analysistest.begin(ctx) tut = analysistest.target_under_test(env) - proc_macro_dep_action = [a for a in tut[DepActionsInfo].actions if str(a) == "action 'Compiling Rust rlib proc_macro_dep (1 files)'"][0] + proc_macro_dep_action = [a for a in tut[DepActionsInfo].actions if str(a) == "action 'Compiling Rust rlib proc_macro_dep (1 file)'"][0] asserts.equals(env, proc_macro_dep_action.env["BAZEL_RULES_RUST_IS_PROC_MACRO_DEP"], "1") return analysistest.end(env) @@ -92,7 +92,7 @@ is_proc_macro_dep_is_true_for_proc_macro_dep_test = analysistest.make(_is_proc_m def _is_proc_macro_dep_is_not_in_env_for_proc_macro_dep(ctx): env = analysistest.begin(ctx) tut = analysistest.target_under_test(env) - proc_macro_dep_action = [a for a in tut[DepActionsInfo].actions if str(a) == "action 'Compiling Rust rlib proc_macro_dep (1 files)'"][0] + proc_macro_dep_action = [a for a in tut[DepActionsInfo].actions if str(a) == "action 'Compiling Rust rlib proc_macro_dep (1 file)'"][0] asserts.true(env, "BAZEL_RULES_RUST_IS_PROC_MACRO_DEP" not in proc_macro_dep_action.env) return analysistest.end(env)