GNOME Bugzilla – Bug 797323
cerbero: Store local sources in a user-wide location
Last modified: 2018-10-28 13:22:49 UTC
This saves a lot of download bandwidth when you've got multiple Cerbero clones, such as 1.14 + master, etc. It also matches what other build aggregators such as npm and cargo do, where they keep globally-shareable data in a global location.
Created attachment 374007 [details] [review] cerbero: Store local sources in a user-wide location Since we store local sources inside the cerbero home dir (build/), we download multiple copies of the sources for each cerbero clone or if the user deletes the homedir or moves the git repository. We still keep the old value for non-default cases where the user has a configuration that overrides the default value of home_dir.
Review of attachment 374007 [details] [review]: ::: cerbero/config.py @@ +560,3 @@ + else: + cache_dir = Path.home() / '.cache' + return (cache_dir / 'cerbero-sources').resolve().as_posix() Is there nothing like g_get_user_cache_dir()? For macOS and Windows there's AFAIU a default place for these things (on Windows where also Internet Explorer stores its cache, for example).
(In reply to Sebastian Dröge (slomo) from comment #2) > Review of attachment 374007 [details] [review] [review]: > > ::: cerbero/config.py > @@ +560,3 @@ > + else: > + cache_dir = Path.home() / '.cache' > + return (cache_dir / 'cerbero-sources').resolve().as_posix() > > Is there nothing like g_get_user_cache_dir()? For macOS and Windows there's > AFAIU a default place for these things (on Windows where also Internet > Explorer stores its cache, for example). There isn't afaik, and we also don't want to use those dirs since they're usually hard to find (esp on Windows) and it is a common use-case to want to edit the sources in local_sources while doing development with Cerbero. It also makes it simpler to document the location where they will be found.
Created attachment 374072 [details] [review] cerbero: Store local sources in a user-wide location cerbero: Store local sources in a user-wide location
(In reply to Nirbheek Chauhan from comment #4) > Created attachment 374072 [details] [review] [review] > cerbero: Store local sources in a user-wide location The cache dir is now always C:\Users\$username on Windows (based on %USERPROFILE%). %HOME% is different in different shells (cmd.exe vs msys vs msys2).
Attachment 374072 [details] pushed as 9ce0230 - cerbero: Store local sources in a user-wide location