From b467afc40fa6f393d67d92dbabb80a38a4571b91 Mon Sep 17 00:00:00 2001 From: irengrig Date: Mon, 10 Sep 2018 11:34:43 +0200 Subject: [PATCH] Correct "use default shell environment" action argument (#83) We should take the default PATH passed by Bazel, not that from cc_toolchain for Windows, because the PATH under msys2 is different and that is which we need for shell commands --- tools/build_defs/framework.bzl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/build_defs/framework.bzl b/tools/build_defs/framework.bzl index e702ffb2..84342a99 100644 --- a/tools/build_defs/framework.bzl +++ b/tools/build_defs/framework.bzl @@ -201,7 +201,10 @@ def cc_external_rule_impl(ctx, attrs): inputs = depset(inputs.declared_inputs) + ctx.attr._cc_toolchain.files, outputs = outputs.declared_outputs, tools = ctx.attr._utils.files, - use_default_shell_env = False, + # We should take the default PATH passed by Bazel, not that from cc_toolchain + # for Windows, because the PATH under msys2 is different and that is which we need + # for shell commands + use_default_shell_env = targets_windows(ctx, None), command = script_text, execution_requirements = execution_requirements, env = env,