Skip to content
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

Bazel commands hang in "Bash on Ubuntu on Windows" #1608

Closed
slamphear opened this issue Aug 7, 2016 · 15 comments
Closed

Bazel commands hang in "Bash on Ubuntu on Windows" #1608

slamphear opened this issue Aug 7, 2016 · 15 comments
Assignees
Labels
area-Windows Windows-specific issues and feature requests P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) platform: windows team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug
Milestone

Comments

@slamphear
Copy link

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?

@slamphear
Copy link
Author

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.

@hermione521
Copy link
Contributor

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

@dslomov
Copy link
Contributor

dslomov commented Aug 8, 2016

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.

@dslomov dslomov added P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) type: bug platform: windows and removed under investigation labels Aug 8, 2016
@snarb
Copy link

snarb commented Aug 13, 2016

+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.

@jomof
Copy link

jomof commented Dec 9, 2016

Hey Dmitry, +1 from me too

@dslomov
Copy link
Contributor

dslomov commented Dec 9, 2016 via email

@davido
Copy link
Contributor

davido commented Apr 11, 2017

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: #2040 and #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.

@davido
Copy link
Contributor

davido commented Apr 11, 2017

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)

@leandro-gracia-gil
Copy link

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?

@dslomov dslomov modified the milestones: 0.7, 0.6 Jul 24, 2017
@iainmcgin
Copy link

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.

@davido
Copy link
Contributor

davido commented Feb 17, 2018

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.

@pia
Copy link

pia commented Oct 4, 2018

Same problem for me

@laszlocsomor
Copy link
Contributor

@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?

@lupino3
Copy link

lupino3 commented Nov 4, 2018

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

@aiuto aiuto added area-Windows Windows-specific issues and feature requests and removed category: misc > misc labels Dec 10, 2018
@meisterT
Copy link
Member

This seems to be fixed.

@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windows Windows-specific issues and feature requests P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) platform: windows team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug
Projects
None yet
Development

No branches or pull requests