Skip to content

Commit

Permalink
Remove allow_single_file parameter for protoc and plugin
Browse files Browse the repository at this point in the history
These are not needed, since `executable = True` already demands a single executable file
  • Loading branch information
avdv committed Aug 17, 2023
1 parent cafa653 commit d27f76f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions haskell/protobuf.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions tests/protoc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)
Expand Down

0 comments on commit d27f76f

Please sign in to comment.