Skip to content

Commit c82b43d

Browse files
devversionalexeagle
authored andcommitted
fix: node executables not running on windows if bash toolchain path (#1104)
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. ```
1 parent 5e98bda commit c82b43d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/common/windows_utils.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ set RUNFILES_MANIFEST_ONLY=1
9696
call :rlocation "{sh_script}" run_script
9797
for %%a in ("{bash_bin}") do set "bash_bin_dir=%%~dpa"
9898
set PATH=%bash_bin_dir%;%PATH%
99-
{bash_bin} -c "!run_script! %*"
99+
"{bash_bin}" -c "!run_script! %*"
100100
""".format(
101101
bash_bin = ctx.toolchains["@bazel_tools//tools/sh:toolchain_type"].path,
102102
sh_script = _to_manifest_path(ctx, shell_script),

0 commit comments

Comments
 (0)