Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate rules_rust for incompatible_use_platforms_repo_for_constraints #257

Merged
merged 1 commit into from
Nov 1, 2019
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
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,10 @@ rust_proto_toolchain(
toolchain(
name="rust_proto",
exec_compatible_with = [
"@bazel_tools//platforms:cpuX",
"@platforms//cpu:cpuX",
],
target_compatible_with = [
"@bazel_tools//platforms:cpuX",
"@platforms//cpu:cpuX",
],
toolchain = ":rust_proto_impl",
)
Expand Down Expand Up @@ -1125,10 +1125,10 @@ rust_toolchain(
toolchain(
name = "rust_cpuX",
exec_compatible_with = [
"@bazel_tools//platforms:cpuX",
"@platforms//cpu:cpuX",
],
target_compatible_with = [
"@bazel_tools//platforms:cpuX",
"@platforms//cpu:cpuX",
],
toolchain = ":rust_cpuX_impl",
)
Expand Down
4 changes: 2 additions & 2 deletions proto/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ rust_proto_toolchain(
toolchain(
name="rust_proto",
exec_compatible_with = [
"@bazel_tools//platforms:cpuX",
"@platforms//cpu:cpuX",
],
target_compatible_with = [
"@bazel_tools//platforms:cpuX",
"@platforms//cpu:cpuX",
],
toolchain = ":rust_proto_impl",
)
Expand Down
4 changes: 2 additions & 2 deletions rust/platform/platform.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ _SUPPORTED_T1_PLATFORM_TRIPLES = [
"x86_64-pc-windows-gnu",
"x86_64-unknown-linux-gnu",
# N.B. These "alternative" envs are not supported, as bazel cannot distinguish between them
# and others using existing @bazel_tools//platforms config_values
# and others using existing @platforms// config_values
#
#"i686-pc-windows-msvc",
#"x86_64-pc-windows-msvc",
]

# Some T2 Platforms are supported, provided we have mappings to @bazel_tools//platforms entries.
# Some T2 Platforms are supported, provided we have mappings to @platforms// entries.
# See @io_bazel_rules_rust//rust/platform:triple_mappings.bzl for the complete list.
_SUPPORTED_T2_PLATFORM_TRIPLES = [
"aarch64-apple-ios",
Expand Down
8 changes: 4 additions & 4 deletions rust/platform/triple_mappings.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CPUs that map to a "@bazel_tools//platforms entry
# CPUs that map to a "@platforms//cpu entry
_CPU_ARCH_TO_BUILTIN_PLAT_SUFFIX = {
"x86_64": "x86_64",
"powerpc": "ppc",
Expand All @@ -19,7 +19,7 @@ _CPU_ARCH_TO_BUILTIN_PLAT_SUFFIX = {
"mipsel": None,
}

# Systems that map to a "@bazel_tools//platforms entry
# Systems that map to a "@platforms//os entry
_SYSTEM_TO_BUILTIN_SYS_SUFFIX = {
"freebsd": "freebsd",
"linux": "linux",
Expand Down Expand Up @@ -69,7 +69,7 @@ def cpu_arch_to_constraints(cpu_arch):
if not plat_suffix:
fail("CPU architecture \"{}\" is not supported by rules_rust".format(cpu_arch))

return ["@bazel_tools//platforms:{}".format(plat_suffix)]
return ["@platforms//cpu:{}".format(plat_suffix)]

def vendor_to_constraints(vendor):
# TODO(acmcarther): Review:
Expand All @@ -84,7 +84,7 @@ def system_to_constraints(system):
if not sys_suffix:
fail("System \"{}\" is not supported by rules_rust".format(sys_suffix))

return ["@bazel_tools//platforms:{}".format(sys_suffix)]
return ["@platforms//os:{}".format(sys_suffix)]

def abi_to_constraints(abi):
# TODO(acmcarther): Implement when C++ toolchain is more mature and we
Expand Down
4 changes: 2 additions & 2 deletions rust/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ rust_toolchain(
toolchain(
name = "rust_cpuX",
exec_compatible_with = [
"@bazel_tools//platforms:cpuX",
"@platforms//cpu:cpuX",
],
target_compatible_with = [
"@bazel_tools//platforms:cpuX",
"@platforms//cpu:cpuX",
],
toolchain = ":rust_cpuX_impl",
)
Expand Down