volk_prefs: add XDG Base Directory support#11
Open
mtibbits wants to merge 3 commits into
Open
Conversation
bcc156e to
01e7660
Compare
01e7660 to
db2b6dc
Compare
057d2b8 to
d2a45c7
Compare
…ependency Also bumps fmtlib to 12.1.0. Signed-off-by: Sergi Granell Escalfet <xerpi.g.12@gmail.com>
cmake: Add `ENABLE_UTILITY_APPS` to avoid building volk_profile and avoid fmt dependency
Add XDG_CONFIG_HOME and $HOME/.config/volk lookup paths ahead of the legacy $HOME/.volk location. The legacy path becomes read-only so that new volk_profile runs write to the XDG location. Migration prompt in volk_profile.cc detects the divergence and offers to move the config. Fixes: gnuradio#792 Signed-off-by: Matthew Tibbits <matt@tibbits.me> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Matthew Tibbits <894144+mtibbits@users.noreply.github.com>
d2a45c7 to
a19a383
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add XDG Base Directory support to
volk_get_config_path()andvolk_profile. New profiles are written to$XDG_CONFIG_HOME/volk/(defaulting to
~/.config/volk/), with~/.volk/demoted to aread-only fallback. When
volk_profiledetects a legacy config, itoffers an interactive migration prompt (suppressed in non-interactive
contexts).
GNU Radio already migrated to XDG (gnuradio/gnuradio#7136); this
aligns VOLK so both configs live in the same tree.
CONFIG vs CACHE
@jdemel noted that
volk_configresembles FFTW wisdom(regenerable, machine-specific profiling data), raising the question of
whether
$XDG_CACHE_HOMEwould be more appropriate.This PR uses
$XDG_CONFIG_HOMEbecause:$XDG_CONFIG_HOMEvolk_configalongside GNU Radio's configvolk_configforces a full re-profile (~minutes), worse UX than typical cache loss
Happy to switch to
$XDG_CACHE_HOMEif the maintainers prefer —the implementation is structurally identical.
Fallback chain
Related issues
Fixes gnuradio#792
Testing
volk_profilewrites to~/.config/volk/volk_config~/.volk/removed-p /tmp/customoverride: no prompt, writes to custom pathXDG_CONFIG_HOME=/tmp/xdg-test: writes to/tmp/xdg-test/volk/volk_configXDG_CONFIG_HOME=(empty): treated as unset per XDG specChecklist
cmake --build)ctest)git commit -s)