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

mobile-install on Windows crashes on singlejar building the stub application's deploy jar #6990

Closed
jin opened this issue Dec 21, 2018 · 4 comments
Assignees
Labels

Comments

@jin
Copy link
Member

jin commented Dec 21, 2018

This affects 0.21.0, may be related to #2241

To repro: mobile-install the official Android tutorial example on Windows with Bazel 0.21.0.

PS C:\Users\jingwen\Code\examples\android\tutorial> bazel mobile-install //src/main:app --verbose_failures
INFO: Invocation ID: c2a47969-ff0a-43b7-9073-228ad17fa938
INFO: Analysed target //src/main:app (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: C:/users/jingwen/code/examples/android/tutorial/src/main/BUILD:1:1: Building deploy jar src/main/_mobile_install/app/stub_deploy.jar failed (Exit 1): singlejar.exe failed: error executing command
  cd C:/users/jingwen/_bazel_jingwen/bhes43vo/execroot/__main__
external/bazel_tools/tools/jdk/singlejar/singlejar.exe @bazel-out/x64_windows-fastbuild/bin/src/main/_mobile_install/app/stub_deploy.jar-0.params
Execution platform: @bazel_tools//platforms:host_platform
WARNING: .\src/tools/singlejar/mapped_file_windows.inc:43: open bazel-out/x64_windows-fastbuild/bin/external/bazel_tools/src/tools/android/java/com/google/devtools/build/android/incrementaldeployment/_dx/incremental_stub_application/libincremental_stub_application.jar_desugared.jar:WARNING: src/tools/singlejar/input_jar.cc:24: Cannot open input jar bazel-out/x64_windows-fastbuild/bin/external/bazel_tools/src/tools/android/java/com/google/devtools/build/android/incrementaldeployment/_dx/incremental_stub_application/libincremental_stub_application.jar_desugared.jarTarget //src/main:app failed to build
INFO: Elapsed time: 0.804s, Critical Path: 0.08s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
@rongjiecomputer
Copy link
Contributor

The full file path is 277 characters. We are hitting the 260 path limit in src/tools/singlejar/mapped_file_windows.inc#L43.

C:/users/jingwen/_bazel_jingwen/bhes43vo/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/external/bazel_tools/src/tools/android/java/com/google/devtools/build/android/incrementaldeployment/_dx/incremental_stub_application/libincremental_stub_application.jar_desugared.jar

I don't think _open supports long path, so I think we will need to do something similar to OpenFileForReading, then use _open_osfhandle to convert HANDLE to file descriptor.

I will create a PR for this.

@jin
Copy link
Member Author

jin commented Dec 26, 2018

@rongjiecomputer nice, thanks for debugging this!

@laszlocsomor
Copy link
Contributor

Assigning to myself so the bug has a core dev owner.

@laszlocsomor laszlocsomor self-assigned this Jan 2, 2019
@jin
Copy link
Member Author

jin commented Jan 7, 2019

Thank you @rongjiecomputer!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants