-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Use XDG Base directories for settings, cache and runtime data #2578
Conversation
Voight Kampff Integration Test Failed (Results) |
Hello @PureTryOut! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-01-08 20:50:15 UTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still haven't finished writing the specs for this feature you've already implemented so I'll start by sending some of the notes I made on this PR this weekend.
Woops, sorry. I got too excited for this 🙈 |
Voight Kampff Integration Test Failed (Results) |
4 similar comments
Voight Kampff Integration Test Failed (Results) |
Voight Kampff Integration Test Failed (Results) |
Voight Kampff Integration Test Failed (Results) |
Voight Kampff Integration Test Failed (Results) |
@forslund I realize you're less active nowadays but is there a chance you have finished the specs you were writing? I'd like to finish this PR at some point 😉 |
Sure I'll try to have my thoughts jotted down within the week. |
Hi, sorry for the long delay in coming back with this. You seem to have implemented much of what I describe already.
May not be much news but these were the thoughts I had (had to rebuild my document) |
I'm wondering, wouldn't it be better to migrate everything to XDG_CONFIG_PATH where possible rather than keeping things in the old location? It'd be nice to eventually get rid of the old paths entirely so there is less code, rather than doing difficult by checking multiple locations all the time. New installations would use XDG anyway so the amount of systems using the old paths would be less and less over time. Personally I rather have some logic to move files where needed and the following:
|
Voight Kampff Integration Test Failed (Results) |
My main reasoning was to avoid needing to have config file merging on disk, just in memory (which would use the existing system). If the XDG version exists and a user creates the .mycroft/mycroft.conf it will need to merge the changes from that file into the the file in the XDG path. it's less things that can go wrong. If you feel like the merge is better I'm fine with that as well. |
I think we should in that case just ignore the new file in the old location, it's just the wrong location to put things. We'll move over existing files from the old location, but if someone puts a new file there and then complains it isn't being used we just point them to the new location. People will get used to it eventually. I rather not merge config files from an old and a new location, it just complicates things. |
We've been recommending the use of the config manager rather than directly editing files for a little while now, but a big challenge here is that So my preference would be to support the existing location in some way but flagging it as deprecated so we can remove it entirely in a future release. |
Those are valid points. I now made sure to check both old and new locations and merge them together. I'm trying to notify that the old location is deprecated and will be removed in a future version, but I can't find the prints in any output anywhere. Where are |
They should, when using the start-mycroft.sh, be output to the relevant log file in /var/log/mycroft/*.log However I think it maybe better to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me this mainly looks good now!
There's a couple of (possible) bugs I noted and a slight incompatibility. Not sure we should bother about the incompatibility though. It's small and should not be a critical issue. (like causing exceptions or so)
Voight Kampff Integration Test Failed (Results) |
Hum hum hum, the VK test seems to hang on the QA skills tests :/ will see if I can run them manually and see if the logs say anything extra |
I got really stuck on why the config patching didn't work in the VK tests, in the end it turned out to be quite simple. The I ran into a couple of other minor problems are still in the migration of files. Gonna add separate comments on each issue I saw. When figuring this out I made some commits to show the needed changes https://github.com/forslund/mycroft-core/commits/PureTryOut-xdg-config |
Made the changes, let's see! Honestly, VK is one big mystery to me. |
Just realized this will bork (and did bork) the VK test runner since it moves the identity file (and doesn't restore it)... Could you edit the Jenkinsfile@L60 to be to make sure the identity file isn't moved from the shared volume. |
Hmm, still failing. Seems testing the skills times out or something? |
Right now the identity file is broken (I think) so many of the tests using it (weather, Q and A) are failing and it gets 10 seconds timeout of all of those. We can retry when the identity file for VK is restored |
New identity file in place, triggered a new run 🤞 |
Uh, seems it ignores the updated Jenkinsfile file and keeps mounting the file to |
Seems like Jenkins doesn't trust you :( I'll see if I can figure out how to make it trust you / this change of the Jenkinsfile |
Moved from .mycroft to XDG folder
If you make changes don't push to this branch since it'll destroy the jenkins identity file :/ ... Update in a branch and let me know. I'll pull them into the branch for the PR I created |
Done, my branch Too bad another review with more requested changes comes in so late 😢 |
Tried out that branch on OVOS. The following error pops up;
|
Right! To manu different branches / tries because of this VK stuff. Will check/test the other one for you. |
Closing this as it's being replaced by #2794 and it seems it causes confusion by being still open. It's the same changes, but with stuff to make VK work (which I don't have permissions for in this PR). |
Description
This makes Mycroft use the XDG Base Directory specification.
Data is now saved to:
$XDG_CONFIG_DIR/mycroft
, which most of the time equals to~/.config/mycroft
$XDG_DATA_DIRS/mycroft
, which most of the time equals to~/.local/share/mycroft
$XDG_CACHE_HOME/mycroft
, which most of the time equals to~/.cache
Since this changes the default location of pretty much everything, please test it well!
Goal is to support and read from the old
~/.mycroft
location if it already exists, but save to the XDG Base Directories and read from it on new installations.Together with #2559 this should be full XDG Base Directory compliance.
How to test
First of all, run this PR with an existing installation, and check if everything is loaded from the usual locations. Then shut it down and restart to make sure it has saved to the new locations.
Then, completely remove any trace of Mycroft settings from your system. Easiest would be to fully deinstall (remove
/opt/mycroft
), remove~/.mycroft
, and the XDG Base directories mentioned above.Now reinstall Mycroft (with this PR applied) and start and connect it. Check if
~/.mycroft
is not created anymore and~/.config/mycroft
,~/.local/share/mycroft
and~/.cache/mycroft
are with the correct files and directories in them.Contributor license agreement signed?
CLA [x]