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

Maven install with lock manifest is making inefficient use of caches #1070

Open
manuelnaranjo opened this issue Mar 15, 2024 · 0 comments
Open

Comments

@manuelnaranjo
Copy link

I've been for a while struggling with those _extension targets we create, we have a setup where we're using build buddy open source over grpcs for caching and bes. Our repository has 3 maven_install trees of at least 300 coordinates each, on top of that we have a few maven dependencies that contain resources and are really large, literally 250MB for some testing.

Whenever the network connection to the remote cache is flaky we end up spending a lot of time in updating the cache or downloading from the cache this _extension targets.

After looking at the source code I noticed two problems, which seem to have been unnoticed for long time as git blame shows it got refactored from coursier over 5 years ago.

The first problem is the use of genrule which doesn't provide a mnemonic like other actions and doesn't allow override it's execution features to disable remote caching or remote execution. By using a custom rule with a mnemonic the consumers of rules_jvm_external could disable remote caching as the operation is very IO sensitive and very lightweight to do locally.

The second problem is that it uses cp, we literally copy the http_file into the @maven repository, while instead we could just have a symlink when the OS allows.

This whole makes me thing adding a custom private rule for this, or depending on something like aspect Bazel lib copy_file would make things better and hopefully even speed up CI operations on large repositories. As it would reduce the IO load.

I'm going to hack something soon, but yet I wanted to open the discussion, most likely I'm missing something here.

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

No branches or pull requests

1 participant