Skip to content

feat: add a shared config layer read by all rattler-based tools - #2645

Merged
wolfv merged 1 commit into
mainfrom
shared-config-layer
Aug 6, 2026
Merged

feat: add a shared config layer read by all rattler-based tools#2645
wolfv merged 1 commit into
mainfrom
shared-config-layer

Conversation

@Hofer-Julian

@Hofer-Julian Hofer-Julian commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Currently tools read config files of other tools. So rattler-build loads ~/.pixi/config.toml and then warns about every pixi-only key (shell, detached-environments, ...) and leaks pixi settings like default-channels into builds (see prefix-dev/rattler-build#2705 for the fallout).

This PR replaces tools reading each other's config files with a shared config layer.

Shared layer

  • Shared files live in /etc/rattler/config.toml and $XDG_CONFIG_HOME/rattler/config.toml. Also $RATTLER_HOME/config.toml is considered when set.
  • Shared files accept only the CommonConfig keys. Anything else warns in every tool, including keys the reading tool's own extension would understand, so a shared file means the same thing to every tool.

API changes (breaking)

  • config_search_paths(&["pixi", "rattler-build"]) becomes config_search_paths("rattler-build"); the multi-tool cross-reading is gone on purpose.
  • ConfigBase::load_from_default_locations now takes the tool name

How Has This Been Tested?

  • Added tests

Tools no longer read each other's config files (rattler-build reading
`~/.pixi/config.toml` warned about every pixi-only key and leaked pixi
settings into builds). Instead there is one shared layer that every
rattler-based tool reads:

- Shared files live in `/etc/rattler/config.toml` and
  `$XDG_CONFIG_HOME/rattler/config.toml`. `$RATTLER_HOME/config.toml` is
  honored when set, without a `~/.rattler` fallback.
- Shared files accept only the `CommonConfig` keys. Tool-specific keys
  warn in every tool, so a shared file means the same thing everywhere.
- `locations::config_search_paths` takes a single tool and returns
  `ConfigLocation`s interleaving both layers: system shared < system
  tool < user shared < user tool. A path appearing in both layers is
  parsed as a tool file.
- `ConfigBase::load_from_default_locations` takes the tool name;
  `load_from_locations` merges an explicit list of `ConfigLocation`s.
@Hofer-Julian
Hofer-Julian requested a review from wolfv August 5, 2026 14:27
@Hofer-Julian
Hofer-Julian marked this pull request as ready for review August 5, 2026 14:27
@wolfv
wolfv merged commit bb636c5 into main Aug 6, 2026
21 of 24 checks passed
@wolfv
wolfv deleted the shared-config-layer branch August 6, 2026 19:26
@octo-sts octo-sts Bot mentioned this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants