0

I'd like to make Bazel rules that don't depend on Bash on Windows.

I see that in a genrule, you can use cmd_bat instead of cmd (which requires bash). But how can I define the rule so that there is a cmd attribute and a cmd_bat attribute, and on Windows only cmd_bat is used and everywhere else cmd is used?

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
matthias_buehlmann
  • 4,641
  • 6
  • 34
  • 76

1 Answers1

2

In Bazel 3.2.0 cmd_bat is only consided on Windows. In other OS it is simply ignored. cmd_bat has a higher priority than cmd.

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90