Expose repository_cache to skylark so shared git repository cache can use it
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 75
Description
#5928 tries to introduce a shared repository cache (between workspaces) for git_repository (like we have for download/download_and_extract).
The main gap there is where to write the shared cache.
The current aggreement with @aehlig is that we will write it under `$repository_cache/content_addressable/git/...`.
`$repository_cache` is the value that is specified by `--repository_cache` cmd-line flag (or its default value) and `git` is the key-type (joining the existing `sha1`/`sha256`).
None of the above is exposed to skylark. We have two options:
1. Expose `$repository_cache/content_addressable` to skylark
1.1. Pro- very generic and can be reused by more key types if they'll be added
1.2. Con- might cause issues if a repository rule will overwrite and maybe even poison an existing key-type (`sha256` for example)
2. Expose `$repository_cache/content_addressable/git` to skylark
2.1. Pro- very safe and doesn't require the rule to be aware of the environment
2.2. Con- maybe too specific
@aehlig is strongly leaning towards 2 but we thought it would be a good idea to loop in @laurentlb before we make a decision.
@laurentlb we'd appreciate hearing your thoughts since we really want to get this into 0.18.0
Contributor guide
Research direction
Start by reading issue #5928 and the handling of the --repository_cache command-line flag, then trace how repository rules are exposed to Skylark. The open decision is whether Skylark receives the content_addressable directory or the content_addressable/git directory; done requires an agreed exposure design for the shared git repository cache.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100