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

Stop copying jar files #1074

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

manuelnaranjo
Copy link

#1070

Stop making use of a genrule that copies the already downloaded jar handled by http_file file into the target repository and instead make use of an alias for proxying the artifact into the target repository.

POM target shouldn't get a http_file target at all, they don't have a
a file or a sha256, there's nothing to download
If the file is None then that means we shouldn't pass this to the
http_file call, most likely this entries also have a None sha256 sum
In Java 13 -noverify got marked as deprecated and may be dropped in the
future
Since we have downloaded_file_path that points to the actual jar name
in our http_file invocations we can directly consume from those targets
instead of copying, this has an impact not just in IO as we reduce
copying, but also reduces the amount of targets bazel is aware as we
don't need an extra node, reducing the amount of RAM needed for
rules_jvm_external slightly.

In large maven repositories we use at Booking.com we saw a decrease in
the disk cache from 2.4GB to 300MB, which aligns with a repository_cache
of roughly 2.1GB. The time it takes to do a `bazel build @maven//...`
went from 120 seconds to 50 seconds on a i9-13900H using 75% of the cores.
@shs96c
Copy link
Collaborator

shs96c commented Apr 2, 2024

@manuelnaranjo, the idea seems like a good one, but I note that none of the CI tests are working yet. You can run these locally using bazel test //... assuming you have the Android pieces set up locally. If you're using macOS, we have some basic instructions on how to set up the Android SDK/NDK so that it works with the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants