You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LAUNCHER ERROR: Cannot calculate relative path from absolute path under different drives. #5125
I've changed our Windows images to not use a local SSD, thus now everything is on drive C. However, there's one test that still fails:
Error: Current working directory has a path longer than allowed for a
Win32 working directory.
Can't start native Windows application from here.
external/bazel_tools/tools/test/test-setup.sh: line 232: C:/users/buildkite/_bazel_buildkite/ihg0nqgr/execroot/io_bazel/_tmp/2713b7a92d8298dcf32c3b44de75c8b1/root/abwzq2tc/execroot/__main__/bazel-out/x64_windows_msvc-fastbuild/bin/examples/java-native/src/test/java/com/example/myproject/custom.exe: File name too long
The error comes from the java_binary launcher (//src/tools/launcher) where it creates the classpath jar. The classpath jar is a jar file with a manifest that contains a classpath, and we use it to work around command line length limitations. The downside is that the classpath in the manifest must use relative paths, relative to the main jar, meaning all jar files must be on the same drive.
A workaround could be that the launcher creates junctions upon startup and references jar files through those.
Hi, thanks! No, IMHO this is a remaining P1 breakage that may even warrant a patch release - the Windows CI runs on hacky workarounds at the moment and stuff might break any moment if someone checks in a test that has a longer name than the one that broke. I would like to revert both workarounds (disabling local SSDs and the shortened user name) in a few days.
This was a bad enough breakage (unfortunately not detected pre-release) that it would have been warranted to rollback the 0.13.0 release, but we don't have any process for that, so I didn't and instead cooked up this semi-working workaround to at least get our presubmits working again.
Here's how it should look like and looked like until 0.13.0 was released and I had to disable local SSDs on our Windows VMs due to the new behavior ("Bazel now puts output user root underneath the user's home directory") and this bug ("Java launcher doesn't work when files are on two different drives"):
C:\ is the slow, persistent SSD used only to store the Windows OS, some Buildkite Agent files and the user's home directories (which should be unused).
D:\ is the fast, local SSD which should be used as the output_user_root for all Bazel invocations and temporary files. Most notably, there's D:\build which is where the Buildkite Agent checks out Git repos and invokes Bazel in and D:\temp which is %TEMP% / %TMP% and should also be used by Bazel for output bases.
This all worked fine until 0.13.0 was released and Bazel no longer respected %TEMP% for the output_user_root.
Notably:
"Bazel used to hit long path limitations on CI": I don't think this ever happened on our new CI.
The fact that Remote Desktop follows junctions and deleted wrong stuff is unfortunate, but I don't think it warrants changing Bazel's behavior to no longer use %TEMP% as the output base, especially considering that this broke our CI.
Here's what we should do:
Somehow let Bazel use %TEMP% as the output user root again.
Re-enable local SSDs on Windows VMs. This brings back D:\.
Revert all the changes that disabled use of D:\ in rules_sass. It was the correct thing to use D:\ in these cases.
Here's what we shouldn't do:
Switch stuff to C:\build (which is the slow persistent SSD).
Call things like "renaming the buildkite user to b" or disabling local SSDs a "fix" for these problems. They're horrible workarounds that I invented under pressure because our CI was broken after 0.13.0 got released and all presubmits failed. I had to make up something to get this unblocked, but this should all have been reverted by now. If there are users out there who have a similar setup like we had on CI, e.g. a separate fast scratch drive for their output base, then 0.13.0 broke them, too and they might not be able to rename their users to single letters or move their stuff to their primary drive C:\, which might just be too small.
@laszlocsomor I believe it's fine to do that. We were always using %TEMP% as the output root, it didn't cause any file deleted unexpectedly problem. @buchgr Can you re-enable the SSD (D:/) as Phillip suggested?
Activity
Disable usage of local SSD on Windows VMs.
philwo commentedon May 1, 2018
I've changed our Windows images to not use a local SSD, thus now everything is on drive C. However, there's one test that still fails:
https://buildkite.com/bazel/bazel-bazel/builds/1828#947a6adc-df29-45be-b9a1-2ab832430636
https://buildkite.com/organizations/bazel/pipelines/bazel-bazel/builds/1828/jobs/947a6adc-df29-45be-b9a1-2ab832430636/artifacts/03b9b283-33ee-45eb-95c6-8302625001c4
Rename the buildkite user to 'b' on Windows.
philwo commentedon May 1, 2018
The workaround of renaming the Buildkite user to „b“ has worked, Bazel’s CI job is green again.
laszlocsomor commentedon May 2, 2018
Thanks for reporting and finding a workaround!
The error comes from the java_binary launcher (
//src/tools/launcher) where it creates the classpath jar. The classpath jar is a jar file with a manifest that contains a classpath, and we use it to work around command line length limitations. The downside is that the classpath in the manifest must use relative paths, relative to the main jar, meaning all jar files must be on the same drive.A workaround could be that the launcher creates junctions upon startup and references jar files through those.
laszlocsomor commentedon May 2, 2018
@philwo , may I close this bug?
philwo commentedon May 2, 2018
Hi, thanks! No, IMHO this is a remaining P1 breakage that may even warrant a patch release - the Windows CI runs on hacky workarounds at the moment and stuff might break any moment if someone checks in a test that has a longer name than the one that broke. I would like to revert both workarounds (disabling local SSDs and the shortened user name) in a few days.
laszlocsomor commentedon May 2, 2018
Thanks, that means #5135 is P1 too.
laszlocsomor commentedon May 14, 2018
Bugfix for #5135 is merged as f96f037.
philwo commentedon May 15, 2018
@buchgr Please rollback bazelbuild/continuous-integration@fb39222 and bazelbuild/continuous-integration@44188d9 as soon as possible (i.e. when a Bazel release is out that has this bug fix). This will restore normal functionality of the Windows VMs. :)
This was a bad enough breakage (unfortunately not detected pre-release) that it would have been warranted to rollback the 0.13.0 release, but we don't have any process for that, so I didn't and instead cooked up this semi-working workaround to at least get our presubmits working again.
19 remaining items
philwo commentedon May 19, 2018
Here's how it should look like and looked like until 0.13.0 was released and I had to disable local SSDs on our Windows VMs due to the new behavior ("Bazel now puts output user root underneath the user's home directory") and this bug ("Java launcher doesn't work when files are on two different drives"):
C:\is the slow, persistent SSD used only to store the Windows OS, some Buildkite Agent files and the user's home directories (which should be unused).D:\is the fast, local SSD which should be used as theoutput_user_rootfor all Bazel invocations and temporary files. Most notably, there'sD:\buildwhich is where the Buildkite Agent checks out Git repos and invokes Bazel in andD:\tempwhich is%TEMP%/%TMP%and should also be used by Bazel for output bases.This all worked fine until 0.13.0 was released and Bazel no longer respected
%TEMP%for the output_user_root.Notably:
Here's what we should do:
%TEMP%as the output user root again.D:\.D:\in rules_sass. It was the correct thing to useD:\in these cases.Here's what we shouldn't do:
C:\build(which is the slow persistent SSD).C:\, which might just be too small.substfor anything.laszlocsomor commentedon May 22, 2018
@philwo, thanks for the details.
As for using
%TEMP%for output user root: can we modify the CI scripts to always pass--output_user_root=%TEMP%to Bazel?meteorcloudy commentedon May 22, 2018
@laszlocsomor I believe it's fine to do that. We were always using %TEMP% as the output root, it didn't cause any file deleted unexpectedly problem.
@buchgr Can you re-enable the SSD (D:/) as Phillip suggested?
laszlocsomor commentedon May 22, 2018
It will if we RDP to the CI machines and manually run Bazel on them, because then we'll create a junction pointing to the JDK and trigger bazelbuild/continuous-integration#252 (comment).
As long as we do not RDP into CI machines and run builds on them, we'll be fine.
laszlocsomor commentedon May 25, 2018
@buchgr : do you have any updates on this bug? Which ongoing release should it be blocking?
laszlocsomor commentedon Aug 13, 2018
@meteorcloudy : can we close this bug?
meteorcloudy commentedon Aug 13, 2018
Yes, all issues mentioned here are fixed.
Disable usage of local SSD on Windows VMs.
Rename the buildkite user to 'b' on Windows.
Disable usage of local SSD on Windows VMs.
Rename the buildkite user to 'b' on Windows.