

To build C++ targets with MSVC, you need: System Properties > Advanced > Environment Variables. To always set the variables when cmd.exe starts, youĬan add them to the User variables or System variables in the Control Panel > Setting environment variablesĮnvironment variables you set in the Windows Command Prompt ( cmd.exe) are only Linux (WSL) to build these rules, but currently it is not a priority for In the future, there may be an option to use Windows Subsystem for Repositories your project depends on (even transitively). ThisĪpplies not only to rules in your project, but to rules in any of the external Rules that use _shell() and ctx.resolve_command(). You need Bash to build and test sh_* rules, and to build and test Starlark Using sh_binary and sh_* rules, and _shell() without Bash Starting with Bazel 1.0, you can run any rule without Bash, except when: the test rule itself requires Bash (because its executable is a shell script)īazel versions before 1.0 used to require Bash to bazel run anything.Starting with Bazel 1.0, you can test any rule without Bash, except when: When built on Windows, these rules do not require Bash.īazel versions before 1.0 used to require Bash to bazel test anything. Instead of using genrule (and depending on Bash) you may find a suitable rule However, genrule is often used for simple tasks like Starlark rule that uses _shell() or ctx.resolve_command().sh_binary or sh_test rule, because these inherently need Bash.genrule, because genrules execute Bash commands.Starting with Bazel 1.0, you can build any rule without Bash unless it is a: Seeīazel versions before 1.0 used to require Bash to build some rules.

Interrupting the build with Ctrl+C from MSYS2).Īlso, if you choose to run under MSYS2, you need to disable MSYS2’sĪutomatic path conversion, otherwise MSYS will convert command line arguments May work for most use cases, some things are broken, like Recommendation: Run Bazel from the command prompt ( cmd.exe) or fromĪs of, do not run Bazel from bash – eitherįrom MSYS2 shell, or Git Bash, or Cygwin, or any other Bash variant. Only enable this feature when you need it. The -enable_runfiles flag can potentially create a large amount of file symlinks. Note: Creating symlinks on Windows is an expensive operation.
