Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use correct directory for build artifact cache #2830

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

baszalmstra
Copy link
Contributor

There was an issue were the packages in the build-cache were reused for unrelated source checkouts. This is because we bucket the caches based on the pinned source spec but for a lot of examples the pinned path source spec was simply .. This caused a lot of examples to reuse the cache entry of another source checkout causing strange behavior.

I fixed this issue by using the pinned source spec as the cache key if the source is immutable (e.g. for git checkouts) and otherwise (e.g. for path source dependencies) use the absolute path on disk as the cache key. I think this makes sense as it creates separate cache entries for packages in different locations on disk (like temporary directories).

Fixes #2792

@baszalmstra baszalmstra requested a review from tdejager January 3, 2025 13:50
@baszalmstra baszalmstra changed the title chore: simplify rust activation fix: use correct directory for build artifact cache Jan 3, 2025
@tdejager tdejager merged commit 8e72a49 into prefix-dev:main Jan 3, 2025
29 checks passed
tdejager pushed a commit to tdejager/pixi that referenced this pull request Jan 3, 2025
There was an issue were the packages in the build-cache were reused for unrelated source checkouts. This is because we bucket the caches based on the pinned source spec but for a lot of examples the pinned path source spec was simply .. This caused a lot of examples to reuse the cache entry of another source checkout causing strange behavior.

I fixed this issue by using the pinned source spec as the cache key if the source is immutable (e.g. for git checkouts) and otherwise (e.g. for path source dependencies) use the absolute path on disk as the cache key. I think this makes sense as it creates separate cache entries for packages in different locations on disk (like temporary directories).
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 failure when running pytest in a specific way
2 participants