Skip to content

LAUNCHER ERROR: Cannot calculate relative path from absolute path under different drives. #5125

Closed

Description

@philwo

I just upgraded our CI machines to Bazel 0.13.0 and now Bazel is failing on most tests:

https://buildkite.com/bazel/bazel-bazel/builds/1828#ee4e74ed-79f0-470b-abb7-283f5eaed5dd

exec ${PAGER:-/usr/bin/less} "$0" || exit 1
-----------------------------------------------------------------------------
LAUNCHER ERROR: Cannot calculate relative path from absolute path under different drives.
path = d:\build\buildkite-worker-windows-java8-9wk1-1\bazel\bazel-bazel\third_party\guava\guava-24.1-jre.jar
base = c:\users\buildkite\_bazel_buildkite\kkh8ke_d\execroot\io_bazel\bazel-out\x64_windows-fastbuild\bin\src\test\java\com\google\devtools\build\lib
LAUNCHER ERROR: CreateClasspathJar failed

Bazel 0.12.0 still had:

output_base: D:/temp/_bazel_buildkite/eou8oqvz

Bazel 0.13.0 has:

output_base: C:/users/buildkite/_bazel_buildkite/kkh8ke_d 

@laszlocsomor Does this ring a bell?

Activity

  1. added
    P1
    on May 1, 2018
  2. philwo commented on May 1, 2018

    @philwo
    MemberAuthor

    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
    

    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

  3. philwo commented on May 1, 2018

    @philwo
    MemberAuthor

    The workaround of renaming the Buildkite user to „b“ has worked, Bazel’s CI job is green again.

  4. laszlocsomor commented on May 2, 2018

    @laszlocsomor
    Contributor

    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.

  5. laszlocsomor commented on May 2, 2018

    @laszlocsomor
    Contributor

    @philwo , may I close this bug?

  6. philwo commented on May 2, 2018

    @philwo
    MemberAuthor

    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.

  7. laszlocsomor commented on May 2, 2018

    @laszlocsomor
    Contributor

    Thanks, that means #5135 is P1 too.

  8. laszlocsomor commented on May 14, 2018

    @laszlocsomor
    Contributor

    Bugfix for #5135 is merged as f96f037.

  9. philwo commented on May 15, 2018

    @philwo
    MemberAuthor

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

  10. 19 remaining items

  11. philwo commented on May 19, 2018

    @philwo
    MemberAuthor

    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:

    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.
    • Use subst for anything.
  12. laszlocsomor commented on May 22, 2018

    @laszlocsomor
    Contributor

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

  13. meteorcloudy commented on May 22, 2018

    @meteorcloudy
    Member

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

  14. laszlocsomor commented on May 22, 2018

    @laszlocsomor
    Contributor

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

    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.

  15. laszlocsomor commented on May 25, 2018

    @laszlocsomor
    Contributor

    @buchgr : do you have any updates on this bug? Which ongoing release should it be blocking?

  16. assigned and unassigned on Jul 9, 2018
  17. laszlocsomor commented on Aug 13, 2018

    @laszlocsomor
    Contributor

    @meteorcloudy : can we close this bug?

  18. meteorcloudy commented on Aug 13, 2018

    @meteorcloudy
    Member

    Yes, all issues mentioned here are fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1breakagecategory: misc > miscplatform: windows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions