Skip to content

Commit

Permalink
[bazel] Add default shell env to gen_well_known_protos_java
Browse files Browse the repository at this point in the history
We may need the shell environment (potentially augmented with
`--action_env`) to invoke protoc on Windows. If protoc was built with
mingw, it probably needs .dll files in non-default locations that must be
in PATH. Previously with `--compiler=mingw-gcc`,
`bazel build //:gen_well_known_protos_java` would fail on Windows. This
CL fixes the issue.

Also we have `default_shell_env` set to True for `ProtoCompile`, this makes
the behavior consistent.

See #2933, and
https://github.com/bazelbuild/rules_go/blob/585a27ad0ab5bdd185aa3bd5b0877a778d4777ad/proto/compiler.bzl#L130
  • Loading branch information
adamyi authored and acozzette committed Aug 20, 2020
1 parent 5438172 commit 88f3ef7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions protobuf.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ def _internal_gen_well_known_protos_java_impl(ctx):
inputs = descriptors,
outputs = [srcjar],
arguments = [args],
use_default_shell_env = True,
)

return [
Expand Down

0 comments on commit 88f3ef7

Please sign in to comment.