From d27f76fe8a973cc16555726a13f5263d92ef453b Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 14 Aug 2023 17:09:52 +0200 Subject: [PATCH] Remove `allow_single_file` parameter for `protoc` and `plugin` These are not needed, since `executable = True` already demands a single executable file --- haskell/protobuf.bzl | 2 -- tests/protoc.bzl | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/haskell/protobuf.bzl b/haskell/protobuf.bzl index 69ae8ee65c..43a2ce8540 100644 --- a/haskell/protobuf.bzl +++ b/haskell/protobuf.bzl @@ -368,13 +368,11 @@ _protobuf_toolchain = rule( "protoc": attr.label( executable = True, cfg = "exec", - allow_single_file = True, mandatory = True, ), "plugin": attr.label( executable = True, cfg = "exec", - allow_single_file = True, mandatory = True, ), "deps": attr.label_list( diff --git a/tests/protoc.bzl b/tests/protoc.bzl index 3fb6e6a7fd..e2ca373f76 100644 --- a/tests/protoc.bzl +++ b/tests/protoc.bzl @@ -18,19 +18,19 @@ import os, subprocess, sys os.environ["PATH"] += os.pathsep + os.path.realpath(os.path.dirname({compiler_exe})) subprocess.check_call([{protoc}] + sys.argv[1:]) -""".format(protoc = repr(ctx.file._protoc.path), compiler_exe = repr(compiler)), +""".format(protoc = repr(ctx.executable._protoc.path), compiler_exe = repr(compiler)), is_executable = True, ) return [DefaultInfo( executable = protoc_wrapper_file, - runfiles = ctx.runfiles(files = [protoc_wrapper_file, ctx.file._protoc]), + runfiles = ctx.runfiles(files = [protoc_wrapper_file, ctx.executable._protoc]), )] _protoc_wrapper = rule( executable = True, implementation = _protoc_wrapper_impl, attrs = { - "_protoc": attr.label(allow_single_file = True, default = "@com_google_protobuf//:protoc"), + "_protoc": attr.label(executable = True, cfg="exec", default = "@com_google_protobuf//:protoc"), }, toolchains = ["@rules_cc//cc:toolchain_type"], )