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 763539 - GLib should support stateless XDG directories by default
GLib should support stateless XDG directories by default
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 763619
 
 
Reported: 2016-03-12 16:43 UTC by Ikey Doherty
Modified: 2018-05-24 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Support a stateless configuration by default (1.79 KB, patch)
2016-03-12 16:43 UTC, Ikey Doherty
none Details | Review

Description Ikey Doherty 2016-03-12 16:43:48 UTC
Created attachment 323763 [details] [review]
Support a stateless configuration by default

With this change we support stateless XDG directories by default. Stateless
systems separate "vendor" configuration from the local system administrator
configuration, facilitating smoother upgrade processes.

Given that XDG config files typically involve "/etc/xdg/autostart" files,
these are invariably provided by upstream vendors by way of packages, and
the administrator of the local system is free to provide their own overrides
locally in the /etc/ tree.

This facilitates pure stateless implementations where it is forbidden to
ship files in /etc/ through the vendor update mechanism.

For more information see: https://clearlinux.org/features/stateless

The immediate benefit of this change is the deprecation of vendor-packaging of /etc/xdg/autostart-esque files, and instead allows packaging of /usr/share/xdg, preventing potential three-way merges during updates in all packages using this.

As an example, the Budgie Desktop now uses a stateless configuration for the xdg files: https://github.com/solus-project/budgie-desktop/commit/b1f9f5b808b5b6c8e70f6677a0ee22dab555017b

This change also works throughout XFCE.
Comment 1 Matthias Clasen 2016-03-13 16:49:55 UTC
The default value for this in absence of XDG_CONFIG_DIRS is taken from the basedir spec. If we want to change this, we should update the spec to match.
Comment 2 Ikey Doherty 2016-03-14 13:01:11 UTC
Sure, how best to achieve this?
Comment 3 Emmanuele Bassi (:ebassi) 2016-03-14 13:10:16 UTC
You'll have to start the discussion on adding /usr/share/etc to the default XDG_CONFIG_DIRS value on xdg list:

  https://lists.freedesktop.org/mailman/listinfo/xdg

It would help to get buy in from maintainers of the spec, and maybe other distro maintainers, as well.
Comment 4 Ikey Doherty 2016-03-14 13:24:35 UTC
So what I've been using in Clear Linux and Solus is actually

/usr/share/xdg

In place of:

/etc/xdg

"Default" trees find themselves in:
/usr/share/defaults

So for example, base profile files:

/usr/share/defaults/etc/profile


Namespaced:

/usr/share/defaults/nano/nanorc

Where packages provide a $(datadir) use already:

/usr/share/pulseaudio/default.pa

Having multiple etc trees under $(datadir) makes little sense, hence /usr/share/xdg
Comment 5 Colin Walters 2016-03-14 13:30:23 UTC
I haven't looked at the details, but I think calling things like this "stateless" is confusing.  It's a vague term, and I find myself in a perpetual battle trying to tell people that OSTree isn't "stateless".

How about we call this "systemd-style config file overrides"?

Regardless of terminology though, I'm definitely in favor of this.
Comment 6 Colin Walters 2016-03-14 13:31:24 UTC
BTW, if it's "systemd style", then we should also support `/run/xdg`.
Comment 7 Ikey Doherty 2016-03-14 13:36:22 UTC
Well, from my angle with Clear Linux, it is stateless. And not relying on /etc/ at all, is stateless.

Note that we don't rely on populating an /etc/ on boot within Clear Linux via systemd tmpfiles, factory files, etc, but can quite easily run without one at all. The diff begins to appear when using, for example, 'passwd', at which point the relevant shadow files are constructed.

New thread on xdg mailing list per request :)

https://lists.freedesktop.org/archives/xdg/2016-March/013687.html
Comment 8 GNOME Infrastructure Team 2018-05-24 18:40:24 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1146.