Skip to content

Commit 6153f80

Browse files
benjaminpacozzette
authored andcommitted
Treat plugins as host tools.
As a followup to ca3ead7, treat plugin executables as well as protoc as host tools.
1 parent a8b8c03 commit 6153f80

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

protobuf.bzl

+4-2
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def _proto_gen_impl(ctx):
117117

118118
outs = [ctx.actions.declare_file(out, sibling = src) for out in outs]
119119
inputs = [src] + deps
120+
tools = [ctx.executable.protoc]
120121
if ctx.executable.plugin:
121122
plugin = ctx.executable.plugin
122123
lang = ctx.attr.plugin_language
@@ -131,11 +132,12 @@ def _proto_gen_impl(ctx):
131132
outdir = ",".join(ctx.attr.plugin_options) + ":" + outdir
132133
args += [("--plugin=protoc-gen-%s=" + path_tpl) % (lang, plugin.path)]
133134
args += ["--%s_out=%s" % (lang, outdir)]
134-
inputs += [plugin]
135+
tools.append(plugin)
135136

136137
if not in_gen_dir:
137138
ctx.actions.run(
138139
inputs = inputs,
140+
tools = tools,
139141
outputs = outs,
140142
arguments = args + import_flags + [src.path],
141143
executable = ctx.executable.protoc,
@@ -162,7 +164,7 @@ def _proto_gen_impl(ctx):
162164
outputs = [out],
163165
command = command,
164166
mnemonic = "ProtoCompile",
165-
tools = [ctx.executable.protoc],
167+
tools = tools,
166168
use_default_shell_env = True,
167169
)
168170

0 commit comments

Comments
 (0)