CI: remove "sudo" to fix incorrect Go versions (incorrect PATH, GOROOT)#22
Merged
thaJeztah merged 2 commits intomoby:masterfrom Nov 1, 2020
Merged
CI: remove "sudo" to fix incorrect Go versions (incorrect PATH, GOROOT)#22thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah merged 2 commits intomoby:masterfrom
Conversation
Member
Author
|
@AkihiroSuda @dims PTAL |
Member
Author
|
Actually; why do we need |
We were using `sudo` (without `-E`), causing environment variables that were set by `actions/setup-go` to be lost. We need to preserve environment variables, including `PATH`, because `actions/setup-go@v2` installs Go in specific paths to allow multiple versions to be installed/cached on workers, for example, in `"/opt/hostedtoolcache/go/1.13.15/x64"`. While it's possible to fix by adding both `-E`, and `env "PATH=$PATH"` (sudo -E does not preserve `PATH`as a security measure (see https://unix.stackexchange.com/a/83194/78656), this repository does not need `sudo` for its tests to run, so we might as well remove it altogether. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This stage runs in a container, so Go is not needed on the host. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Member
Author
|
Updated; now removed |
AkihiroSuda
approved these changes
Nov 1, 2020
Member
Author
|
let me go ahead and merge this 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.
We were using
sudo(without-E), causing environment variables that were set byactions/setup-goto be lost.We need to preserve environment variables, including
PATH, becauseactions/setup-go@v2installs Go in specific paths to allow multiple versions to be installed/cached on workers, for example, in"/opt/hostedtoolcache/go/1.13.15/x64".While it's possible to fix by adding both
-E, andenv "PATH=$PATH"(sudo -E does not preservePATHas a security measure (see https://unix.stackexchange.com/a/83194/78656), this repository does not needsudofor its tests to run, so we might as well remove it altogether.Also removing the setup-go step from the
Lintstage, as it runs in a container, so Go is not needed on the host.For details, see my debugging steps in #21