Title: Python setup.sh deleting major version directory instead of arch specific directory · Issue #1255 · actions/setup-python · GitHub
Open Graph Title: Python setup.sh deleting major version directory instead of arch specific directory · Issue #1255 · actions/setup-python
X Title: Python setup.sh deleting major version directory instead of arch specific directory · Issue #1255 · actions/setup-python
Description: Description: When I use setup-python with a matrix (e.g. arch: [arm, x86]). The setup script (setup.sh) that is being run will delete the Python version directory (e.g. python3.12.8) and not the architecture specific version. This means ...
Open Graph Description: Description: When I use setup-python with a matrix (e.g. arch: [arm, x86]). The setup script (setup.sh) that is being run will delete the Python version directory (e.g. python3.12.8) and not the ar...
X Description: Description: When I use setup-python with a matrix (e.g. arch: [arm, x86]). The setup script (setup.sh) that is being run will delete the Python version directory (e.g. python3.12.8) and not the ar...
Opengraph URL: https://github.com/actions/setup-python/issues/1255
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python setup.sh deleting major version directory instead of arch specific directory","articleBody":"\u003c!--- Please direct any generic questions related to actions to our support community forum at https://github.community/c/code-to-cloud/github-actions/41 ---\u003e\n\u003c!--- Before opening up a new bug report, please make sure to check for similar existing issues --\u003e\n\n**Description:**\nWhen I use setup-python with a matrix (e.g. arch: [arm, x86]). The setup script (setup.sh) that is being run will delete the Python version directory (e.g. python3.12.8) and not the architecture specific version. This means if I use a matrix and install 'arm' first the 'x86' install will delete the 'arm' installation before proceeding.\n\nWe observed this because we want to cache Python runtimes in a shared resource so they can be used by our self hosted runners. We will run scheduled workflows that install/refresh all of the cached versions we need.\n\n**Action version:**\nv6\n\n**Platform:**\n- [x ] Ubuntu\n- [ ] macOS\n- [ ] Windows\n\n**Runner type:**\n- [ ] Hosted\n- [x ] Self-hosted\n\n**Tools version:**\n\u003c!--- Please list all of the affected Python versions (`3.8.2`, etc.)--\u003e\nInstall any Python version using a matrix.\n\n**Repro steps:** \nA description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.\n```\n matrix:\n arch: [arm, x86]\n version: ['3.12.8']\n```\n**Expected behavior:**\nThe setup script should delete the architecture specific directory only.\n\n**Actual behavior:**\nYou can see clearly from this snippet of the script what is happening\n```bash\n\necho \"Check if Python hostedtoolcache folder exist...\"\nif [ ! -d $PYTHON_TOOLCACHE_PATH ]; then\n echo \"Creating Python hostedtoolcache folder...\"\n mkdir -p $PYTHON_TOOLCACHE_PATH\nelif [ -d $PYTHON_TOOLCACHE_VERSION_PATH ]; then\n echo \"Deleting Python $PYTHON_FULL_VERSION\"\n rm -rf $PYTHON_TOOLCACHE_VERSION_PATH\nfi\n\necho \"Create Python $PYTHON_FULL_VERSION folder\"\nmkdir -p $PYTHON_TOOLCACHE_VERSION_ARCH_PATH\n```\n\nWe can work around this by using `max-parallel: 1` in our matrix configuration but this significantly slows down our refreshes.","author":{"url":"https://github.com/fergoid","@type":"Person","name":"fergoid"},"datePublished":"2025-12-08T11:07:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/1255/setup-python/issues/1255"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0c46c1b9-0b2b-757c-255a-f0eafcd32017 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D458:2C594F:23CFFE:3202E2:69694388 |
| html-safe-nonce | 7fdecf322069d40773a95c65fb1faf62d2201ee69e7d0019807385a380465ec4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDU4OjJDNTk0RjoyM0NGRkU6MzIwMkUyOjY5Njk0Mzg4IiwidmlzaXRvcl9pZCI6IjE0MzUxMjk2OTQxMzI5Nzg1NjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6e287b9f3ed1ebf20381625731455e0b537b0cea10465a708aa7fddedb60139c |
| hovercard-subject-tag | issue:3705862928 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/actions/setup-python/1255/issue_layout |
| twitter:image | https://opengraph.githubassets.com/efac00f5041f8b74cdea96ec7a09780e7367706f80dfc22021aec992e55a7376/actions/setup-python/issues/1255 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/efac00f5041f8b74cdea96ec7a09780e7367706f80dfc22021aec992e55a7376/actions/setup-python/issues/1255 |
| og:image:alt | Description: When I use setup-python with a matrix (e.g. arch: [arm, x86]). The setup script (setup.sh) that is being run will delete the Python version directory (e.g. python3.12.8) and not the ar... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fergoid |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| turbo-cache-control | no-preview |
| go-import | github.com/actions/setup-python git https://github.com/actions/setup-python.git |
| octolytics-dimension-user_id | 44036562 |
| octolytics-dimension-user_login | actions |
| octolytics-dimension-repository_id | 192625525 |
| octolytics-dimension-repository_nwo | actions/setup-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 192625525 |
| octolytics-dimension-repository_network_root_nwo | actions/setup-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width