-
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
WindowsFileSystem#determineUnixRoot has a hardcoded timeout of 3 seconds, which is problematic for our unit tests #2983
Comments
Thanks! Solution is to define the msys root as a JVM variable, e.g.:
|
the test that failed for me was https://github.com/bazelbuild/bazel/blob/28c9617d53bf58dcba9572bcfdc165c62421d983/src/test/shell/bazel/bazel_windows_example_test.sh if you're sure that the lack of bazel.windows_unix_root jvm system property is the problem, then that means my diagnosis was wrong (i just jumped at the sight of a hardcoded short timeout). but then my next question would be "how does this test ever currently pass???" |
perhaps bazel/src/main/java/com/google/devtools/build/lib/windows/WindowsFileSystem.java Line 507 in 28c9617
|
i should remove that logic [1] anyway (as well as the System.getenv call in line 501), and use the [1] bazel/src/main/java/com/google/devtools/build/lib/windows/WindowsFileSystem.java Lines 503 to 522 in 28c9617
|
Workaround for #2983 Change-Id: Ib7eb2acff9a3bd1eee304d2d329d2a525a91eee1 PiperOrigin-RevId: 155722499
For me, on Windows 7 (I know, I know...), the adding The good news is that changing the timeout to 21 seconds in WindowsFileSystem.java did fix the problem. I have a relatively speedy laptop at work for development, but... there is so much Windows-anti-malware-stupidity running on the system that spawning out a process takes waaaaaay longer than three seconds. Usually it can work in under 10. Usually. Sigh. |
Added PR #3160 |
That's the bug, not the timeout. |
I managed to repro the bug: Bazel doesn't pick up the JVM flag from the bazelrc. I modified Bazel to throw an IllegalStateException if the Without the JVM flag:
JVM flag passed on the command line:
JVM flag in the bazelrc:
|
@adfernandes : please see #3170 (comment) |
Hmm. Actually, my instance of this bug is a little different. I was building bazel from source, and nowhere in the docs (under either using nor installing) does it say that on Windows the Thanks for changing the exception to "IllegalState", though. That's far less misleading than before. But it still doesn't help someone trying to use or build bazel for the first time. On my system, I tried both the prebuilt binary and building from source. Reading the comments in this bug report, it wasn't (and still isn't) clear that a In this case, the code fell back to So increasing the timeout did fix the bug... kinda'. |
It isn't, only the
Uhm, I should've clarified that this was a local change :) Not yet merged. But I'm working on merging it!
It's not. What makes you think it is? |
Hmm. Probably the difference between building from On On pre-built bazel
is fine. Note that I have always had So until the next |
(Actually, a little side-note - it turns out that on my system, even 13 seconds is not enough to prevent a timeout... I had to set it to 21 seconds! And I've been building bazel a lot from source today! Boy, I hope this problem is fixed upstream!) :) |
You could pass the --host_jvm_args flag even while bootstrapping like so:
Ouch, that 21 second timeout sounds atrocious, I'm surprised you had the patience to try anything at all. |
And if that doesn't work for whatever reason, then please let me know, and also you could hardcode the path in WindowsFileSystem.UNIX_ROOT as:
|
@laszlocsomor: Much appreciated, thanks! I will try to get to testing it, but, unfortunately I've put a lot of time into this already. I've got enough battles to try and fight ("Why isn't maven good enough? I mean, it integrates so well with Spring!" 🤢 ) that I can only put so much effort into bazel. 😞 But I will try! |
bazel/src/main/java/com/google/devtools/build/lib/windows/WindowsFileSystem.java
Lines 506 to 507 in b13457b
note that this is a timeout for termination of a subprocess.
we're getting flaky test failures with stack traces like
java.lang.ExceptionInInitializerError
at com.google.devtools.build.lib.runtime.BlazeRuntime.fileSystemImplementation(BlazeRuntime.java:825)
at com.google.devtools.build.lib.runtime.BlazeRuntime.newRuntime(BlazeRuntime.java:971)
at com.google.devtools.build.lib.runtime.BlazeRuntime.batchMain(BlazeRuntime.java:753)
at com.google.devtools.build.lib.runtime.BlazeRuntime.main(BlazeRuntime.java:561)
at com.google.devtools.build.lib.bazel.BazelMain.main(BazelMain.java:58)
Caused by: java.lang.IllegalThreadStateException: process has not exited
at java.lang.ProcessImpl.exitValue(ProcessImpl.java:443)
at com.google.devtools.build.lib.windows.WindowsFileSystem.determineUnixRoot(WindowsFileSystem.java:509)
at com.google.devtools.build.lib.windows.WindowsFileSystem.(WindowsFileSystem.java:324)
... 5 more
take a look at
bazel/src/test/java/com/google/devtools/build/lib/testutil/TestUtils.java
Lines 136 to 151 in 5abb90d
The text was updated successfully, but these errors were encountered: