Repository navigation
Update data and config dir resolution to follow XDG base directories - #179
Open
santhiprakash wants to merge 3 commits into
Open
santhiprakash wants to merge 3 commits into
santhiprakash wants to merge 3 commits into
Conversation
Rune created ~/.rune on first launch and kept every piece of state in it, cluttering the home directory. On fresh installs the config file now resolves under $XDG_CONFIG_HOME/rune (default ~/.config/rune) and the data directory under $XDG_DATA_HOME/rune (default ~/.local/share/rune). An existing ~/.rune keeps working unchanged, and -c/-d keep their meanings: an explicit -d still colocates the config with the chosen data directory. While untangling the flag defaults, resolution also fixes two latent bugs: defaultConfigPath was previously resolved before defaultDataPath was assigned, and bootstrap detection and preset writes hard-coded dataDir/config.yaml, so a config living elsewhere (an explicit -c, or now the XDG config dir) re-ran bootstrap on every launch. $RUNE_DATADIR is exported before mode dispatch instead of only during GUI setup, so headless and TUI configs expand log_path and package paths the same way. The bundled rune.star, the rune-agent skills list, and the Zig extension's well-known fallbacks now resolve through it (RUNE_INSTALLDIR for the workspace host's install root). For ssh:// workspaces the client sends the data dir relative to the local home (e.g. ~/.local/share/rune, ~/.runedev) instead of just the basename, so the remote `rune -x` installs under the same home-relative path. A data dir outside the local home falls back to ~/<basename>. Signed-off-by: Santhi Prakash <b.santhiprakash@gmail.com>
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
santhiprakash
force-pushed
the
fix/157-xdg-base-dirs
branch
from
October 6, 2026 14:13
d372d55 to
159df7c
Compare
santhiprakash
force-pushed
the
fix/157-xdg-base-dirs
branch
2 times, most recently
from
November 17, 2026 19:56
3476c0c to
645805c
Compare
The macos-15 job on 645805c was cancelled about 15 minutes in with no failed steps, and the same tree passed this job on the previous head. This empty commit retriggers the pull_request checks. Signed-off-by: Santhi Prakash <b.santhiprakash@gmail.com>
The ubuntu-24.04 job failed on TestUpAfterLogout in internal/runenet, a timing-sensitive integration test this change does not touch; the identical tree passed the same job on the previous head. Retrigger checks. Signed-off-by: Santhi Prakash <b.santhiprakash@gmail.com>
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.
Fixes #157.
Rune created
~/.runeon first launch and kept every piece of state init, cluttering the home directory. This follows the XDG base directory
convention on Linux and macOS while keeping every existing install
working unchanged:
$XDG_CONFIG_HOME/rune(default~/.config/rune); data under$XDG_DATA_HOME/rune(default~/.local/share/rune). An existing~/.runekeeps being used — nomigration — and
-c/-dkeep their meanings: an explicit-dstillcolocates the config with the chosen data directory so tests and
.runedevworkflows are untouched.Resolution order, per the issue:
-c→<datadir>/config.yamlwhen-dis explicit →legacy
~/.rune/config.yaml/config.starwhen present →$XDG_CONFIG_HOME/rune/config.yaml-d→ legacy~/.runewhen present →$XDG_DATA_HOME/runeWhile untangling the flag defaults, resolution fixes two latent bugs:
defaultConfigPathwas resolved ininit()beforedefaultDataPathwas assigned, so the default
-cvalue was computed against an emptydata dir.
isBootstrappedandwritePresetConfighard-coded<datadir>/config.yaml, so a config living anywhere else — anexplicit
-calready today, or the XDG config dir now — re-ran thebootstrap on every launch, and the preset write landed somewhere the
resolver never reads. Bootstrap now checks and writes the resolved
config path.
Hard-coded
~/.runepaths that bypassed-dnow follow the resolveddata dir:
rune.starlog_path→$RUNE_DATADIR/debug.log. This also fixesthe crash reporter, which reads
<datadir>/debug.logwhile the logwriter used
~/.rune.RUNE_DATADIRis exported before mode dispatch instead of onlyduring GUI setup, so headless and TUI configs expand
log_pathandpackage paths the same way.
$RUNE_DATADIR/skills, and theZig extension's well-known fallbacks probe
$RUNE_INSTALLDIR/bin(the install root the workspace host provisions under, which is what
the extension env carries for remote workspaces).
For
ssh://workspaces the client sends the data dir relative to thelocal home (
~/.local/share/rune,~/.runedev) instead of just thebasename, so the remote
rune -xserver installs packages under thesame home-relative path. A data dir outside the local home falls back
to
~/<basename>as before. Known limitations per the issue: a customremote
XDG_DATA_HOMEis ignored, and a remote with an existing~/.runereinstalls its packages once.Docs updated: config, headless, network, wallpaper, packages,
extensions, tutorials, zig, agent {config, skills, claude-code}, the
sample config, the bug-report template, the Debian man page, and the
Homebrew cask
zaplists (which now trash the XDG locations as well asa legacy
~/.rune). The Docker image's~/.runereferences stay: itsDockerfile pre-creates the directory, so the legacy path remains live
in-container.
testing
TestResolveDefaultDataPathandTestResolveConfigPathcover thefull matrix table-driven: explicit
-c, explicit-d(configfollows it, preferring an existing
config.star), legacy~/.runewith and without configs,
XDG_CONFIG_HOME/XDG_DATA_HOMEset andunset, and relative XDG values ignored.
TestIsBootstrappedFollowsConfigPathandTestWritePresetConfigUsesResolvedConfigPathpin the bootstrapconfig-path regression — red on the previous handler, green now.
TestInstallRootandTestConnectSchemeRemoteDataDirHomeRelativecover the home-relative remote guess and the out-of-home
~/<basename>fallback.xvfb-run -a go teston every touched package: ok.xvfb-run -a make testshows only pre-existing environment failures in this sandbox(gemini's live-API-key tests, which fail identically on main, and an
internal/text/textrpcflake that passes standalone and under-race).make lintclean.Authorship