replace ~/.mixxx folder with XDG config folders

Bug #1463273 reported by Daniel Schürmann
38
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Mixxx
Triaged
Wishlist
Unassigned

Bug Description

According to:
https://wiki.debian.org/XDGBaseDirectorySpecification
It is not a required change but "strongly encourages upstreams" to use the XDG folders.

The original sec is found here:
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

The following locations are defined, but the environment variables are not set in any distro (like Ubuntu)

$XDG_DATA_HOME (default: "~/.local/share"): user-specific data files.
$XDG_CONFIG_HOME (default: "~/.config"): user-specific configuration files.
$XDG_CACHE_HOME (default: "/.cache"): user-specific non-essential data files.

Tags: easy
Revision history for this message
Daniel Schürmann (daschuer) wrote :
Revision history for this message
Max Linke (max-linke) wrote :

This will make it hard for users to change between mixxx installations (so far it is really easy to switch between any version from 1.8 - 1.12 back and forth). Also at least for cross-platform programs there seems to be an issue conforming to the XDG-standard. IPython tried to use the XDG paths in one of the 2.x versions but soon switched back because it caused more problems for users then solved things. (I can't find the commit explaining the change right now). From what I remember it was mainly a problem with the way OSX handles things.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

https://github.com/mixxxdj/mixxx/pull/606 will break the 1.8 - 1.12 path compatibility for windows.
We may consider if it is worth to do this change as well for Linux.

Maybe we find a way to retrain the compatibility.
Something like this:
Detect if a ~/.mixxx folder exists. if yes, move its content to ~/.local/share/mixxx and replace it by a symlink.

Revision history for this message
Sébastien BLAISOT (sblaisot) wrote :

I don't think that XDG folders are already "natural" for users at the moment.

This change should be postponed post 1.12 IMHO. It needs mote testing and a clear communication.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

It looks like the standard paths on Linux are broken in QT 4.
They where revamped in QT5
http://doc.qt.io/qt-5/qstandardpaths.html

Debian recommends using libqtxdg

Unfortunately it is not part of Ubuntu Precise.
Version 0.5 It is part of Ubuntu Trusty

The library supports Qt4 up to version 1.2
The it switches to the underlying Qt5 implementation form version 1.2
https://github.com/libqtxdg/libqtxdg/tree/da936792f2376327db2c287348738ede394e7bcc

I think the following approach is reasonable:
Use QString XdgDirs::dataHome(bool createDir)
from Trusty.
Hardcode "~/.local/share/Mixxx" for Precise
The xdg environment variables are not set anyway.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Is this a 1.12 bug?
I think yes, since we fix the issues on the other OSs as well.
We can deal with the time up to 1.11 and from 1.12 unique over all Os

The approach from
https://github.com/mixxxdj/mixxx/pull/606
will work here as well:

 * new preference folder are created in the right place
 * former preference folder used if they are found, and no new folder is created
 * if both former path and new path exist, the new path is prefered

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Since libqtxdg is only a thin wrapper in Qt5 and can't control if the distros version is compiled with Qt4 or Qt5 or if it is available at all.
I think it is best to just copy the needed view lines from libqtxdg and qt5 into the Mixxx soure.

Changed in mixxx:
status: New → In Progress
importance: Undecided → Low
assignee: nobody → Daniel Schürmann (daschuer)
milestone: none → 1.12.0
Revision history for this message
Daniel Schürmann (daschuer) wrote :

Here are some guidelines how to use the .dot folders
https://wiki.gnome.org/Initiatives/GnomeGoals/XDGConfigFolders

Revision history for this message
Sébastien BLAISOT (sblaisot) wrote :

Because we're talking about standards :

Filesystem Hierarchy standard: http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s08.html
If an application needs to create more than one dot file then they should be placed in a subdirectory [of home dir] with a name starting with a '.' character, (a "dot directory"). In this case the configuration files should not start with the '.' character.

Linux Standard Base: http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/execenvfhs.html
An LSB conforming application shall conform to the Filesystem Hierarchy Standard.

We're actually compliant with LSB 5.0 and FHS 3.0

Complying to XDG base directory spec will need to split preference folder into more folders (config, data & cache). I think this is not a 1.12 target.

I propose to keep as it is for 1.12 and try to work on it on all systems for next version.

Changed in mixxx:
milestone: 1.12.0 → none
assignee: Daniel Schürmann (daschuer) → nobody
Revision history for this message
Daniel Schürmann (daschuer) wrote :

Thank you for the link.
Now its clear for me. It includes a clear reference to the XDG and Glib which also use the XDG dirs.
Using the .config /.cache /.local folders is compliant to §3.8.2, but we are not forced to give up .mixxx

Also interesting: we must not assume that .config /.cache /.local are available.

Revision history for this message
Tuukka Pasanen (pasanen-tuukka) wrote :

My opinion is also that we should postpone this feature after 1.12. Big feature which needs time to settle and migration plan for users. XDG is highly optional but makes home dirs more clear like in Mac OS X. Symlink to .config/mixxx from .mixxx would make nostalgic happy for 1.13?

Revision history for this message
Daniel Schürmann (daschuer) wrote :

I have already removed the 1.12 target.

Please note: we are talking about two different things:

1. move ~/.mixxx to entirely to ~/.lacal/share/Mixxx
The equivalent is already done for Mac.
A solution is in https://github.com/mixxxdj/mixxx/pull/622

2. Split the .mixxx up to data / config / cache as decribed here: https://wiki.gnome.org/Initiatives/GnomeGoals/XDGConfigFolders
These three folders are supported on Mac an Linux but not on Windows.

If we plan 2. soon 1. does not make sense yet. If we are satisfied with 1. we can do it when ever we like.

Revision history for this message
Sébastien BLAISOT (sblaisot) wrote :

Under windows, such a split also makes sense by using AppData\Local for cache and AppData\Roaming for config+data

I think it's the way this is implemented in QT5.

sb

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Look at: qstandardpaths_win.h

All three folders are pointing to
CSIDL_LOCAL_APPDATA
Which is
C:\Benutzer\Benutzername\AppData\Lokal
on win7
subfolder cache is added for cache.

Revision history for this message
Sébastien BLAISOT (sblaisot) wrote :

This is how it is implemented, not how it should be ;)

Under windows, the standard is to have under roaming everything that should be shared between computers on which the user can connect to (shared like sync, not like NFS share), and under local everything that can be removed / not synced without impact on software configuration and behaviour.
I agree that reality is often far from theory on that point.

QStandardPaths::DataLocation is deprecated in QT5 and it is stated :
//This enumeration value is deprecated. Using AppDataLocation is preferable since on Windows, the roaming path is recommended.//

Preferred way is to use QStandardPaths::AppDataLocation which ends in roaming path and QStandardPaths::AppLocalDataLocation for local files (cache for example)

I think that QT is missing something by putting ConfigLocation in the Local folder. If user changes computer in the same "network", it looses all his preferences (which in case of mixxx is not really a problem because Mixxx also needs to be install, to access library, and most of all is not designed to be installed in a large network of computers sharing data and config). This can be more of a problem for, say, a QT software used by several people in an enterprise network that often change computer on which they connect to.

Revision history for this message
Sébastien BLAISOT (sblaisot) wrote :

Oh, you're right, my thought about QT implementation were wrong :(

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Due to lack of progress, marking Triaged and clearing assignee. Feel free to revert if it is in fact still in progress :).

Changed in mixxx:
status: In Progress → Triaged
importance: Low → Wishlist
Changed in mixxx:
milestone: none → 2.4.0
Revision history for this message
Be (be.ing) wrote :

I think we should finally do this for 2.4.

Revision history for this message
Owen Williams (ywwg) wrote :

yes please!

Revision history for this message
Bart Ribbers (bart-ribbers) wrote :

Every once and while I experiment with setting my $HOME to read-only and see what breaks, Mixxx is one of those. My home folder is full of config folders and data, and it makes it hard to backup say only the config files for use on another machine. I would love 2.4 to have full XDG support, it's nice to keep to existing standards rather than making your own.

Revision history for this message
Jan Holthuis (holthuis-jan) wrote :

I had some initial work in the pipeline, but stopped eventually due to all the other tasks. As a first step, we should introduce a class that allows accessing the different path types (cache, data, config) and use it everywhere. Then we can add support for XDG basedir spec to that class, so that we don't need OS specific ifdefs everywhere.

Revision history for this message
Be (be.ing) wrote :

I like that plan, Jan. A lazy hack of kludging everything we currently put in ~/.mixxx into a single XDG directory wouldn't be a great user experience.

Revision history for this message
Be (be.ing) wrote :

I think this would be a good feature to implement for a new contributor following the plan Jan described above. It would not be trivially easy but I don't think it would be very hard and would be a good introduction to the Mixxx code.

tags: added: easy
Be (be.ing)
Changed in mixxx:
milestone: 2.4.0 → none
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/8090

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.