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

ijar fails on empty jars #10162

Closed
agrieve opened this issue Nov 4, 2019 · 3 comments
Closed

ijar fails on empty jars #10162

agrieve opened this issue Nov 4, 2019 · 3 comments
Labels
area-java-toolchains javabase, java_toolchain flags, JDK selection, java_toolchain rules, java_tools repository P2 We'll consider working on this in future. (Assignee optional) team-Rules-Java Issues for Java rules type: bug

Comments

@agrieve
Copy link

agrieve commented Nov 4, 2019

Here's a repro:

Tested with ijar from bazel 1.1.0.

$ python -c "import zipfile; zipfile.ZipFile('test.jar', 'w')"
$ ijar test.jar out.jar
size 108 > estimated size 22
Aborted
@aiuto aiuto added team-Rules-Java Issues for Java rules untriaged labels Nov 6, 2019
@lberki lberki added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Oct 5, 2020
@lberki
Copy link
Contributor

lberki commented Oct 5, 2020

Somewhat embarrassing.

@comius comius added the area-java-toolchains javabase, java_toolchain flags, JDK selection, java_toolchain rules, java_tools repository label Nov 21, 2020
comius added a commit to comius/bazel that referenced this issue Jan 25, 2021
The problem happens when all the files are filtered out. In such case a dummy file is created, but not accounted for in the size estimation.
Fixes bazelbuild#10162
@cushon
Copy link
Contributor

cushon commented Jan 25, 2021

Out of curiosity, was what real world situation did you encounter this in? Typically jar files always have at least META-INF/MANIFEST.MF file, especially the ones created by Bazel.

@agrieve
Copy link
Author

agrieve commented Jan 26, 2021

We encountered this in Chrome's build system, which doesn't bother with META-INF files for library targets (just zips up .class files).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-java-toolchains javabase, java_toolchain flags, JDK selection, java_toolchain rules, java_tools repository P2 We'll consider working on this in future. (Assignee optional) team-Rules-Java Issues for Java rules type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants