fix: compile on non-Unix targets by resolving config paths per platform - #18
Merged
Merged
Conversation
The xdg crate's entire API is cfg(unix)-gated upstream, so declaring it unconditionally forces every non-Unix build to carry a dependency that cannot be used. Move it to [target.'cfg(unix)'.dependencies]. Refs #17
`xdg` is declared under `[target.'cfg(unix)'.dependencies]`, but `ActonConfig::load` and `IpcConfig::load` both named it unconditionally, so any non-Unix build died with `cannot find module or crate xdg` before reaching Acton code at all. Configuration discovery moves into `common::config_paths`, which states the platform rule once: the XDG search path under the `acton` prefix on Unix, `%APPDATA%\acton\<file>` everywhere else. Both call sites delegate to it and neither names a platform again. Unix resolution is byte-for-byte unchanged, including `$XDG_CONFIG_HOME` and `$XDG_CONFIG_DIRS`. The lookup returns `Result<Option<PathBuf>, ConfigLocationError>` so that "could not determine where to search" is distinguishable from "searched, found nothing"; the former is now logged as an error instead of being reported as "using defaults". The `ipc` feature is built on Unix domain sockets and never could have worked off Unix, so it now refuses with a `compile_error!` naming the fix rather than emitting a wall of unresolved-import errors. The non-Unix lookup takes its root as a parameter, so its rule is exercised by unit tests on the Unix CI host; only the three-line `%APPDATA%` read is platform-exclusive. Verified against x86_64-pc-windows-msvc, aarch64-apple-darwin, and x86_64-unknown-linux-gnu.
Locks in the Windows support added for #17: default-features build and test plus a no-default-features check, mirroring the Ubuntu gates that apply off Unix (the ipc gates stay Ubuntu-only since the feature is Unix-only by design).
Sync the docs-site version constants with the workspace bump.
rrrodzilla
temporarily deployed
to
github-pages
August 19, 2026 22:36 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
Closes #17
What
xdgmoves to[target.'cfg(unix)'.dependencies]— the crate's API is entirelycfg(unix)-gated upstream, so non-Unix builds no longer carry an unusable dependency.common::config_pathsmodule that states the platform rule once: the XDG search path under theactonprefix on Unix (unchanged, including$XDG_CONFIG_HOMEand$XDG_CONFIG_DIRS),%APPDATA%\acton\<file>everywhere else.ActonConfig::loadandIpcConfig::loadboth delegate to it.ipcfeature is built on Unix domain sockets; enabling it off Unix now fails with a singlecompile_error!naming the fix instead of a wall of unresolved-import errors.windows-latestjob (default-features build + test, no-default-features check).Verification
-D warningsclean: default,--no-default-features,--features ipc,--all-featurescargo nextest run: 465 / 652 / 466 passed across default,ipc-messagepack, and no-default-features gatescargo checkclean forx86_64-pc-windows-msvcandaarch64-apple-darwin;--features ipcon Windows produces exactly the intendedcompile_error!%APPDATA%layout rule is unit-tested on the Linux host; only the three-line env read is platform-exclusiveVersion: 9.2.0 (workspace bump + changelog included).