Skip to content

Commit

Permalink
third_party: Symlink probe-rs binary into common location
Browse files Browse the repository at this point in the history
This allows tools to use probe-rs via:

./bazel-bin/third_party/probe-rs/probe-rs

rather than having to depend on bazel to provide the target-specific
location of the binary.

Change-Id: I75585385655302ccba94a31fa92079bda05d1f5e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/214057
Reviewed-by: Erik Gilling <[email protected]>
Lint: Lint 🤖 <[email protected]>
Commit-Queue: Taylor Cramer <[email protected]>
  • Loading branch information
cramertj authored and CQ Bot Account committed Jun 5, 2024
1 parent 28ee5c5 commit c3bd8fe
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion third_party/probe-rs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
# License for the specific language governing permissions and limitations under
# the License.

load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("per_platform_alias.bzl", "per_platform_alias")

package(default_visibility = ["//visibility:public"])

licenses(["notice"])

per_platform_alias(
name = "probe-rs",
name = "probe-rs-alias",
platform_to_label = {
"aarch64-linux": "@probe-rs-tools-aarch64-unknown-linux-gnu//:probe-rs",
"aarch64-osx": "@probe-rs-tools-aarch64-apple-darwin//:probe-rs",
Expand All @@ -28,3 +29,13 @@ per_platform_alias(
"x86_64-windows": "@probe-rs-tools-x86_64-pc-windows-msvc//:probe-rs",
},
)

# Symlink the `probe-rs` binary (whose path is platform-specific) into a common
# location.
copy_file(
name = "probe-rs-create-symlink",
src = ":probe-rs-alias",
out = "probe-rs",
allow_symlink = True,
is_executable = True,
)

0 comments on commit c3bd8fe

Please sign in to comment.