You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose repository_cache to skylark so shared git repository cache can use it #6016
P2We'll consider working on this in future. (Assignee optional)not staleIssues or PRs that are inactive but not considered staleteam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: feature request
#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:
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)
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
in the external repositories area yes (it will be exposed on the repository_ctx of repository rules).
Thanks! @aehlig can you expose it? If not I'd appreciate a pointer or two
I would be quite in favour of 1 as I would love to add repository_cache support to rules_nodejs which uses npm/yarn. I know it would be better to have more specific/safe skylark api to make cache poisoning more difficult, but not having repository_cache support for custom package/module managers is one of the top developer experience killers for us internally right now (and also slows down ci). So anything that can get us there even if there will be a better way further down the line would be great.
I’m good witn either one but I really ask this discussion to not drag this too long. I aimed to get the git repository cache in 0.18 which won’t happen but I seriously need it in 0.19 @aehlig can you help push this forward?
I can't unilaterally make a decission for bazel as a whole.
My concern of different external repository rules taking claim of the same
subdirectory of the content-adressable repository cache, and thus leading
to subtle bugs, is already well explained in the discussion above. That's
why I'm favor of exposing those paths in a controlled fashion (say, a struct
exposed to skylark where entries may be added one by one for the embedded
repository rules) with clear expectations of what the content of the respective
directory is supposed to mean (keep in mind that the repository cache is
shared among work spaces).
For the time being, we can always experiment with passing through paths
through environment variables to find a good layout for a new cache
directory.
--
Klaus Aehlig
Google Germany GmbH, Erika-Mann-Str. 33, 80636 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Paul Terence Manicle, Halimah DeLaine Prado
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 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.
@meteorcloudy I would consider this not stale, but potentially superseded by the upcoming Bzlmod repository cache work.
What bzlmod repository cache work?
My interest is using a command like gsutil to download a dependency rather than bazel's HTTP library. There is currently no way to create repository cache entries for files downloaded using such a call to an executable (as far as I know).
P2We'll consider working on this in future. (Assignee optional)not staleIssues or PRs that are inactive but not considered staleteam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: feature request
Activity
ittaiz commentedon Aug 30, 2018
@laurentlb can you please assist?
laurentlb commentedon Aug 31, 2018
The value you want to expose is just in the workspace files, right?
@aehlig knows better than me. Option 2 looks reasonnable.
(cc @dkelmer)
ittaiz commentedon Sep 1, 2018
in the external repositories area yes (it will be exposed on the
repository_ctxof repository rules).Thanks!
@aehlig can you expose it? If not I'd appreciate a pointer or two
ittaiz commentedon Sep 4, 2018
@aehlig ping
Globegitter commentedon Sep 12, 2018
I would be quite in favour of 1 as I would love to add
repository_cachesupport torules_nodejswhich usesnpm/yarn. I know it would be better to have more specific/safe skylark api to make cache poisoning more difficult, but not havingrepository_cachesupport for custom package/module managers is one of the top developer experience killers for us internally right now (and also slows down ci). So anything that can get us there even if there will be a better way further down the line would be great.ittaiz commentedon Sep 12, 2018
I’m good witn either one but I really ask this discussion to not drag this too long. I aimed to get the git repository cache in 0.18 which won’t happen but I seriously need it in 0.19
@aehlig can you help push this forward?
aehlig commentedon Sep 13, 2018
edbaunton commentedon Sep 27, 2018
Not sure if you are attending after bazelcon but this might be a good ticket to pickup in the hackathon, registration for that is still open: https://bloomberg.recsolu.com/external/events/exAj_wQthjKQfYdkKwaejw
1 remaining item
meisterT commentedon May 11, 2020
Assigning to Laurent for proper triage (this issue is pretty old, but P1).
ittaiz commentedon May 11, 2020
On our end we’ve moved to using http_archive instead of git repository
github-actions commentedon May 24, 2023
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 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (
@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.fmeum commentedon May 24, 2023
@meteorcloudy I would consider this not stale, but potentially superseded by the upcoming Bzlmod repository cache work.
meisterT commentedon May 24, 2023
cc @Wyverald
gonzojive commentedon Aug 17, 2023
What bzlmod repository cache work?
My interest is using a command like
gsutilto download a dependency rather than bazel's HTTP library. There is currently no way to create repository cache entries for files downloaded using such a call to an executable (as far as I know).meteorcloudy commentedon Aug 17, 2023
@gonzojive #12227 is the tracking issue