Skip to content

Commit

Permalink
Try setting up several platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion committed Oct 22, 2024
1 parent aec5d2b commit 0f80333
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
13 changes: 11 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ register_coreutils_toolchains()

load("@musl_toolchains//:repositories.bzl", "load_musl_toolchains")

load_musl_toolchains()
load_musl_toolchains(extra_target_compatible_with = ["@//tools/linkers:musl"])

load("@musl_toolchains//:toolchains.bzl", "register_musl_toolchains")

Expand Down Expand Up @@ -204,13 +204,22 @@ rust_repository_set(
"aarch64-unknown-linux-musl": [
"@platforms//cpu:arm64",
"@platforms//os:linux",
"@//tools/linkers:musl",
],
"aarch64-unknown-linux-gnu": [
"@platforms//cpu:arm64",
"@platforms//os:linux",
"@//tools/linkers:unknown",
],
"x86_64-unknown-linux-gnu": [
"@platforms//:incompatible",
"@platforms//cpu:x86_64",
"@platforms//os:linux",
"@//tools/linkers:unknown",
],
"x86_64-unknown-linux-musl": [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
"@//tools/linkers:musl",
],
},
versions = [RUST_VERSION],
Expand Down
1 change: 1 addition & 0 deletions py/tools/venv_bin/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ rust_binary(
"@crate_index//:clap",
"@crate_index//:miette",
],
tags = ["manual"],
)

alias(
Expand Down
29 changes: 29 additions & 0 deletions tools/linkers/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
constraint_setting(
name = "linker",
default_constraint_value = ":unknown",
visibility = ["//visibility:public"],
)

constraint_value(
name = "musl",
constraint_setting = ":linker",
visibility = ["//visibility:public"],
)

# Default linker for anyone not setting the linker to `musl`.
# You shouldn't ever need to set this value manually.
constraint_value(
name = "unknown",
constraint_setting = ":linker",
visibility = ["//visibility:public"],
)

platform(
name = "linux_x86_64_musl",
constraint_values = [
":musl",
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
visibility = ["//visibility:public"],
)

0 comments on commit 0f80333

Please sign in to comment.