Bug fix: Validate cached julia binary exists and check PATH resolution - #389
Conversation
|
Can you put the changes that modify |
| // Verify that PATH lookup of `julia` resolves to the binary we just installed. | ||
| // On self-hosted runners other Julia entries (e.g. juliaup launcher in | ||
| // ~/.juliaup/bin) can shadow the toolcache binary depending on PATH state. | ||
| try { |
There was a problem hiding this comment.
Is there a way to implement this without try-catch?
|
To clarify, in this PR, you're not actually running the Julia binary to make sure it's runnable, you're just verifying that the Julia binary exists as a file on disk in the expected place? So, if I understand correctly: Before this PR:
After this PR:
Have I described things correctly? I'm totally fine if that's the case1, I just would like to make the PR description (and the code comments) a little more precise, to better describe what we're actually checking. Footnotes
|
I updated the PR description. Also removed the part which checks if the julia binary is runnable. Also split the commit |
|
Thank you @krynju! |
I noticed this in CI. It's related to some problems with juliaup being installed on the workers and being messed with by install-juliaup (but that's a different issue)
setup-julia failed here at the
julia --versioncheck, because path resolved to a faulty local juliaup installation. This makes me think the cached binary might not have been fully there (just a .complete marker present).Changes
1. Added
bin/juliaexists check which causes a cache miss on failure prompting a new download.completebin/juliaexists2. Added a PATH resolution check (warning)
We're basically checking if the selected Julia version/binary is the one that would resolve from PATH. I'm not sure if this should be fatal, so leaving it as a warning in case such an issue appears again.