-
Notifications
You must be signed in to change notification settings - Fork 30
Use XDG_STATE_HOME environment variable as a preference above HOME #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for moving this forward, @jaapjansma! The test-failures seem to be some unrelated issue in I wonder if you've had a chance to read the definitions from https://specifications.freedesktop.org/basedir-spec/latest/#variables -- there are a few variables, and the choice of vars somewhat subjective (but not completely). Like here's my impression
|
I agree with you for following the standard. However using So this requires additional documentation and makes the tool probably less user friendly. |
I have updated the PR to reflect the standard of XDG Base Directories |
Great. Thanks for moving this forward @jaapjansma. I'm adding a revision (and plan to merge assuming tests pass) to try to solve a little puzzle:
So with the new commit, it will check a prioritized list of candidates (
(For the upgrade-log case -- the data is temporary/transactional, so it doesn't matter if the path switches...) |
It seems this just broke CiviCarrot. My initial guess is that Assuming this is true, I don't know how many other environments assume |
This is an easy update for carrot, and it's running now. But as noted I don't know how many other environments's scripts are unaware the XDG stuff exists (I wasn't), and just use |
@demeritcowboy Ah, thanks for reporting back.
So the implication is that you automatically spin-up a new system and have some other script-y-bits which manipulate the function on_create_new_system() {
...
git clone https://github.com/civicrm/civicrm-core
...
cv core:install ...
...
cv vars:fill
jq '.sites["/my/site1"].SOME_FIELD = "newvalue"' ~/.cv.json | sponge ~/.cv.json
...
} If I understand -- #243 should be OK if you manually use
Unfortunately, it's hard to tell if there other scripts that call Maybe we hold as-is for the moment -- but if someone comes along to comment on a second script that's impacted, then we can consider one of the other interventions? |
Carrot basically follows the dev docs setup steps: https://docs.civicrm.org/dev/en/latest/testing/#setup
just obviously doesn't use vi. So where vars:fill creates the file has potentially changed, and if you're unaware the XDG vars are set on your system or even exist then that description is no longer correct. |
Maybe we can show the path upon |
Yeah, I think adding some more commands like Stepping back for a second -- we also now have site-aliases (#240). In a strict technical sense,
And yet... conceptually... they look really, really similar (stored config-vars keyed by a site-identifier) and have some similar workflow needs (needing helpers for interactive-setup or scripted-setup). I suspect there will be some way to reconcile them into the same mechanism... but it's probably a multiple-step process (not planned or scheduled right now). My point is that
|
I did a follow up PR showing the |
Fix for #195
One can set the environment variable
XDG_STATE_HOME
This will take precedence over the
HOME
environment variable.