1# Copyright 2018 The Bazel Authors. All rights reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15load("@bazel_skylib//:bzl_library.bzl", "bzl_library") 16load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") 17load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test") 18 19package(default_visibility = ["//visibility:public"]) 20 21licenses(["notice"]) 22 23py_binary( 24 name = "legacy_fields_migrator", 25 srcs = ["legacy_fields_migrator.py"], 26 python_version = "PY3", 27 deps = [ 28 ":legacy_fields_migration_lib", 29 "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2", 30 "@io_abseil_py//absl:app", 31 "@io_abseil_py//absl/flags", 32 #internal proto upb dep, 33 ], 34) 35 36py_library( 37 name = "legacy_fields_migration_lib", 38 srcs = ["legacy_fields_migration_lib.py"], 39 deps = [ 40 "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2", 41 ], 42) 43 44py_test( 45 name = "legacy_fields_migration_lib_test", 46 srcs = ["legacy_fields_migration_lib_test.py"], 47 python_version = "PY3", 48 deps = [ 49 ":legacy_fields_migration_lib", 50 "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2", 51 ], 52) 53 54py_binary( 55 name = "crosstool_query", 56 srcs = ["crosstool_query.py"], 57 python_version = "PY3", 58 deps = [ 59 "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2", 60 "@io_abseil_py//absl:app", 61 "@io_abseil_py//absl/flags", 62 #internal proto upb dep, 63 ], 64) 65 66py_binary( 67 name = "ctoolchain_comparator", 68 srcs = ["ctoolchain_comparator.py"], 69 python_version = "PY3", 70 deps = [ 71 ":ctoolchain_comparator_lib", 72 "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2", 73 "@io_abseil_py//absl:app", 74 "@io_abseil_py//absl/flags", 75 #internal proto upb dep, 76 ], 77) 78 79py_library( 80 name = "ctoolchain_comparator_lib", 81 srcs = ["ctoolchain_comparator_lib.py"], 82 deps = [ 83 "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2", 84 ], 85) 86 87py_test( 88 name = "ctoolchain_comparator_lib_test", 89 srcs = ["ctoolchain_comparator_lib_test.py"], 90 python_version = "PY3", 91 deps = [ 92 ":ctoolchain_comparator_lib", 93 "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2", 94 "@py_mock//py/mock", 95 ], 96) 97 98go_binary( 99 name = "convert_crosstool_to_starlark", 100 srcs = ["convert_crosstool_to_starlark.go"], 101 deps = [ 102 ":crosstooltostarlarklib", 103 "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_go_proto", 104 "@com_github_golang_protobuf//proto:go_default_library", 105 ], 106) 107 108go_library( 109 name = "crosstooltostarlarklib", 110 srcs = ["crosstool_to_starlark_lib.go"], 111 importpath = "tools/migration/crosstooltostarlarklib", 112 deps = ["//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_go_proto"], 113) 114 115go_test( 116 name = "crosstooltostarlarklib_test", 117 size = "small", 118 srcs = ["crosstool_to_starlark_lib_test.go"], 119 embed = [":crosstooltostarlarklib"], 120 deps = [ 121 "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_go_proto", 122 "@com_github_golang_protobuf//proto:go_default_library", 123 ], 124) 125 126filegroup( 127 name = "bazel_osx_p4deps", 128 srcs = [ 129 "BUILD", 130 "ctoolchain_compare.bzl", 131 ], 132) 133 134bzl_library( 135 name = "ctoolchain_compare_bzl", 136 srcs = ["ctoolchain_compare.bzl"], 137 visibility = ["//visibility:private"], 138) 139 140bzl_library( 141 name = "cc_toolchain_config_comparator_bzl", 142 srcs = ["cc_toolchain_config_comparator.bzl"], 143 visibility = ["//visibility:private"], 144) 145