From 9b7b0864c6913295ad98c8bb93539e3de1d33aee Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Fri, 6 Sep 2019 17:03:55 +0200 Subject: [PATCH] fix: node executables not running on windows if bash toolchain path contains whitespace. The windows launcher code does currently break if the path to the bash binary contains a whitespace. This is common on windows where programs are stored under `C:\Program Files`. e.g. ``` :run C:/Program Files/msys2/usr/bin/bash.exe -c "!run_script!" ``` The path needs to be quoted so that it won't be incorrectly picked up as two separate commands. Resulting in an exception like: ``` 'C:/Program' is not recognized as an internal or external command, operable program or batch file. ``` --- internal/common/windows_utils.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/common/windows_utils.bzl b/internal/common/windows_utils.bzl index 43823b3690..7fe9a41eba 100644 --- a/internal/common/windows_utils.bzl +++ b/internal/common/windows_utils.bzl @@ -83,7 +83,7 @@ SETLOCAL ENABLEEXTENSIONS SETLOCAL ENABLEDELAYEDEXPANSION {rlocation_function} call :rlocation "{sh_script}" run_script -{bash_bin} -c "!run_script!" +"{bash_bin}" -c "!run_script!" """.format( bash_bin = ctx.toolchains["@bazel_tools//tools/sh:toolchain_type"].path, sh_script = _to_manifest_path(ctx, shell_script),