lein-binplus
lein-binplus copied to clipboard
Corrupted jar when jar size is above ~32Mb
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.
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
I'll give it a try, I opened this issue to keep track on this repo, thank you!
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
Thanks @klausbrunner,
I'll give it a try.
Released [lein-binplus "0.6.7"] which fixes the above issue thanks to @klausbrunner library.