Skip to content

fix: suggest the correct cache config key in netfs-redirect warning#6282

Open
baszalmstra wants to merge 2 commits into
prefix-dev:mainfrom
baszalmstra:claude/clever-hawking-BJ9tZ
Open

fix: suggest the correct cache config key in netfs-redirect warning#6282
baszalmstra wants to merge 2 commits into
prefix-dev:mainfrom
baszalmstra:claude/clever-hawking-BJ9tZ

Conversation

@baszalmstra
Copy link
Copy Markdown
Contributor

Description

When a cache lives on a network filesystem, pixi prints a warning telling you which cache config key to set to override the redirect. For the pypi mapping cache, the warning suggested a key name that pixi does not actually accept, so following the advice produced an "Ignoring" warning and the setting had no effect. This corrects the warning to suggest the key that actually works.

Fixes #6281

How Has This Been Tested?

Added a regression test that confirms the key suggested in the warning is accepted by the config parser for every cache kind. All existing cache config tests continue to pass.

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

Checklist:

  • I have performed a self-review of my own code
  • I have added sufficient tests to cover my changes.

The network-filesystem redirect warning built its suggested config key
from `CacheKind::subdir()`, the on-disk directory name. For the pypi
mapping cache that name (`conda-pypi-mapping`) differs from the actual
TOML field (`pypi-mapping`), so the warning told users to add
`[cache.conda-pypi-mapping]`, which is then rejected as an unknown key
("Ignoring 'cache.conda-pypi-mapping'").

Add `CacheKind::config_key()` returning the real TOML field name and use
it in the warning. Includes a regression test asserting every kind's
config_key round-trips through `CacheConfig` deserialization.

Fixes prefix-dev#6281
@baszalmstra baszalmstra requested a review from nichmor June 4, 2026 13:17
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.

cache.pypi-mapping in config.toml is ignored, only PIXI_CACHE_DIR is recognized

2 participants