refactor: use shared config types from rattler_config#6528
Open
wolfv wants to merge 1 commit into
Open
Conversation
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
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.
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_configcrate (0.5, crates.io) instead of maintaining its own copies:RepodataConfig/RepodataChannelConfig(including the tolerant deserializer that keeps deprecated keys likedisable-jlapas warnings instead of hard errors)S3Options+ the newS3OptionsMapnewtype (IndexMap<String, S3Options>)ConcurrencyConfig(same defaults: solves = #CPUs, downloads = 50)ProxyConfig,BuildConfig/PackageFormatAndCompression,RunPostLinkScriptsAll types are re-exported from
pixi_configso external paths (pixi_config::S3Options, …) keep compiling. Merging goes through therattler_config::config::Configtrait; the oldFrom<RepodataChannelConfig> for SourceConfigbecame a free function due to the orphan rule.Follow-ups (flagged with
TODO(rattler-config): promotecomments, as discussed in #6144): promotingtls_root_certs, theallow_*_linkstrio andpinning_strategyare user-facing schema decisions and stay out of this PR. The upstreamrattler_configredesign in conda/rattler#2557 (unknown-key warnings that work with extensions, genericset, shared config-file discovery) is the basis for the next step, where pixi'sConfigcan becomeConfigBase<PixiConfig>.How Has This Been Tested?
cargo check --workspace --all-targetspasses.cargo test -p pixi_config: 53 passed, 0 failed (with proxy env vars scrubbed — see note below).cargo fmt --checkandcargo clippy -p pixi_config -p pixi_api --all-targetsclean.test_config_merge_multipleis env-sensitive behind a proxy becauserattler_config0.5.2'sProxyConfig::default()reads proxy env vars; refactor(rattler_config)!: make the extension mechanism reliable and self-serving conda/rattler#2557 fixes this upstream (emptyDefault, explicitProxyConfig::from_env()).AI Disclosure
Tools: Claude Code
Checklist:
schema/model.py(no schema impact — internal type moves only, serialized config format unchanged)Generated by Claude Code