Skip to content

refactor: use shared config types from rattler_config#6528

Open
wolfv wants to merge 1 commit into
mainfrom
claude/rattler-shared-config-design-m8d2gb
Open

refactor: use shared config types from rattler_config#6528
wolfv wants to merge 1 commit into
mainfrom
claude/rattler-shared-config-design-m8d2gb

Conversation

@wolfv

@wolfv wolfv commented Jul 5, 2026

Copy link
Copy Markdown
Member

Description

Continuation of #6144 ("refactor: switch to rattler_config") on a branch in this repo so it can be finished and merged — the original branch lives in a fork that couldn't be pushed to. The diff of #6144 applied cleanly onto current main; no functional deviations.

pixi_config starts consuming the shared leaf types from the rattler_config crate (0.5, crates.io) instead of maintaining its own copies:

  • RepodataConfig / RepodataChannelConfig (including the tolerant deserializer that keeps deprecated keys like disable-jlap as warnings instead of hard errors)
  • S3Options + the new S3OptionsMap newtype (IndexMap<String, S3Options>)
  • ConcurrencyConfig (same defaults: solves = #CPUs, downloads = 50)
  • ProxyConfig, BuildConfig / PackageFormatAndCompression, RunPostLinkScripts

All types are re-exported from pixi_config so external paths (pixi_config::S3Options, …) keep compiling. Merging goes through the rattler_config::config::Config trait; the old From<RepodataChannelConfig> for SourceConfig became a free function due to the orphan rule.

Follow-ups (flagged with TODO(rattler-config): promote comments, as discussed in #6144): promoting tls_root_certs, the allow_*_links trio and pinning_strategy are user-facing schema decisions and stay out of this PR. The upstream rattler_config redesign in conda/rattler#2557 (unknown-key warnings that work with extensions, generic set, shared config-file discovery) is the basis for the next step, where pixi's Config can become ConfigBase<PixiConfig>.

How Has This Been Tested?

  • cargo check --workspace --all-targets passes.
  • cargo test -p pixi_config: 53 passed, 0 failed (with proxy env vars scrubbed — see note below).
  • cargo fmt --check and cargo clippy -p pixi_config -p pixi_api --all-targets clean.
  • Note: test_config_merge_multiple is env-sensitive behind a proxy because rattler_config 0.5.2's ProxyConfig::default() reads proxy env vars; refactor(rattler_config)!: make the extension mechanism reliable and self-serving conda/rattler#2557 fixes this upstream (empty Default, explicit ProxyConfig::from_env()).

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude Code

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py (no schema impact — internal type moves only, serialized config format unchanged)

Generated by Claude Code

Ports #6144 onto current main. pixi_config now reuses
the leaf config types from the rattler_config crate (0.5) instead of
maintaining its own copies, re-exporting them for back-compat:

- RepodataConfig / RepodataChannelConfig (incl. the tolerant
  Deserialize impl for unknown/deprecated keys like disable-jlap)
- S3Options / S3OptionsMap (IndexMap-backed newtype; Config.s3_options
  switches from HashMap<String, S3Options> to S3OptionsMap)
- ConcurrencyConfig and its default helpers
- ProxyConfig (rattler's Default reads HTTP(S)_PROXY/NO_PROXY env vars;
  pixi's local env statics are kept for get_proxies())
- BuildConfig / PackageFormatAndCompression
- RunPostLinkScripts

The former From<RepodataChannelConfig> for SourceConfig impl becomes a
free function (orphan rule), and merging goes through the
rattler_config::config::Config trait's merge_config. pixi_api's init
templates adapt to S3OptionsMap. The config_merge_multiple insta
snapshot is updated for the S3OptionsMap wrapper.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EzYs4p6XJDj9QBcNB4ipR7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants