From d0e38daeab4cbd8f4fe91d728f634fc654b19607 Mon Sep 17 00:00:00 2001 From: James Bartlett Date: Thu, 19 Jan 2023 16:58:16 -0800 Subject: [PATCH] [build/sysroots] Cleanup targets being built for "target" cfg, when they should be built for "exec". Summary: There are some targets that were being built for the "target" cfg unnecessarily. This diff makes sure they're built for the "exec" cfg. Test Plan: Should be no functional changes. Relying on existing tests. Reviewers: zasgar, michelle, vihang Reviewed By: zasgar, vihang Signed-off-by: James Bartlett Differential Revision: https://phab.corp.pixielabs.ai/D12855 GitOrigin-RevId: cd3f0ad3cac4df670442edebd359dddb536333e7 --- bazel/licenses.bzl | 2 +- bazel/proto_compile.bzl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bazel/licenses.bzl b/bazel/licenses.bzl index 1786aae60f6..8250a8461b8 100644 --- a/bazel/licenses.bzl +++ b/bazel/licenses.bzl @@ -42,7 +42,7 @@ fetch_licenses = rule( implementation = _fetch_licenses_impl, attrs = dict({ "disallow_missing": attr.bool(), - "fetch_tool": attr.label(mandatory = True, allow_single_file = True), + "fetch_tool": attr.label(mandatory = True, allow_single_file = True, cfg = "exec"), "manual_licenses": attr.label(mandatory = True, allow_single_file = True), "out_found": attr.output(mandatory = True), "out_missing": attr.output(), diff --git a/bazel/proto_compile.bzl b/bazel/proto_compile.bzl index e9c1a8c1d41..6969a23e681 100644 --- a/bazel/proto_compile.bzl +++ b/bazel/proto_compile.bzl @@ -141,6 +141,9 @@ def pl_py_grpc_library(name, proto, deps = [], **kwargs): name = codegen_py_grpc_target, srcs = [proto], deps = [codegen_py_pb_target], + target_compatible_with = [ + "//bazel/cc_toolchains:is_exec_true", + ], ) py_library( name = name, @@ -201,6 +204,7 @@ colocate_python_files = rule( mandatory = True, providers = [PyInfo], allow_files = True, + cfg = "exec", ), protos_include_dir = attr.string(), ),