You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: Bazel requires MSYS for every command #6462
P2We'll consider working on this in future. (Assignee optional)area-WindowsWindows-specific issues and feature requeststeam-OSSIssues for the Bazel OSS team: installation, release processBazel packaging, websitetype: bug
On a fresh Windows 10 installation with only Bazel 0.18.0 and MSVC redistributable DLLs [1] and without MSYS, running any command in a minimal workspace (just an empty WORKSPACE file) requires MSYS bash.
C:\>md c:\src\foo
C:\>cd c:\src\foo
C:\src\foo>echo # hello>WORKSPACE
C:\src\foo>bazel info release
Bazel on Windows requires MSYS2 Bash, but we could not find it.
If you do not have it installed, you can install MSYS2 from
http://repo.msys2.org/distrib/msys2-x86_64-latest.exe
If you already have it installed but Bazel cannot find it,
set BAZEL_SH environment variable to its location:
set BAZEL_SH=c:\path\to\msys2\usr\bin\bash.exe
[bazel ERROR src/main/cpp/blaze_util_windows.cc:1453] bash.exe not found on PATH
[bazel INFO src/main/cpp/blaze_util_windows.cc:1473] BAZEL_SH detection took 0 msec, found
I get the same error: Bazel on Windows requires MSYS2 Bash, but we could not find it for every command using the binaries for Bazel provided by the @bazel/bazel v0.20.0 npm package.
So the only way to run Bazel on Windows is to install MSYS2 bash and disable the path conversion?
C:\src\tmp>c:\Users\laszlocsomor\Downloads\bazel-0.23.0-windows-x86_64.exe info release
ERROR: bash.exe not found on PATH
Bazel on Windows requires MSYS2 Bash, but we could not find it.
If you do not have it installed, you can install MSYS2 from
http://repo.msys2.org/distrib/msys2-x86_64-latest.exe
If you already have it installed but Bazel cannot find it,
set BAZEL_SH environment variable to its location:
set BAZEL_SH=c:\path\to\msys2\usr\bin\bash.exe
[bazel ERROR src/main/cpp/blaze_util_windows.cc:1462] bash.exe not found on PATH
[bazel INFO src/main/cpp/blaze_util_windows.cc:1477] BAZEL_SH detection took 0 msec, found
P2We'll consider working on this in future. (Assignee optional)area-WindowsWindows-specific issues and feature requeststeam-OSSIssues for the Bazel OSS team: installation, release processBazel packaging, websitetype: bug
Activity
[-]Windows: Bazel requires MSYS for any command[/-][+]Windows: Bazel requires MSYS for every command[/+]laszlocsomor commentedon Oct 22, 2018
This is a bad first-time experience. See #5254
Windows: Bazel no longer fails if MSYS is missing
robisim74 commentedon Dec 20, 2018
@laszlocsomor
I get the same error:
Bazel on Windows requires MSYS2 Bash, but we could not find itfor every command using the binaries for Bazel provided by the@bazel/bazelv0.20.0 npm package.So the only way to run Bazel on Windows is to install MSYS2 bash and disable the path conversion?
The doc says to prefer Command Prompt or PowerShell: https://docs.bazel.build/versions/master/windows.html#running-bazel-msys2-shell-vs-command-prompt-vs-powershell
laszlocsomor commentedon Dec 20, 2018
@robisim74 : try Bazel 0.21, that should no longer complain about a missing MSYS2 Bash. Please let me know if you still find problems with it!
robisim74 commentedon Dec 20, 2018
Ok, thanks! I will try to install v0.21 (still not published on npm) and let you know.
robisim74 commentedon Dec 20, 2018
@laszlocsomor I tried to download version 0.21 directly on my machine in
c:\bazel, and runC:\> .\bazel help, but nothing: same error.For the moment, I installed MSYS2 bash to work.
laszlocsomor commentedon Jan 2, 2019
@robisim74 : You're right. I never merged the corresponding PR (#6582) because it broke some tests.
Installing MSYS2 is the best "workaround" for now. Sorry about that.
laszlocsomor commentedon Feb 28, 2019
Bazel 0.23 still complains about missing MSYS2:
Windows: Bash is no longer required for everything