From eec052436a3f8e8f0f715128ec26964b331fe7f5 Mon Sep 17 00:00:00 2001 From: John Cater Date: Fri, 10 Jan 2025 14:15:20 -0800 Subject: [PATCH] =?UTF-8?q?Remove=20unneeded=20BZL=20file=20and=20declare?= =?UTF-8?q?=20`config=5Fsetting`=20targets=20directl=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …y in BUILD file. Closes #24899. PiperOrigin-RevId: 714169712 Change-Id: Ib0e30ec99fb83118ac29900baaecb1db3d5e0b86 --- src/conditions/BUILD.tools | 22 ++++++++++++++++++--- tools/BUILD | 3 --- tools/BUILD.tools | 1 - tools/windows/BUILD | 11 ----------- tools/windows/windows_config.bzl | 33 -------------------------------- 5 files changed, 19 insertions(+), 51 deletions(-) delete mode 100644 tools/windows/BUILD delete mode 100644 tools/windows/windows_config.bzl diff --git a/src/conditions/BUILD.tools b/src/conditions/BUILD.tools index aafdb4fb34786f..95fd8bb97bc544 100644 --- a/src/conditions/BUILD.tools +++ b/src/conditions/BUILD.tools @@ -1,5 +1,3 @@ -load("//tools/windows:windows_config.bzl", "create_windows_host_config") - config_setting( name = "freebsd", constraint_values = ["@platforms//os:freebsd"], @@ -127,6 +125,7 @@ config_setting( "@platforms//cpu:x86_64", ], ) + config_setting( name = "windows_arm64", constraint_values = [ @@ -142,7 +141,24 @@ config_setting( visibility = ["//visibility:public"], ) -create_windows_host_config() +config_setting( + name = "host_windows_x64_constraint", + values = {"host_cpu": "x64_windows"}, +) + +config_setting( + name = "host_windows_arm64_constraint", + values = {"host_cpu": "arm64_windows"}, +) + +alias( + name = "host_windows", + actual = select({ + ":host_windows_arm64_constraint": ":host_windows_arm64_constraint", + "//conditions:default": ":host_windows_x64_constraint", + }), + visibility = ["//visibility:public"], +) config_setting( name = "remote", diff --git a/tools/BUILD b/tools/BUILD index 4b8e392989aa5e..5419aa52c19b54 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -33,7 +33,6 @@ filegroup( "//tools/test:srcs", "//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:srcs", "//tools/test/CoverageOutputGenerator/javatests/com/google/devtools/coverageoutputgenerator:srcs", - "//tools/windows:srcs", "//tools/zip:srcs", ], ) @@ -66,7 +65,6 @@ filegroup( "//tools/sh:embedded_tools", "//tools/test:embedded_tools", "//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:embedded_tools", - "//tools/windows:srcs", "//tools/zip:srcs", ], ) @@ -85,7 +83,6 @@ filegroup( "//tools/python:bzl_srcs", "//tools/sh:bzl_srcs", "//tools/test:bzl_srcs", - "//tools/windows:bzl_srcs", ], ) diff --git a/tools/BUILD.tools b/tools/BUILD.tools index 7ce6fba5d8de2a..b929d94930f5de 100644 --- a/tools/BUILD.tools +++ b/tools/BUILD.tools @@ -21,6 +21,5 @@ filegroup( "//tools/python:bzl_srcs", "//tools/sh:bzl_srcs", "//tools/test:bzl_srcs", - "//tools/windows:bzl_srcs", ], ) diff --git a/tools/windows/BUILD b/tools/windows/BUILD deleted file mode 100644 index c71554c023330c..00000000000000 --- a/tools/windows/BUILD +++ /dev/null @@ -1,11 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -filegroup( - name = "srcs", - srcs = glob(["**"]), -) - -filegroup( - name = "bzl_srcs", - srcs = glob(["*.bzl"]), -) diff --git a/tools/windows/windows_config.bzl b/tools/windows/windows_config.bzl deleted file mode 100644 index 8f6a3d95af5307..00000000000000 --- a/tools/windows/windows_config.bzl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2022 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Rules to create windows configurations""" - -def create_windows_host_config(name = "windows_host_config"): - native.config_setting( - name = "host_windows_x64_constraint", - values = {"host_cpu": "x64_windows"}, - ) - - native.config_setting( - name = "host_windows_arm64_constraint", - values = {"host_cpu": "arm64_windows"}, - ) - - conditions = select({ - "host_windows_arm64_constraint": "host_windows_arm64_constraint", - "//conditions:default": "host_windows_x64_constraint", - }) - - native.alias(name = "host_windows", actual = conditions, visibility = ["//visibility:public"])