-
Notifications
You must be signed in to change notification settings - Fork 990
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
Which command should handle broken symlinks #2150
Comments
Thank you, @dhadka, for reporting this! I applied correct labels and added this issue to the board. |
We could fail if the path returned by In other words, after the runner code invokes which to get the path to the executable, we could enforce that it in fact exists. |
Hi, I am a first time contributor, I would like to take this issue. Would appreciate any help on where to start |
Hello @Eliminator1999. Let me know if you'd like me to assign you to this issue. High level goalMake the runner work the same as Code location and whatnotBy default, running
Pre-requisitesAre you already familiar with how Actions works and how to use self-hosted runners? Next, I'd recommend checking out our contribution document. |
thank you @fhammerl, yes please assign this to me, and thanks for all the info! |
@fhammerl @nikola-jokic , can someone please review the pr #2196? thank you |
* which handles broken symlink & unit test added (#2150) * Update src/Runner.Sdk/Util/WhichUtil.cs Co-authored-by: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com> * fix pr comments * trace log added, in case we find a symlink that is broken * add check in case the target of the symlink is a relative path; added test that check symlink that targets a full path; added test that check symlink that targets a relative path; * fix tests * fix tests for linux --------- Co-authored-by: Eli Entelis <eli.entelis@hexagon.com> Co-authored-by: Eli Entelis <42981948+Eliminator1999@users.noreply.github.com> Co-authored-by: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com>
PR merged |
…s#2196) * which handles broken symlink & unit test added (actions#2150) * Update src/Runner.Sdk/Util/WhichUtil.cs Co-authored-by: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com> * fix pr comments * trace log added, in case we find a symlink that is broken * add check in case the target of the symlink is a relative path; added test that check symlink that targets a full path; added test that check symlink that targets a relative path; * fix tests * fix tests for linux --------- Co-authored-by: Eli Entelis <eli.entelis@hexagon.com> Co-authored-by: Eli Entelis <42981948+Eliminator1999@users.noreply.github.com> Co-authored-by: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com>
Describe the bug
https://github.com/actions/runner/blob/main/src/Runner.Sdk/Util/WhichUtil.cs should detect and ignore broken symlinks. This should be considered a bug as calling the native
which
command will detect and ignore the broken symlink.To Reproduce
See https://github.com/dhadka/repro-broken-symlink/actions/runs/3106185147/jobs/5032737959 for an example. Here I'm creating a broken symlink for
pwsh
and then trying to run Powershell usingshell: pwsh
and through bash withrun: pwsh -Command ...
.shell: pwsh
fails because it's using the customWhichUtil
implementation, matches the broken symlink, and fails withAn error occurred trying to start process '/usr/local/bin/pwsh' with working directory '/home/runner/work/repro-broken-symlink/repro-broken-symlink'. No such file or directory
run: pwsh -Command ...
works fine as it uses the system'swhich
command that ignores the broken symlink.Expected behavior
If the target of the symlink does not exist,
WhichUtil
should skip it and locate any other matches on the PATH.Runner Version and Platform
Latest Version
OS of the machine running the runner? Ubuntu
What's not working?
See repro above.
Job Log Output
See repro above.
Runner and Worker's Diagnostic Logs
N/A
The text was updated successfully, but these errors were encountered: