fix: honor workspace [cache.*] overrides for conda-pypi mapping cache#6284
Open
baszalmstra wants to merge 3 commits into
Open
fix: honor workspace [cache.*] overrides for conda-pypi mapping cache#6284baszalmstra wants to merge 3 commits into
baszalmstra wants to merge 3 commits into
Conversation
…ache path Workspace-level `[cache.*]` overrides were ignored for the conda-pypi mapping cache because the mapping client resolved its path through a global-only code path (the free `cache_dir_for`, reading only system + user config). A `[cache.pypi-mapping]` set in a workspace `.pixi/config.toml` was silently dropped, so the netfs redirect kept firing and the "cache for PypiMapping ... is on a network filesystem" warning persisted (issue prefix-dev#6281). Make `MappingClient::builder` take the resolved cache path as a parameter and resolve it through the workspace-merged config at the call site (`project.config().cache_dir_for(PypiMapping)`), keeping the `pypi_mapping` crate agnostic about which config layer wins. Also remove the global-only free `cache_dir_for(kind)` entirely so per-kind cache paths always flow through `Config::cache_dir_for`: - `pixi clean cache` now resolves the cache config from the workspace when available, falling back to the global config outside a workspace. - `DetachedEnvironments::path` takes the cache config to consult. `GLOBAL_CACHE_CONFIG` is kept only for `get_cache_dir` (cache root). Add a regression test that a workspace-merged `[cache.pypi-mapping]` override wins over a forced netfs redirect.
Resolving the detached-environments directory previously required handing
the config its own cache config:
workspace.config().detached_environments().path(&workspace.config().cache)
Add `Config::detached_environments_dir()` that resolves the path against
its own `[cache]` settings, and route all callers through it. The
lower-level `DetachedEnvironments::path` is now a private helper.
2 tasks
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
A
[cache.pypi-mapping]path set in a workspace.pixi/config.tomlwas being ignored. The conda-pypi mapping cache always resolved through a global-only path, so the workspace setting had no effect; the cache kept landing on the network filesystem, and the "cache for PypiMapping is on a network/parallel filesystem" warning kept firing. The only workaround was settingPIXI_CACHE_DIR.This makes the mapping cache respect the workspace configuration like the other caches do. As part of this, the global-only cache path is removed so all per-kind cache directories now honor workspace-level
[cache.*]overrides, including forpixi clean cache.Partly fixes #6281
How Has This Been Tested?
Added a regression test confirming a workspace-level
[cache.pypi-mapping]override is honored even when the network-filesystem redirect is forced. Also verified the full test suite and build pass.AI Disclosure
Tools: Claude
Checklist: