Revert to nix-community/mavenix in nix build #3749
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reverts the change to mavenix from #2673 which introduced a custom version of the mavenix build tool. The original mavenix builds a "repo" derivation which symlinks to all the pom and jar files maven needs to build k. The way mavenix assembles this repo is to first copy each pom/jar file into the nix store individually and then symlink them into a single derivation. Once we build using maven, mavenix copies any required runtime jars to the final k derivation. This obviously creates some redundancy, because there are now two copies of some jar/pom files in the store. For the cachix cache, this means unnecessary duplication each time we push to it. The solution in the aforementioned PR was to symlink to the already present jars/poms instead of copying them.
However, with the new binary cache, the focus is on speed of downloading the pre-compiled binaries and having lot of symlinked paths from the k derivation to each individual pom/jar file introduces a serious bottleneck when we call
nix copy
to download the k binary (see NixOS/nix#2559). Until such time as this issue is resolved, we should revert to the old mavenix which reduces the k closure size (i.e. the number of files the k derivation depends on in the nix store, not necessarily the total size in mb) drastically at the expense of some added duplication of jar files with each build.