diff options
author | IcyTv <michael.finger@icytv.de> | 2022-03-07 20:50:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-07 20:50:19 +0300 |
commit | 98dce6ca187004189ad0828e778a45b6dcf24dce (patch) | |
tree | 434454b1fbaf9ce0968f1fca36460dca15bb5db6 /BUILD.bazel | |
parent | 920156cf183baa11f6b65d159da6fba9fdab684e (diff) |
Fixed Bazel Windows build (#4736)
* Fixed Bazel Windows build
Before this commit, the bazel build setup would not work on windows.
This is due to the fact, that genrule tries to use bash, which fails.
One fix would be to use bazel-skylib's run_binary.
This however does not work (easily) since genrules is more complex.
To (temporarily) fix the windows build, I added the `cmd_bat` property to every genrule.
This seems more like a hack, because it basically repeat commands,
but for now it at least builds on windows.
* Removed BAZEL_SH from bazel presubmit build script
Thanks to @s-perron for pointing out, that the presubmit script uses the msys64 bash shell for the bazel build.
Since adding the `cmd_bat` argument removes the dependency on bash, this is no longer needed.
Diffstat (limited to 'BUILD.bazel')
-rw-r--r-- | BUILD.bazel | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/BUILD.bazel b/BUILD.bazel index b2031dede..c86ebbef8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -81,6 +81,7 @@ genrule( srcs = ["@spirv_headers//:spirv_xml_registry"], outs = ["generators.inc"], cmd = "$(location generate_registry_tables) --xml=$(location @spirv_headers//:spirv_xml_registry) --generator-output=$(location generators.inc)", + cmd_bat = "$(location //:generate_registry_tables) --xml=$(location @spirv_headers//:spirv_xml_registry) --generator-output=$(location generators.inc)", tools = [":generate_registry_tables"], ) @@ -94,6 +95,7 @@ genrule( srcs = ["CHANGES"], outs = ["build-version.inc"], cmd = "SOURCE_DATE_EPOCH=0 $(location update_build_version) $$(dirname $(location CHANGES)) $(location build-version.inc)", + cmd_bat = "set SOURCE_DATE_EPOCH=0 && $(location //:update_build_version) \"$(location CHANGES)\\..\" $(location build-version.inc)", tools = [":update_build_version"], ) |