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

Can cache prune remove unpacked source trees? #7394

Closed
bluss opened this issue Sep 14, 2024 · 4 comments · Fixed by #7446
Closed

Can cache prune remove unpacked source trees? #7394

bluss opened this issue Sep 14, 2024 · 4 comments · Fixed by #7446
Assignees
Labels
cache Caching of packages and metadata

Comments

@bluss
Copy link
Contributor

bluss commented Sep 14, 2024

Building wheels from source leaves unpacked source trees after the build, such as this for cython:

~/.cache/uv/built-wheels-v3/pypi/cython/3.0.11/4c57QS8T3uI0oPlqtRE1W/cython-3.0.11.tar.gz

In this case it's 127 MB after build, 85 MB of which are in the ./build/ subtree with build artifacts.
If these files are not necessary after the .whl is produced and cached, can the build tree be removed? For example by uv cache prune.

@charliermarsh
Copy link
Member

Hmm... We do need them in case we have to re-build the wheel. For example, if you then try to install cython on a different Python version, we would need to rebuild (since the cython wheels are Python-minor-version specific, like
Cython-3.0.11-cp39-cp39-win32.whl).

@charliermarsh charliermarsh added the cache Caching of packages and metadata label Sep 14, 2024
@charliermarsh
Copy link
Member

Perhaps we could add a setting for this, though...? Or make it part of uv cache prune --ci?

@charliermarsh charliermarsh self-assigned this Sep 16, 2024
@charliermarsh
Copy link
Member

I think we should remove these in uv cache prune --ci.

@bluss
Copy link
Contributor Author

bluss commented Sep 16, 2024

Ok I understand now, they are downloaded and unpacked where they are, and the build happens in the tree. It sounds good to remove them at least in some mode of pruning. I realize the process for building wheels don't leave a lot of control for how to handle details of the build (cleaning the tree after build -- removing build intermediates -- and before reusing the unpacked source for another build?)

charliermarsh added a commit that referenced this issue Sep 16, 2024
## Summary

It's very unlikely that retaining these is beneficial, since you tend to
partition the cache by platform anyway.

Closes #7394.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cache Caching of packages and metadata
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants