-
Notifications
You must be signed in to change notification settings - Fork 565
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
Fix Tool Cache for Self Hosted Runners #461
Conversation
This aligns the tool cache path logic with the process used by actions/python-versions, maintaining the ability to locate the version binaries, and fixing self-hosted runners. Fixes actions#459
This updates and simplies the tool cache documentation to match the implementation in both and Relates actions#459
Hi, @techman83 👋 ! Thank you for your contribution! Please, read this part of the setup-python README.md file again. The main sense here is: We understand that sometimes there could be a problem to use By now I'm going to close this PR, if you have any questions feel free to ping us here or in the mentioned above issue. |
@IvanZosimov I have read that section of the readme a number of times, whilst I hear and appreciate what you are saying, that interpretation as far as I can gather, is incorrect. This change was to fix an issue with The directions in the readme make using Personally it will be easy for me to adjust our runner permissions, but if I didn't have that level of control over them, I would have to go to every work flow and reset the runner cache back using an environment variable attached pointing to the runner context. steps:
- uses: actions/checkout@v3
- name: Setup Python
env:
AGENT_TOOLSDIRECTORY: ${{ runner.tool_cache }}
uses: actions/setup-python@v4
with:
python-version: "3.11.0-beta.4"
cache: pip Adding to this, to be clear. This does not change the behaviour of hosted runners. I will apologise if there is something glaringly obvious I've missed, but an improvement in user experience shouldn't be excluded just because it's documented in the readme (short of breaking, backwards incompatible changes). |
Hi, @techman83 👋 First of all I'd like to thank you for your contribution and willingness to improve our action ❤️ Your questions made us to make deeper investigation. May I ask you to revive this PR? |
@IvanZosimov sure thing! I'll raise a new PR, I learned more about what was happening and I had definitely had a misunderstanding about what the #394 was intended to fix. So I have made some improvements with that in mind 🙂 |
Description:
As of actions/python-versions@f75c0e6 the default location for Linux/Mac/Windows was aligned to default to
RUNNER_TOOL_CACHE
ifAGENT_TOOLCACHE
wasn't specified. The change introduced and released in v4.1.0 didn't account for this default being different for self hosted runners and hard coded it to/opt/hostedtoolcache
.This change aligns the behaviour of
actions/setup-python
withaction/python-versions
, and makes the experience of using the action the same on both hosted + self-hosted runners.I have adjusted the documentation, and made the changes in line with how the project appears to operate, but as shouldn't be much of a surprise, TypeScript isn't my day-to-day language 🙂 and welcome any feedback.
If there are test cases that can be added, happy for some guidance, but I didn't see any with the commit that changed this behaviour. From my manual testing, both hosted + self-hosted work as I would expect.
Hosted Linux
Hosted Windows
Hosted Mac
Self-Hosted Linux
Related issue:
Fixes #459
Check list: