bazel: --workspace_status_command option doesn't work on Windows
With Bazel 0.3.2, on Windows, it’s failing to compile this particular target:
https://github.com/GerritCodeReview/gerrit/blob/master/gerrit-patch-jgit/BUILD#L27-L37
With this outcome:
davido@DESKTOP-VDNCUPU MSYS ~/projects/gerrit
$ bazel build gerrit-patch-jgit:edit.srcjar --verbose_failures --subcommands
WARNING: C:/tools/msys64/var/tmp/Bazel/Vne9nLyn/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
Auto-Configuration Warning: 'BAZEL_VS' is not set, start looking for the latest Visual Studio installed.
.
WARNING: C:/tools/msys64/var/tmp/Bazel/Vne9nLyn/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
Auto-Configuration Warning: Visual Studio found at C:\Program Files (x86)/Microsoft Visual Studio 15.0
.
INFO: Found 1 target...
>>>>> # //gerrit-patch-jgit:jgit_edit_src [action 'Executing genrule //gerrit-patch-jgit:jgit_edit_src']
cd C:/tools/msys64/var/tmp/Bazel/Vne9nLyn/execroot/gerrit
SET PATH=C:\tools\msys64\usr\local\bin;C:\tools\msys64\usr\bin;C:\tools\msys64\usr\bin;C:\tools\msys64\opt\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;C:\ProgramData\chocolatey\bin;C:\tools\python2;C:\ProgramData\chocolatey\bin;C:\tools\python2;C:\ProgramData\chocolatey\bin;C:\tools\python2;C:\ProgramData\chocolatey\bin;C:\tools\python2;C:\ProgramData\chocolatey\bin;C:\tools\python2;C:\ProgramData\chocolatey\bin;C:\tools\python2;C:\ProgramData\chocolatey\bin;C:\tools\python2
C:/tools/msys64/usr/bin/bash.exe -c source external/bazel_tools/tools/genrule/genrule-setup.sh; ROOT=$PWD && TMP=$(mktemp -d || mktemp -d -t bazel-tmp) && (unzip -qd $TMP external/jgit_src/file/org.eclipse.jgit-4.5.0.201609210915-r-sources.jar org/eclipse/jgit/diff/Edit.java && cd $TMP && zip -Dq $ROOT/bazel-out/local-fastbuild/genfiles/gerrit-patch-jgit/edit.srcjar org/eclipse/jgit/diff/Edit.java)
ERROR: Process exited with status 1.
ERROR: C:/tools/msys64/home/davido/projects/gerrit/gerrit-patch-jgit/BUILD:27:1: declared output 'gerrit-patch-jgit/edit.srcjar' was not created by genrule. This is probably because the genrule actually didn't create this output, or because the output was a directory and the genrule was run remotely (note that only the contents of declared file outputs are copied from genrules run remotely).
Target //gerrit-patch-jgit:edit.srcjar failed to build
INFO: Elapsed time: 1,032s, Critical Path: 0,04s
It seems that there is an issue with creating output artifacts here, e.g. here is similar failure for different target [1].
Environment: Bazel 0.3.2, bundled install with Chocolatey.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 61 (45 by maintainers)
Which version did you install exactly?
If for example it’s Visual Studio 2015, you’d have the
VS140COMNTOOLS
envvar set, e.g.:When you install VS, it usually adds these envvars to your environment. Bazel is looking for VSversionCOMNTOOLS envvars to find where VS is installed and which version is it. Your build is failing because Bazel cannot find these.
To fix it, you can set the
BAZEL_VS
environment variable to point to the VS installation location, e.g.:(See https://bazel.build/versions/master/docs/windows.html#build-c)
@laszlocsomor correct, we only support Android bazel tf builds with Linux-based OS’s. You can see https://github.com/tensorflow/tensorflow/issues/6385 for more details and workarounds.
@ajaysaini-sgvu : I think Windows is not yet fully supported by all the tools involved in this build.
Here’s the command you ran:
I ran a slightly modified version, with bazel 0.5.2:
And I also get a build error, though it’s different than yours:
The
--bazelrc=NUL
and--nomaster_bazelrc
flags ensure that bazel won’t pick up any of my bazelrc files, and use flags from there. This way the flags I passed in this command are the only ones that are actually used.The
--output_user_root
and--host_jvm_args
flags are the same I recommended to you earlier.The
--cpu
,--crosstool_top
, and--host_crosstool_top
flags come from your command, and I believe you copied those from//tensorflow/contrib/android/BUILD
file. Those were added by @andrewharp, and I believe he intended those to be used on Linux or MacOS.The
--copt=-w
and--host_copt=-w
flags just reduce compiler noise on stdout; MSVC likes to print zillions of warnings and notices.I believe the specified crosstool and host-crosstool don’t yet work on Windows. The reason I believe that is that the command Bazel tried to run was
/bin/false
, which of course always fails, so it looks like the crosstool isn’t supported on this platform. @andrewharp, @mhlopko : can you confirm?