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

JVM languages can't share remote cache artifacts cross-platform #11551

Open
justhecuke-zz opened this issue Jun 4, 2020 · 8 comments
Open

JVM languages can't share remote cache artifacts cross-platform #11551

justhecuke-zz opened this issue Jun 4, 2020 · 8 comments
Labels
not stale Issues or PRs that are inactive but not considered stale P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Configurability platforms, toolchains, cquery, select(), config transitions type: feature request

Comments

@justhecuke-zz
Copy link
Contributor

Description of the problem / feature request:

Even though JVM languages that don't include native code can share artifacts cross-platform (theoretically) due to targeting the JVM and not the host/target/execution architecture, the command input/output paths used in the cache digest routinely the host/target/execution platform (e.g., darwin-fastbuild) into the path which means that we cannot share those JVM artifacts cross-platform.

Feature requests: what underlying problem are you trying to solve with this feature?

It would be great to be able to share those JVM artifacts cross-platform since they should be roughly interchangeable, especially Android artifacts.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Not a bug, but a feature request. However, you can quite easily reproduce this by building on a linux machine, upload to remote cache, then build on a darwin machine and note that you don't get any remote cache hits.

What operating system are you running Bazel on?

Darwin and linux (ubuntu)

What's the output of bazel info release?

release 3.2.0

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

N/A

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

git@github.com:justhecuke/bazel_rules_detekt.git
bffa68b4948aa26153185f4feda278557dc01951
bffa68b4948aa26153185f4feda278557dc01951

Have you found anything relevant by searching the web?

No, I found this data by building a custom bazel that output the command protos being used to generate action cache digests and noting the paths used and how they would prevent cross-platform sharing of JVM artifacts.

Any other information, logs, or outputs that you want to share?

No.

@aiuto aiuto added ice-box team-Configurability platforms, toolchains, cquery, select(), config transitions labels Jun 6, 2020
@aiuto
Copy link
Contributor

aiuto commented Jun 6, 2020

You've identified a problem we are well aware of. We already have a long term project to improve this, with the deliverables named in different ways. So this is essentially a duplicate, but I can't, without searching, find the issues to dup against.

@keith
Copy link
Member

keith commented Jun 10, 2020

@aiuto are there any public docs about the workstreams here? We might be interested in helping out if possible

@justhecuke-zz
Copy link
Contributor Author

Any indication of what this long-term project is? I found #8125 but that seems to be a subset of the work needed for this cross-platform reuse (if I read it right) because there are likely toolchain differences between macos and linux that would cause cross-platform re-use of JVM artifacts to fail anyways.

@aiuto
Copy link
Contributor

aiuto commented Jun 10, 2020

This is a bit of work we can't easily invite others to.

The key element is to trim configuration fragments from targets when they can not matter to the end result. Your example of pure Java code with no deps on native code is a perfect example of that. The changes are an intertwined mix of (to start)

There is no single issue or quick fix. This is more of a known goal we are working towards and we use that goal as a way to evaluate changes and set priorities thoughout Bazel

@artem-zinnatullin
Copy link
Contributor

Remote Execution should also allow different local host vs remote host for JVM and android_library/android_binary targets, ie running local build on macOS that connects to Remote Execution service backed by Linux machines.

@blampe
Copy link

blampe commented Jun 29, 2020

So this is essentially a duplicate, but I can't, without searching, find the issues to dup against.

This might be related to #4714/#8339?

@sventiffe sventiffe added type: feature request P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed ice-box labels Nov 10, 2020
@gregestren
Copy link
Contributor

We're expecting progress when the host/exec architecture is the same (like everyone's building on common Linux machines, targeting varying architectures). That's manageable with path stripping (bazel-out/x86-fastbuild/... -> /bazel-out/...).

If you also need caching across host/exec machines, that's an independent problem: there are legitimately different JDKs across architectures. We need to define equivalences for those. That's being looked at by a different group.

Feel free to ping here for more details. To be fair for everyone, it's probably best to close all bugs in this space and open one canonical one describing the whole problem, and who's doing what on it.

Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Feb 18, 2024
@brentleyjones brentleyjones added not stale Issues or PRs that are inactive but not considered stale and removed stale Issues or PRs that are stale (no activity for 30 days) labels Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not stale Issues or PRs that are inactive but not considered stale P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Configurability platforms, toolchains, cquery, select(), config transitions type: feature request
Projects
None yet
Development

No branches or pull requests

8 participants