Skip to content

Commit

Permalink
Use use_default_shell_env whenever possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Muller committed Nov 18, 2020
1 parent b01b09e commit 8cb8aff
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions go/private/actions/asm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,10 @@ def emit_asm(
executable = go.toolchain._builder,
arguments = [builder_args, "--", tool_args],
env = go.env,
# 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. The target configuration
# may not have a C compiler, so we have no idea what PATH should be.
use_default_shell_env = "PATH" not in go.env,
)
return out_obj
5 changes: 5 additions & 0 deletions go/private/actions/compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,9 @@ def emit_compile(
executable = go.toolchain._builder,
arguments = [builder_args, "--", tool_args],
env = go.env,
# 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. The target configuration
# may not have a C compiler, so we have no idea what PATH should be.
use_default_shell_env = "PATH" not in go.env,
)
5 changes: 5 additions & 0 deletions go/private/actions/compilepkg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ def emit_compilepkg(
executable = go.toolchain._builder,
arguments = [args],
env = go.env,
# 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. The target configuration
# may not have a C compiler, so we have no idea what PATH should be.
use_default_shell_env = "PATH" not in go.env,
)

def _quote_opts(opts):
Expand Down
5 changes: 5 additions & 0 deletions go/private/actions/cover.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ def emit_cover(go, source):
executable = go.toolchain._builder,
arguments = [args],
env = go.env,
# 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. The target configuration
# may not have a C compiler, so we have no idea what PATH should be.
use_default_shell_env = "PATH" not in go.env,
)
members = structs.to_dict(source)
members["srcs"] = covered
Expand Down
5 changes: 5 additions & 0 deletions go/private/actions/link.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ def emit_link(
executable = go.toolchain._builder,
arguments = [builder_args, "--", tool_args],
env = go.env,
# 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. The target configuration
# may not have a C compiler, so we have no idea what PATH should be.
use_default_shell_env = "PATH" not in go.env,
)

def _extract_extldflags(gc_linkopts, extldflags):
Expand Down
5 changes: 5 additions & 0 deletions go/private/actions/pack.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@ def emit_pack(
executable = go.toolchain._builder,
arguments = [args],
env = go.env,
# 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. The target configuration
# may not have a C compiler, so we have no idea what PATH should be.
use_default_shell_env = "PATH" not in env,
)
5 changes: 5 additions & 0 deletions go/private/actions/stdlib.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ def _build_stdlib(go):
executable = go.toolchain._builder,
arguments = [args],
env = env,
# 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. The target configuration
# may not have a C compiler, so we have no idea what PATH should be.
use_default_shell_env = "PATH" not in env,
)
return GoStdLib(
root_file = root_file,
Expand Down
1 change: 1 addition & 0 deletions go/private/rules/info.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def _go_info_impl(ctx):
mnemonic = "GoInfo",
executable = ctx.executable._go_info,
arguments = [args],
use_default_shell_env = True,
)
return [DefaultInfo(
files = depset([report]),
Expand Down

0 comments on commit 8cb8aff

Please sign in to comment.