Fix install script to change directory before cleanup - #1728
Open
Sven Giermann (Giermann) wants to merge 2 commits into
Open
Sven Giermann (Giermann) wants to merge 2 commits into
Sven Giermann (Giermann) wants to merge 2 commits into
Conversation
Kaniska (v-Kaniska244)
requested changes
Sep 17, 2026
Kaniska (v-Kaniska244)
left a comment
Contributor
There was a problem hiding this comment.
Thank you for the contribution. Would it be possible to merge this change with the #1729 PR change as both are realted to the same go feature. Please let me know in case of any concern with that.
Author
Contributor
It should fine to merge this change along with the other PR #1729 , provided the other PR #1729 description is also updated with this change. This is considering that the fix in #1728 is in fact a simple one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two related fixes in the Go feature's "install tools" block.
After installing the Go tools, the script never leaves
${GOPATH}(a temp dir, default /tmp/gotools) before removing it with
rm -rf "${GOPATH}". The shell's cwd is left pointing at a deleteddirectory for the rest of the script. The two
findcalls thatfollow then fail while resolving their own initial working
directory:
This is silent on filesystems/kernels where a process may keep
using a cwd after it's been unlinked, but fails hard on at least
some overlay2 configurations (reproduced on a Synology DSM host,
kernel 4.4). Explicitly cd-ing to a directory that's guaranteed to
still exist before the rm -rf makes this deterministic regardless
of filesystem/kernel.
Because of (1), the piped
xargs -n 1 -0 chmod g+sreceived emptyinput and (GNU xargs' documented default without -r) still ran
chmod g+sonce with no arguments:Independently of fix (1),
-r/--no-run-if-emptybelongs on theseinvocations regardless: chmod should never be invoked at all when
find legitimately produces no output.