diff --git a/third_party/systemlibs/protobuf.bzl b/third_party/systemlibs/protobuf.bzl index bb807e904a3..367ac286395 100644 --- a/third_party/systemlibs/protobuf.bzl +++ b/third_party/systemlibs/protobuf.bzl @@ -93,6 +93,7 @@ def _proto_gen_impl(ctx): args += ["--python_out=" + gen_dir] inputs = srcs + deps + tools = [ctx.executable.protoc] if ctx.executable.plugin: plugin = ctx.executable.plugin lang = ctx.attr.plugin_language @@ -106,7 +107,7 @@ def _proto_gen_impl(ctx): outdir = ",".join(ctx.attr.plugin_options) + ":" + outdir args += ["--plugin=protoc-gen-%s=%s" % (lang, plugin.path)] args += ["--%s_out=%s" % (lang, outdir)] - inputs += [plugin] + tools.append(plugin) if args: ctx.actions.run( @@ -115,6 +116,7 @@ def _proto_gen_impl(ctx): arguments = args + import_flags + [s.path for s in srcs], executable = ctx.executable.protoc, mnemonic = "ProtoCompile", + tools = tools, use_default_shell_env = True, )