main: default to XDG cache directory for non-root users#511
Open
guillermodotn wants to merge 1 commit intoosbuild:mainfrom
Open
main: default to XDG cache directory for non-root users#511guillermodotn wants to merge 1 commit intoosbuild:mainfrom
guillermodotn wants to merge 1 commit intoosbuild:mainfrom
Conversation
supakeen
approved these changes
May 7, 2026
Member
supakeen
left a comment
There was a problem hiding this comment.
Thank you; this is pretty much what I had in mind for this.
Note that we do ship a systemd tmpfiles dropin to clean up /var/cache/image-builder but we don't do this for the new locations. You don't need to address this but I did want to mention it in this PR.
In the future we should grow a image-builder cache ... subcommand to manage/prune the cache.
brlane-rht
requested changes
May 7, 2026
brlane-rht
left a comment
There was a problem hiding this comment.
I'd like to see tests that always run since right now they are going to miss coverage depending on how they are invoked. The simple solution is to pass in os.Getuid to DefaultCacheDir, but that's kinda ugly.
lzap
reviewed
May 7, 2026
| // waiting for osbuild to fail after slow manifest generation. | ||
| if err := os.MkdirAll(cacheDir, 0755); err != nil { | ||
| return fmt.Errorf("cannot create cache directory %q: %w\nHint: use --cache to specify a writable path", cacheDir, err) | ||
| } |
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
--cachepath to$XDG_CACHE_HOME/image-builder/store(or~/.cache/image-builder/store) when running as a non-root user, instead of the root-only/var/cache/image-builder/storeFixes #76