Bazel: Bazel commands hang in "Bash on Ubuntu on Windows"

Created on 7 Aug 2016  Â·  15Comments  Â·  Source: bazelbuild/bazel

Bazel can be installed Windows 10's new "Bash on Ubuntu on Windows" shell, and no errors or issues are reported during the installation process. However, when attempting to use any Bazel commands (for example, "bazel help"), the shell just hangs. I have posted details and screenshots about what I'm seeing in this issue that was posted over in Microsoft/BashOnWindows. Here is my strace output.

Does anybody know what is going on here?

P4 area-Windows windows team-XProduct bug

Most helpful comment

FWIW, I have tried today Bazel for Linux under the WSL, to compile https://github.com/lupino3/edumips64, and it worked perfectly.

All 15 comments

It looks like this has something to with Java, since the "java -version" command was hanging for me as well. I decided to switch to openjdk-7 and the Java 7-friendly version of Bazel, and now I'm hanging at "Extracting Bazel installation...". My updated strace output can be found here.

I'm not sure if we support this.. @dslomov what do you think?

We have not been working to support Bazel Linux-on-Windows. Our efforts so far concentrate on native Windows port. If there is enough interest, we can reconsider, and of course patches are welcome.

+1. The same for jdk 1.8 was resolved by downgrading for jdk 1.7 But Bazel still hand and Bazel-real process is doing something very long and hanging.

Hey Dmitry, +1 from me too

Hi all, (also hi Jomo ;))
Our situation regarding Ubuntu-on-Windoes hasn't changed since my last
reply: we are not actively working on this at the moment - our primary
focus is native Bazel on Windows - but we absolutely welcome community
contributions towards making it work.

On 9 Dec 2016 10:03 PM, "Jomo Fisher" notifications@github.com wrote:

Hey Dmitry, +1 from me too

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/bazelbuild/bazel/issues/1608#issuecomment-266122504,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AExrX3WCc2dlMMthpOEs5kr_pcIUErRdks5rGcILgaJpZM4JebXm
.

Supporting Windows Subsystem for Linux feature would be a huge step forward for all Java/JavaScript based and other cross platform bazel driven projects, e.g.: Gerrit Code Review.

Since the switch to Buck/Bazel driven build, we have lost some contributors, that would like to have native Windows support in the build tool chain.

Unfortunately, native Windows Bazel support is far from being usable. For example, there are these two blockers: https://github.com/bazelbuild/bazel/issues/2040 and https://github.com/bazelbuild/bazel/issues/2045.

So that "Bash on Ubuntu on Windows" sounds very promising to me. I can reproduce that with Bazel 0.4.5, bazel build :foo hangs. Moreover, after that , I must reboot the system, because bash isn't responding any more.

What I have tried so far: ps -aef. And tried to create stack dump, unfortunately it didn't work.

Any clues how to further investigate this issue would be highly appreciated.

Windows 10 Creators Upgrade is available (Version: 1703, build number: 15063.138). I'm using this trivial bazel project with java_library and java_binary and external dependency on Guava library: [1].

Before the upgrade to 1703, I saw the bazel build foo always hangs. After the upgrade, it works better. It hangs, but after killing and restarting it, build command succeed.

davido@wizball:~/projects/bazel_printy$ bazel run printy
INFO: Found 1 target...
Target //:printy up-to-date:
  bazel-bin/printy.jar
  bazel-bin/printy
INFO: Elapsed time: 0.829s, Critical Path: 0.01s

INFO: Running command line: bazel-bin/printy
Printy
Pass --version option to print the version

Here I've compiled bazel itself. Note, that it was hanging twice, but after killing and re-started the build, I was able to build bazel:

davido@wizball:~/projects/bazel$ git rev-parse HEAD
be7bb5ba60689e45ead657cc010bd1259a11c00d

davido@wizball:~/projects/bazel$ bazel build //src:bazel
INFO: Found 1 target...
Target //src:bazel up-to-date:
  bazel-bin/src/bazel
INFO: Elapsed time: 1.039s, Critical Path: 0.01

davido@wizball:~/projects/bazel$ bazel-bin/src/bazel version
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Jan 01 00:00:00 1970 (0)
Build timestamp: Thu Jan 01 00:00:00 1970 (0)
Build timestamp as int: 0

Building Gerrit Code Review, with fresh built bazel, and it hangs:

davido@wizball:~/projects/gerrit$ /home/davido/projects/bazel/bazel-bin/src/bazel build gerrit
INFO: Loading package: @user//jar

Looking at the hanging processes in different Windows bash instance: [2]. Just kill it and restart the build, it hangs again in a different build phase. I'm not able to finish gerrit build even after killing and restarting the build multiple times.

Interestingly enough, switching to the previous stable gerrit branch (stable-2.13) and building with buck, just worked, without hang up, even once:

davido@wizball:~/projects/gerrit$ buck build gerrit
Not using buckd because watchman isn't installed.
[-] PROCESSING BUCK FILES...FINISHED 2,8s [100%]
[-] DOWNLOADING... (0,00 B/S AVG, TOTAL: 0,00 B, 0 Artifacts)
[-] BUILDING...FINISHED 163,2s [100%] (614/614 JOBS, 348 UPDATED, 56,7% CACHE MISS)

If it helps, I tried running "strace bazel clean --expunge" and the last line I got before hanging was:
nanosleep({18446744073709551607, 18446744072803243116},

Maybe there's a clock issue somewhere causing a very long sleep?

Just passing through, but I was trying out bazel in the Windows Subsystem for Linux and it works for me. Installation versions:

  • Windows 10 version 1709 OS build 16299.248
  • Ubuntu app w/ release date 2017-07-10
  • Bazel installed via apt-get, reports label 0.10.1 via bazel version.

So, the problems reported above may have been inadvertently fixed.

So, the problems reported above may have been inadvertently fixed.

Thanks for bringing that fact to our attention. I will have a look if gerrit can be built now.

Same problem for me

@pia: which Bazel version do you use? How far does Bazel get -- can it start loading and analyzing packages and maybe build something, or does it hang just at startup without any progress?

FWIW, I have tried today Bazel for Linux under the WSL, to compile https://github.com/lupino3/edumips64, and it worked perfectly.

This seems to be fixed.

Was this page helpful?
0 / 5 - 0 ratings