Description:
Downstream issue: msys2/msys2-autobuild@fe4bcd0#commitcomment-153600091
Running the following on a self-hosted Windows runner leads to:
- uses: actions/setup-python@v5id: pythonwith:
python-version: '3.13'cache: 'pip'cache-dependency-path: 'requirements.txt'architecture: 'x64'update-environment: false
error:
[error]Command failed: pip cache dir
'pip' is not recognized as an internal or external command,
operable program or batch file.
The problematic thing being "update-environment" (which we need to set, so it doesn't set cmake and pkg-config variables interfering with our builds. I don't mind the PATH, but setup-python only does all or nothing)
It looks like the cache code depends on pip being globally available, while it might not be:
| ({stdout: stdout,stderr: stderr}=awaitexecPromisify('pip cache dir')); |
| }else{ |
| ({ |
| stdout: stdout, |
| stderr: stderr, |
| exitCode: exitCode |
| }=awaitexec.getExecOutput('pip cache dir')); |
. This likely just works on the hosted runners since there pip is installed already.
In other places this is handled correctly by explicitly going through the just installed python/pip, for example:
| constpythonBinary=path.join(pythonLocation,'python'); |
| awaitexec.exec(`${pythonBinary} -m ensurepip`); |
| |
| awaitexec.exec( |
| `${pythonLocation}/python -m pip install --ignore-installed pip` |
| ); |
Action version:
actions/setup-python@v5
Platform:
Runner type:
Tools version:
3.13, but any really
Repro steps:
See above
Expected behavior:
The action to run
Actual behavior:
It errors out
Description:
Downstream issue: msys2/msys2-autobuild@fe4bcd0#commitcomment-153600091
Running the following on a self-hosted Windows runner leads to:
error:
The problematic thing being "update-environment" (which we need to set, so it doesn't set cmake and pkg-config variables interfering with our builds. I don't mind the PATH, but setup-python only does all or nothing)
It looks like the cache code depends on pip being globally available, while it might not be:
setup-python/src/cache-distributions/pip-cache.ts
Lines 35 to 41 in 9e62be8
In other places this is handled correctly by explicitly going through the just installed python/pip, for example:
setup-python/src/install-pypy.ts
Lines 177 to 182 in 9e62be8
Action version:
actions/setup-python@v5
Platform:
Runner type:
Tools version:
3.13, but any really
Repro steps:
See above
Expected behavior:
The action to run
Actual behavior:
It errors out