JVM languages can't share remote cache artifacts cross-platform
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 75
Description
### 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.
Contributor guide
Research direction
Start by reproducing the remote-cache behavior with the described Linux and Darwin builds, then inspect the command protos used to generate action cache digests. Determine which host, target, or execution platform paths prevent JVM artifacts from sharing across platforms. Done means equivalent JVM or Android artifacts produce remote cache hits across Linux and Darwin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100