rules_kotlin icon indicating copy to clipboard operation
rules_kotlin copied to clipboard

Distribution archive is very large

Open alexeagle opened this issue 2 years ago • 3 comments

We introduced rules_kotlin in a large monorepo with hundreds of engineers. Since there's an eager WORKSPACE load to get kotlin_repositories(), every engineer immediately is waiting to download 22MB even though no one uses Kotlin yet. Is there something simple we could do to make the distribution smaller and make a subsequent lazy fetch to get large files?

alexeagle avatar Oct 27 '21 14:10 alexeagle

Which version?

I'm working on making the toolchain lazier.

restingbull avatar Nov 05 '21 19:11 restingbull

the most recent alpha versions on https://github.com/bazelbuild/rules_kotlin/releases have >22MB tgz files.

alexeagle avatar Nov 05 '21 20:11 alexeagle

Looking very quickly, we have a 9.8 MB jdeps_merger_worker.jar and a 9.8 MB kotlin_worker.jar, which looks suspiciously close. They're by far the largest files, followed by jarjar.jar at 4 MB (I'm not sure how much those files actually take in the compressed archive, but the archive is 22 MB vs 25 MB once extracted, so it doesn't change much).

I have no idea how those two worker jars are built, but if extracting some of the logic (I guess what makes them workers) into a common jar, that would remove over a third of the archive already.

Kernald avatar Nov 08 '21 00:11 Kernald