-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--workspace_status_command option doesn't work on Windows #2040
Comments
I can repro this even with bazel built off HEAD:
...but only in the gerrit repo. If I create a new dummy repo, everything works fine. |
So, can it be, that it's something related to
Ans particularly to There is another pending fix for that: |
Good catch, that's in fact the culprit. :)
|
That was just WAG ;-) Actually this raises the question why failure in workspace command so bad tracked down. Particularly I would expect, that |
Agreed, this is a UX failure on our side. @aehlig , can we print a more helpful error message if the |
@laszlocsomor @aehlig not sure if I should open another issue for the actual culprit? It seems that mentioning in
doesn't seem to have any effect on Windows (or it's failing to execute, with unkown reason). Consider this content of
When invoked as standalone script it works as expected:
Now, consider this rule in
If I run it manually, all is fine:
When, however I'm running the mentioned
Bazel version: most recent master, compiled from source.
|
Shot in the dark: bazel executes the workspace status command in a subprocess through |
Sounds reasonable, and the question is, to fix that we would need some native support for this scenario? |
Apparently Windows:
And on Linux:
|
My genrule:
|
Buck's
See also this issue: facebook/buck#267 for more context. |
Laszlo, do you need to add --stamp to the bazel command line? |
I am facing the same problem. Is there any way to resolve this ?
Auto-Configuration Error: Visual C++ build tools not found on your machine. |
@ajaysaini-sgvu : You just closed a similar bug (#3221) an hour ago, does your comment here refer to the same problem, and is it resolved now? |
@laszlocsomor Nope. It was different issue, problem was with my network so had some interruption while downloading Bazel. |
@laszlocsomor I have added error logs, may help you to look what went wrong. |
Thanks! Do you have Visual Studio (with Visual C++) installed? Under which path? Also, if you open cmd.exe, what's the output of |
@laszlocsomor I installed Visual Studio , it prints |
Which version did you install exactly? If for example it's Visual Studio 2015, you'd have the
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
(See https://bazel.build/versions/master/docs/windows.html#build-c) |
Well @laszlocsomor . I am not sure why my cmd prompt : Permission denied even though I run it as administrator.
|
This looks like the wrong |
@laszlocsomor Yep. Would be great if this is in docs also. It is giving this error now:
|
@laszlocsomor can you guess cause of above error? |
Hey, yes, sorry about the long delay.
|
@laszlocsomor I did. Here are error logs: ajaysaini@AJAY3145984 D:\tensorflow
ajaysaini@AJAY3145984 D:\tensorflow |
I suspect this is a long path issue, where the MSVC compiler cannot handle long path.
|
@laszlocsomor Thanks. I have done suggested changes. I see lot of files created in tmp1 directory but it still fails.
|
@ajaysaini-sgvu, I'm looking at it now. Nothing obvious stands out. |
@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 The The The 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 |
@laszlocsomor correct, we only support Android bazel tf builds with Linux-based OS's. You can see tensorflow/tensorflow#6385 for more details and workarounds. |
So, trying again to build gerrit with Bazel 0.5.2 It seems that python tool chain doesn't work, neither on Cygwin, nor on Msys2. We are providing custom Trying to install Installation of I installed Windows native python 36. Trying to start building gerrit is failing on msys2:
Environment here is:
Trying to build on Cygwin is failing with:
Environment here is:
Here it seems, that cygwin's own python is used: |
/CC @damienmg (I would like to add Gerrit build on windows platform to Bazel CI). I think I'm making progress. I decided to use MSYS shell for now. Environment:
Build is failing on Gerrit master with custom built bazel: http://paste.openstack.org/show/614981.
Joda is here: https://github.com/GerritCodeReview/gerrit/blob/master/lib/joda/BUILD#L9-L13 and here: https://github.com/GerritCodeReview/gerrit/blob/master/WORKSPACE#L201-L205 Interestingly: Building Bazel master with my custom bazel build failing here too, but in cpp tool chain:
|
Not sure if I should open a new issue here for Bazel itself not building on Windows platform out of the box, but I need to patch bazel (master) to make Bauel compile itself. The culrprit for the failure i posted in my previous comment seems to be the invocation in
If I change
And "/C/Python27/python.exe" is called from
If I change the command in
then it works and bazel can be compiled successfully:
So the better question is, why |
OK, I figured it out the hard way, checked the source and noticed,
fixed Bazel build here. So for the record, and other folks, reading this. This environment did it for Bazel:
|
Unfortunately, still no luck with gerrit here:
Trying my small Bazel demo project that depends on
But after editing the tools/bazel.rc file and removing this line:
it works just fine:
So the problem seems to be gerrit specific. I will try to extract a small reproducer from gerrit tree in its own GH repository. |
Seeing this in the java.log:
|
Ok, I found the culprit in gerrit's
seems to be not portable and produces
and the corresponding output is:
Workaround for now is:
With this in place, the build is going further and is failing with missing
which I fixed, switching from using |
After seeing what is going on
Now a small part of gerrit can be built: http://paste.openstack.org/show/615216/ Trying to build other parts are failing in calling python from
with:
|
On Linux, the last command is something like:
And the used shell file is:
So, it seems that |
After fixing
but no matter what I'm passing as the
Apologise for german error messages. I tried many different path variants: relative, absolute, Windows and @meteorcloudy I cheked tensorflow repository, but cannot find any mentions of |
@davido I believe this is a wrong transformation on the command, |
@davido I tried removing quote around |
@meteorcloudy Indeed, thanks for the pointer. I also wonder, even though I'm on Windows, I'm using
|
@davido Bazel doesn't distinguish the platform based on which terminal you are running on, so even in MSYS, the platform would still be Windows. But I agree we can improve the logic in |
I guess we don't need to quote the command because now we use JNI to create process on Windows, @laszlocsomor do you think so? |
Confirmed, that applying this patch fixed the problem:
|
With all fixes, gerrit final artifact (headless UI, both GWT UI and PolyGerrit UI is a completely different story) |
Hi, I clone gerrit code and checked with version 2.14.5, When i build gerrit with bazel some error occurred. can you help me? here is the error log: |
@lilyandchih : please open a new bug about this using https://github.com/bazelbuild/bazel/issues/new |
…ows command to CMD.EXE. Fix bazelbuild/bazel#2040 (comment) RELNOTES: None PiperOrigin-RevId: 165562681
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:
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.
[1] http://paste.openstack.org/show/587839/
The text was updated successfully, but these errors were encountered: