Fails to run on self hosted Windows runner if pip is not in PATH
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- github-actions, typescript
- 領域
- ci-cd
研究方向
從所引用行中的 src/cache-distributions/pip-cache.ts 的 pip 快取邏輯開始,然後比較 src/install-pypy.ts 如何呼叫已安裝的 Python 工具。在停用 update-environment 的情況下重現 Windows self-hosted 工作流程,並驗證當 pip 不在 PATH 中時 pip 快取是否成功。
由索引模型根據 Issue 內容生成。
描述
Description:
Downstream issue: https://github.com/msys2/msys2-autobuild/commit/fe4bcd08a9fbdd4a2874a67b4491991a76d784a7#commitcomment-153600091
Running the following on a self-hosted Windows runner leads to:
- uses: actions/setup-python@v5
id: python
with:
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: https://github.com/actions/setup-python/blob/9e62be81b28222addecf85e47571213eb7680449/src/cache-distributions/pip-cache.ts#L35-L41. 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: https://github.com/actions/setup-python/blob/9e62be81b28222addecf85e47571213eb7680449/src/install-pypy.ts#L177-L182
Action version:
actions/setup-python@v5
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version:
3.13, but any really
Repro steps:
See above
Expected behavior:
The action to run
Actual behavior:
It errors out
- 主要語言
- TypeScript
- 星號
- 2.2k
- 分支
- 739
- 平均合併
- 6 天 18 小時
- 30 天內合併 PR
- 1
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
actions/setup-python 的其他 Issue
-
bug
難度 4/5 3-5 天 新手友好度 55/100
actions/setup-python#1348 · 5 則留言 ·
-
feature request
難度 5/5 一週以上 新手友好度 35/100
actions/setup-python#1346 · 12 則留言 ·
-
feature request
難度 3/5 1-2 天 新手友好度 58/100
actions/setup-python#1308 · 8 則留言 ·
-
feature request
難度 2/5 1-3 小時 新手友好度 35/100
actions/setup-python#1301 · 5 則留言 ·
-
feature request
難度 4/5 3-5 天 新手友好度 55/100
actions/setup-python#1294 · 3 則留言 · 2 個 reaction ·
查看 actions/setup-python 的全部 Issue
相似的 Issue
-
blocklist removal
難度 2/5 1-3 小時 新手友好度 65/100
MetaMask/eth-phishing-detect#296544 ·
-
難度 2/5 1-3 小時 新手友好度 70/100
pastelsky/bundlephobia#1122 ·
-
難度 2/5 1-3 小時 新手友好度 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 75/100