Skip to content

Windows: Bazel requires MSYS for every command #6462

Closed

Description

@laszlocsomor

Description of the problem / feature request:

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.

[1] https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

On a fresh Windows 10:

  1. download Bazel 0.18.0
  2. install the MSVC redistributable DLLs
  3. in cmd.exe:
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

What operating system are you running Bazel on?

Windows Server 2016 (v1607)

Activity

  1. changed the title [-]Windows: Bazel requires MSYS for any command[/-] [+]Windows: Bazel requires MSYS for every command[/+] on Oct 22, 2018
  2. self-assigned this
    on Oct 22, 2018
  3. added
    P2
    area-Windows
    on Oct 22, 2018
  4. laszlocsomor commented on Oct 22, 2018

    @laszlocsomor
    ContributorAuthor

    This is a bad first-time experience. See #5254

  5. robisim74 commented on Dec 20, 2018

    @robisim74

    @laszlocsomor

    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?

    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

  6. laszlocsomor commented on Dec 20, 2018

    @laszlocsomor
    ContributorAuthor

    @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!

  7. robisim74 commented on Dec 20, 2018

    @robisim74

    Ok, thanks! I will try to install v0.21 (still not published on npm) and let you know.

  8. robisim74 commented on Dec 20, 2018

    @robisim74

    @laszlocsomor I tried to download version 0.21 directly on my machine in c:\bazel, and run C:\> .\bazel help, but nothing: same error.

    For the moment, I installed MSYS2 bash to work.

  9. laszlocsomor commented on Jan 2, 2019

    @laszlocsomor
    ContributorAuthor

    @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.

  10. laszlocsomor commented on Feb 28, 2019

    @laszlocsomor
    ContributorAuthor

    Bazel 0.23 still complains about missing MSYS2:

    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
    
  11. added
    team-OSS
    on Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2area-Windowsteam-OSStype: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions