Skip to content

Expose repository_cache to skylark so shared git repository cache can use it #6016

Open

Description

@ittaiz

#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

Activity

  1. added
    untriaged
    on Aug 28, 2018
  2. ittaiz commented on Aug 30, 2018

    @ittaiz
    MemberAuthor

    @laurentlb can you please assist?

  3. laurentlb commented on Aug 31, 2018

    @laurentlb
    Contributor

    The value you want to expose is just in the workspace files, right?
    @aehlig knows better than me. Option 2 looks reasonnable.

    (cc @dkelmer)

  4. ittaiz commented on Sep 1, 2018

    @ittaiz
    MemberAuthor

    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

  5. added
    team-ExternalDeps
    and removed on Sep 1, 2018
  6. ittaiz commented on Sep 4, 2018

    @ittaiz
    MemberAuthor

    @aehlig ping

  7. added
    P1
    and removed
    untriaged
    on Sep 10, 2018
  8. Globegitter commented on Sep 12, 2018

    @Globegitter

    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.

  9. ittaiz commented on Sep 12, 2018

    @ittaiz
    MemberAuthor

    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?

  10. aehlig commented on Sep 13, 2018

    @aehlig
    Contributor
  11. edbaunton commented on Sep 27, 2018

    @edbaunton
    Contributor

    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

  12. 1 remaining item

  13. meisterT commented on May 11, 2020

    @meisterT
    Member

    Assigning to Laurent for proper triage (this issue is pretty old, but P1).

  14. added
    P2
    and removed
    P1
    on May 11, 2020
  15. removed their assignment
    on May 11, 2020
  16. ittaiz commented on May 11, 2020

    @ittaiz
    MemberAuthor

    On our end we’ve moved to using http_archive instead of git repository

  17. added
    team-OSS
    on Jun 15, 2020
  18. removed
    team-OSS
    on Nov 29, 2021
  19. github-actions commented on May 24, 2023

    @github-actions

    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.

  20. added
    stale
    on May 24, 2023
  21. fmeum commented on May 24, 2023

    @fmeum
    Collaborator

    @meteorcloudy I would consider this not stale, but potentially superseded by the upcoming Bzlmod repository cache work.

  22. added
    not stale
    and removed
    stale
    on May 24, 2023
  23. meisterT commented on May 24, 2023

    @meisterT
    Member
  24. gonzojive commented on Aug 17, 2023

    @gonzojive
    Contributor

    @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).

  25. meteorcloudy commented on Aug 17, 2023

    @meteorcloudy
    Member

    @gonzojive #12227 is the tracking issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2not staleteam-ExternalDepstype: feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions