diff --git a/extensions/prost/private/prost.bzl b/extensions/prost/private/prost.bzl index c59dcb27a3..a8b31c40d1 100644 --- a/extensions/prost/private/prost.bzl +++ b/extensions/prost/private/prost.bzl @@ -368,7 +368,7 @@ rust_prost_aspect = aspect( attr_aspects = ["deps"], attrs = { "_collect_cc_coverage": attr.label( - default = Label("@rules_rust//util:collect_coverage"), + default = Label("@rules_rust//rust/coverage:collect_rust_coverage"), executable = True, cfg = "exec", ), @@ -437,7 +437,7 @@ rust_prost_library = rule( mandatory = True, ), "_collect_cc_coverage": attr.label( - default = Label("@rules_rust//util:collect_coverage"), + default = Label("@rules_rust//rust/coverage:collect_rust_coverage"), executable = True, cfg = "exec", ), diff --git a/rust/coverage/BUILD.bazel b/rust/coverage/BUILD.bazel new file mode 100644 index 0000000000..a4f37cd58b --- /dev/null +++ b/rust/coverage/BUILD.bazel @@ -0,0 +1,17 @@ +load("//rust:defs.bzl", "rust_binary") + +rust_binary( + name = "collect_rust_coverage", + srcs = ["collect_rust_coverage.rs"], + edition = "2018", + # To ensure this tool is produced deterministically, debug info + # is stripped out. On macOS, full symbol stripping is needed to + # also remove N_OSO stab entries whose timestamps and sandbox + # paths vary between builds. + rustc_flags = select({ + "@platforms//os:linux": ["-Cstrip=debuginfo"], + "@platforms//os:macos": ["-Cstrip=symbols"], + "//conditions:default": [], + }), + visibility = ["//visibility:public"], +) diff --git a/util/collect_coverage/collect_coverage.rs b/rust/coverage/collect_rust_coverage.rs similarity index 100% rename from util/collect_coverage/collect_coverage.rs rename to rust/coverage/collect_rust_coverage.rs diff --git a/rust/private/rust.bzl b/rust/private/rust.bzl index a69202a028..54178d739f 100644 --- a/rust/private/rust.bzl +++ b/rust/private/rust.bzl @@ -932,7 +932,7 @@ _PLATFORM_ATTRS = { _COVERAGE_ATTRS = { "_collect_cc_coverage": attr.label( - default = Label("//util/collect_coverage"), + default = Label("//rust/coverage:collect_rust_coverage"), executable = True, cfg = "exec", ), @@ -1308,7 +1308,7 @@ _RUST_BINARY_ATTRS = { default = False, doc = dedent("""\ Flag to dynamically link the standard library as a Rust dylib .so object when building this binary. - + Default is false. This is often required when building a binary that depends on a Rust ABI dylib. """), ), diff --git a/util/collect_coverage/BUILD.bazel b/util/collect_coverage/BUILD.bazel index 24ed5be45d..00aab4a3a7 100644 --- a/util/collect_coverage/BUILD.bazel +++ b/util/collect_coverage/BUILD.bazel @@ -1,17 +1,6 @@ -load("//rust:defs.bzl", "rust_binary") - -rust_binary( +alias( name = "collect_coverage", - srcs = ["collect_coverage.rs"], - edition = "2018", - # To ensure this tool is produced deterministically, debug info - # is stripped out. On macOS, full symbol stripping is needed to - # also remove N_OSO stab entries whose timestamps and sandbox - # paths vary between builds. - rustc_flags = select({ - "@platforms//os:linux": ["-Cstrip=debuginfo"], - "@platforms//os:macos": ["-Cstrip=symbols"], - "//conditions:default": [], - }), + actual = "//rust/coverage:collect_rust_coverage", + deprecation = "instead use `@rules_rust//rust/coverage:collect_rust_coverage`", visibility = ["//visibility:public"], )