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

pip cache always uses node process architecture, ignoring architecture key #971

Open
5 tasks done
alex opened this issue Oct 26, 2024 · 3 comments
Open
5 tasks done
Assignees
Labels
feature request New feature or request to improve the current logic

Comments

@alex
Copy link

alex commented Oct 26, 2024

Description:

The pip caching code uses a cache key that does not include the Python binary's architecture. This leads to cache thrashing.

https://github.com/actions/setup-python/blob/main/src/cache-distributions/pip-cache.ts#L68-L75

These keys should include the Python binary architecture, which is specified with the architecture input to the action.

Action version:
5.2.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
All

@alex alex added bug Something isn't working needs triage labels Oct 26, 2024
@priya-kinthali priya-kinthali added feature request New feature or request to improve the current logic and removed bug Something isn't working needs triage labels Oct 28, 2024
@priya-kinthali
Copy link
Contributor

Hello @alex 👋,
Thank you for this feature request. We will investigate it and get back to you as soon as we have some feedback.

@aparnajyothi-y
Copy link
Contributor

Hello @alex , This change, introduced in PR #896, adds the architecture to the pip cache key. This approach enhances caching efficiency by preventing cache thrashing when switching between different Python architectures (e.g., x86_64 and arm64). As a result, builds become faster, and multi-architecture workflows are better supported.

Please validate this from your end and share any further inputs to confirm the exact requirement.

@aparnajyothi-y aparnajyothi-y self-assigned this Jan 9, 2025
@alex
Copy link
Author

alex commented Jan 9, 2025

No, that PR does not address this issue. If you look, you will also see that that PR was merged before I filed this.

That PR makes use of the node processes' architecture. But what I requested is the Python binary architecture.

On Windows, these can differ. On Windows, both x86 (32-bit) and x86-64 (64-bit) Python binaries can be installed, and the node process architecture will always be 64-bit.

We need to include the Python binary's architecture, which is specified with the architecture key to the setup-python action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

No branches or pull requests

3 participants