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.

@shs96c
Copy link
Collaborator

shs96c commented Jul 11, 2024

@manuelnaranjo, do you need a hand getting this one over the line? It'd be nice to get it into the tree. If you do, just LMK.

@manuelnaranjo
Copy link
Author

@shs96c I need to rebase the branch and get back into it, now I have a macbook available as well, so setting up Android locally would be easier, it's mostly lack of time that prevents me to look into this, I could use a hand, but I can't say when I'll have time to look into it

@shs96c
Copy link
Collaborator

shs96c commented Jul 11, 2024

@manuelnaranjo, I tend to lurk on the Bazel slack (both the "general" and the "java" channels) so feel free to ping me there, but will be on holiday for the next two weeks, so there's no hurry :)

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.

2 participants