-
Notifications
You must be signed in to change notification settings - Fork 70
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 path handling inconsistency in installer caching #230
Fix path handling inconsistency in installer caching #230
Conversation
Thanks for the suggestion @jonashaag, I changed that line to use path.join |
Could you use tha latest develop to fix the lint test @AndreasAlbertQC ? Thanks! |
@AndreasAlbertQC is there an specific issue you are fixing, or you just opened the PR straight away :) ? |
Co-authored-by: Jonas Haag <[email protected]>
3b05471
to
b81279e
Compare
@goanpeca I rebased on the current I am not aware if there is an open issue regarding this problem. I had just encountered it myself and figured it's more efficient to send a PR with a proposed solution rather than open an issue :) |
Thanks! Could you open an issue for this PR? it makes it easier to track things :)
Also could you open a separate issue for this problem? Finally thanks a lot for submitting a PR with a fix. We have had several issues with self hosted runners :) |
On another note @AndreasAlbertQC and @jonashaag would you be interested in joining the team and help us maintain the project. We appreciate the contributions and having a users/contributors using self hosted runners would really improve the project and overall experience for users. Thanks again :) |
@goanpeca will follow-up using email. |
Closes #237 |
Thanks for the fix @AndreasAlbertQC ! |
Problem: The current implementation of installer executable caching is located here. The code aims to determine
executablePath
, which is supposed to be the full local path (e.g./path/to/script.extension
) to the installer script. However, in the case where the installer script is found in the cache,executablePath
is set to the return value oftc.find
. This is inconsistent with the goal sincetc.find
returns a directory name (e.g./path/to/
) without the basename of the actual script. This inconsistency subsequently leads to failures because theexecutablePath
does not end in a known executable extension, which is explicitly checked.Proposed fix: Manually append the basename of the installer to the executable path in the case where
tc.find
is used.Testing / Demonstration: The broken behavior as well as the fixed one can be seen in this test repo, where example 5 from the setup-miniconda readme is run three times with identical job definitions. The only difference between the jobs is the version of setup-miniconda that is used: the tagged v2 version, the HEAD of the develop branch, or my proposed fixed version from this PR. The first two fail with the error described above, the PR version runs without error.
Note: It seems to me that one only encounters this problem with self-hosted github actions runners. When I tried to reproduce the problem with GitHub-hosted runners, I find that the problematic piece of code is never executed because the installer script is never found in the cache, even if a previous job in the same workflow logs a message saying it was cached. It therefore appears that the cache directory is not persistent between jobs in the case of GitHub-hosted runners, and no caching is ever done successfully. While this does not lead to errors, it still seems to be an independent issue of its own.