What's the right way to do caching for gclient sync? Ran into issues with GIT_CACHE_PATH

864 views
Skip to first unread message

Joshua Hemphill

unread,
Dec 10, 2022, 8:05:52 PM12/10/22
to infra-dev
I'm trying optimize some docker builds that are building v8 as a dependency, so I'm trying to figure out if there's a way to cache to a specific directory so I can pass it through so our github actions can persist the cache between runs.

I tried setting `GIT_CACHE_PATH` since that was the only thing I could find through googling; but this resulted in `gclient sync` failing when it tries to set the remote url for v8 and gets `error: no such remote 'origin'`.
I've tried inspecting and expanding what I pull initially, and nothing seems to help except disabling the cache path variable, so I figure I'll need to find some other way.

Raphael Kubo da Costa

unread,
Dec 12, 2022, 3:47:09 AM12/12/22
to infra-dev, j1.ro...@gmail.com
Can you paste your .gclient and the actual error you're getting?

Locally, I just have something like this in my Chromium .gclient file instead of setting GIT_CACHE_PATH:

    solutions = { ... }
    cache_dir = "/path/to/my/cache/dir"

I also have a GitHub workflow where I do set GIT_CACHE_PATH and use depot_tools' `git-cache populate https://chromium.googlesource.com/chromium/src` to fetch and populate the Chromium cache.
Reply all
Reply to author
Forward
0 new messages