lein-binplus icon indicating copy to clipboard operation
lein-binplus copied to clipboard

Corrupted jar when jar size is above ~32Mb

Open ericdallo opened this issue 4 years ago • 2 comments

After some debugging, I realized that lein bin on a project that has some dependencies that makes the jar size above 32Mb, will make a corrupted binary. I'm having this issue on clojure-lsp, I managed to remove one dep to make that work, so to reproduce you only need to add one or more deps to deps.edn and run lein bin to reproduce the bug.

ericdallo avatar Feb 05 '21 01:02 ericdallo

Hi Eric, I'm aware of this issue and reported to the author of the clj-zip-meta a while ago

https://github.com/mbjarland/clj-zip-meta/issues/3

Until he fixes the underlying issue there is nothing I can do.

However, to get around this problem you can add :skip-realign true in your project bin configuration and the jar produced won't be corrupt.

Bruno

BrunoBonacci avatar Feb 05 '21 09:02 BrunoBonacci

I'll give it a try, I opened this issue to keep track on this repo, thank you!

ericdallo avatar Feb 05 '21 12:02 ericdallo

I've written a small library that deals with this particular problem (and was actually inspired by mbjarland/clj-zip-meta). It's fairly well-tested on ZIPs/JARs from small to very large. The possible downside: it's not Clojure, but plain Java - I don't know if that's an issue or not, but my understanding is that calling Java from Clojure is not a big deal.

https://github.com/klausbrunner/zip-prefixer

klausbrunner avatar Feb 22 '23 17:02 klausbrunner

Thanks @klausbrunner,

I'll give it a try.

BrunoBonacci avatar Feb 22 '23 17:02 BrunoBonacci

Released [lein-binplus "0.6.7"] which fixes the above issue thanks to @klausbrunner library.

BrunoBonacci avatar Feb 23 '23 13:02 BrunoBonacci