Skip to content
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

runtime: use XDG_CONFIG_DIR for the userconf path #7073

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mboersch
Copy link

@mboersch mboersch commented Jan 8, 2024

This changes the config path from ~/.gnuradio to ~/.config/gnuradio. On windows this maps to %APPDATA%/.config/gnuradio.
This was requested in #3631.

Description

Adhering to the XDG specification help reduce clutter of custom dotfile locations in $HOME...

Related Issue

Fixes #3631

Which blocks/areas does this affect?

runtime

Testing Done

CMake build and ctest.

Checklist

Not sure how I should document this or where to even start. Dito testing :-)

@mboersch mboersch force-pushed the mboersch_issue_3631 branch 2 times, most recently from 698c773 to 55b75f7 Compare January 8, 2024 20:06
@willcode
Copy link
Member

willcode commented Jan 8, 2024

I like the idea of having the GR conf file use the system scheme. We've got an awful lot of people out there with the conf file in the current location, so I feel like some sort of transition is needed. That might involve the old location having priority, or copying the file to the new location (and removing the old one?) or something else. Then there's the user "where did my file go?" problem. Needs some thought.

@marcusmueller
Copy link
Member

@mboersch would you please run clang-format on your changed files?

@willcode I think for main a change where ~/.gnuradio doesn't have priority (but is still found, if XDG_CONFIG_HOME doesn't contain config) is OK, even desirable!

The backport to maint-3.10 (which sadly is explicitly necessary, if we want to do it, because these functions are public API…) would probably want to not do anything "automatically surprising" about the file(s)'s location, fully agreed. But we could print a nice log entry, and I wouldn't mind adding a GRC button that does move the configuration, abusing, say, the "Help" menu.

@willcode
Copy link
Member

willcode commented Jan 9, 2024

Things that are main-only may never see the light of day. Don't want to waste peoples' time. Also, this is an area where different behavior between main and releases could really confuse people who run multiple versions.

This changes the config path from ~/.gnuradio to ~/.config/gnuradio.
On windows this maps to %APPDATA%/.config/gnuradio.

Signed-off-by: M. Boerschig <code-gnuradio@yoyomail.de>
@mboersch
Copy link
Author

mboersch commented Jan 9, 2024

@mboersch would you please run clang-format on your changed files?

Done.

Some backwards compatibility seems reasonable -- even though that code would probably live forever.

I can try add a lookup to the old .gnuradio to the lookup list for the userconf path.
I'm not sure if I should put the lookup / filesystem checks into the sys_path.cc -- seems a bit odd to have the PATH code do filesystem checks.
FWIW, introducing a xdg_userconf_path and a legacy_userconf_path there, and have userconf_path check if the legacy directory exists may work. Should I go for it?

@dkozel
Copy link
Contributor

dkozel commented Jan 11, 2024

Throwing in, a change to only using the XDG path is reasonable for GR 4. I agree backwards compatibility/transitioning is needed or we'll substantially confuse folks doing upgrades.

@willcode
Copy link
Member

Marked with "API Change" so we track that we need to think of a way to make this backward compatible.

@willcode
Copy link
Member

Setting as Draft until backward compatibility is worked out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration files should be stored following the XDG Base Directory Specification
4 participants