-
Notifications
You must be signed in to change notification settings - Fork 14
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
Prune all Python versions from hosted tool cache prior to building #263
Conversation
e39ae44
to
8bf2576
Compare
- name: Remove Python in hosted tool cache | ||
if: runner.os == 'Linux' | ||
run: | | ||
rm -Rf ${RUNNER_TOOL_CACHE}/Python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite the nuclear 💣option, have we tried passing a specific Python 3.11 version to setup-python@v4
to force it to upgrade existing Python 3.11 installation to a certain 3.11.<patch>
version, or using check-latest: true
?
check-latest:
description: "Set this option if you want the action to check for the latest available version that satisfies the version spec."
default: false
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}
check-latest: true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. However, explicitly setting the requested Python version to 3.11.11
did not work, I was still seeing the glibc error from the distribution present in the tool cache. I'm not sure about check-latest
, though. I reckon, that this switch is only functional, if you loosely specify the requested Python version, e.g., 3.11
instead of 3.11.11
. In this case the routine resolves to the latest release, that still satisfies the version specifier (e.g., 3.11 -> 3.11.11
). The code of the action also supports this claim, imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the issue was popping up in another PR, I had the opportunity to confirm, that both setting check-latest
to true
and enforcing the requested Python version to be 3.11.11
is not sufficient to resolve this issue. I advocate to proceed with the changes proposed in the PR to unblock developers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgrading setup-python
to latest v5
also does not fix the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to get devs unblocked. Would be nice to address this another way in the future.
8bf2576
to
797ac56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
We're proceeding with #275, which contains the upstream fix for the issue this PR is solving. |
In #256 we were seeing the following build failure:
It turned out, that the problem is coming from Python requiring a newer GLIBC version inside the container.
However, spawning the container locally and downloading the used Python 3.11.11 from GitHub's own Python release list, I wasn't able to reproduce this problem. It turned out, that the hosted tool cache, for some reasons, holds a distribution which is linked against the newer GLIBC and the
setup-python
action would not recognize that and (re-)fetch the Python package.This PR effectively disables the caching by pruning all previously fetched Python versions from the hosted tool cache.