After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 797323 - cerbero: Store local sources in a user-wide location
cerbero: Store local sources in a user-wide location
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: cerbero
unspecified
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-10-22 23:08 UTC by Nirbheek Chauhan
Modified: 2018-10-28 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
cerbero: Store local sources in a user-wide location (2.59 KB, patch)
2018-10-22 23:08 UTC, Nirbheek Chauhan
none Details | Review
cerbero: Store local sources in a user-wide location (2.79 KB, patch)
2018-10-27 22:01 UTC, Nirbheek Chauhan
committed Details | Review

Description Nirbheek Chauhan 2018-10-22 23:08:39 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.
Comment 1 Nirbheek Chauhan 2018-10-22 23:08:46 UTC
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.
Comment 2 Sebastian Dröge (slomo) 2018-10-23 07:24:43 UTC
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).
Comment 3 Nirbheek Chauhan 2018-10-23 09:11:36 UTC
(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.
Comment 4 Nirbheek Chauhan 2018-10-27 22:01:37 UTC
Created attachment 374072 [details] [review]
cerbero: Store local sources in a user-wide location

cerbero: Store local sources in a user-wide location
Comment 5 Nirbheek Chauhan 2018-10-27 22:03:42 UTC
(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).
Comment 6 Nirbheek Chauhan 2018-10-28 13:22:45 UTC
Attachment 374072 [details] pushed as 9ce0230 - cerbero: Store local sources in a user-wide location