Add `--distdir_tree` option to recursively search for cached downloads in a single directory
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the problem / feature request:
Bazel should have a `--distdir_tree` option to recursively search for a cached file in a [distribution files directory](https://docs.bazel.build/versions/main/guide.html#distribution-files-directories). This would enable reuse of existing opinionated methods for caching downloaded files. This could be the cache of another build system or framework, or something as simple as `wget -x`. A great addition would be to first check in a subdirectory that would have been created from the original URL like `wget -x`.
### What underlying problem are you trying to solve with this feature?
Simplify the creation of distribution files directories.
I believe the addition of a new sub-feature, `--distdir_tree`, instead of adding to the existing behavior of `--distdir` should help alleviate any performance concerns of directory tree search for existing expected behavior of `--distdir`.
### What operating system are you running Bazel on?
Linux, macOS
### What's the output of `bazel info release`?
`release 4.2.1`
### Have you found anything relevant by searching the web?
* bazelbuild/bazel#14534
* bazelbuild/bazel#11533 (request for checking the checksum of the file itself, my feature request is checking a file name that is the checksum which also happens to be mentioned in a comment there)
* bazelbuild/bazel#13493
* https://docs.bazel.build/versions/main/external.html#offline-builds
* https://stackoverflow.com/questions/62944451/creating-a-bazel-distdir-for-third-party-dependencies
Contributor guide
Assessment
This issue has not been assessed yet.