Fix bug in gotestsum installer causing dependencies to not be downloaded#40979
Merged
tiborvass merged 2 commits intomoby:masterfrom May 17, 2020
Merged
Fix bug in gotestsum installer causing dependencies to not be downloaded#40979tiborvass merged 2 commits intomoby:masterfrom
tiborvass merged 2 commits intomoby:masterfrom
Conversation
b02d279 to
93e60af
Compare
Member
Author
|
ping @AkihiroSuda @cpuguy83 @tiborvass PTAL this fixes the build-failures seen in #40977 |
Member
Author
|
dang; probably need to fix the Windows build as well. PowerShell here I come 😞 |
2764638 to
7beaca1
Compare
Merged
Building gotestsum started to fail after the repository removed some
dependencies on master.
What happens is that first, we `go get` the package (with go modules disabled);
GO111MODULE=off go get -d gotest.tools/gotestsum
Which gets the latest version from master, and fetches the dependencies used
on master. Then we checkout the version we want to install (for example `v0.3.5`)
and run go build.
However, `v0.3.5` depends on logrus, and given that we ran `go get` for `master`,
that dependency was not fetched, and build fails.
This patch modifies the installer to use go modules (alternatively we could
probably run `go get .` after checking out the `v0.3.5` version),
We need to modify all installers, as it looks like this is a standard pattern
we use, but other dependencies were not failing (yet), so this patch only
addresses the immediate failure.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
ae4ff23 to
e65ca18
Compare
Member
Author
|
argh PowerShell, why u so verbose ? 😞 |
9dfd42d to
07b6821
Compare
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
07b6821 to
aadc55c
Compare
tiborvass
reviewed
May 16, 2020
| if ($savedExitCode -ne 0) { ` | ||
| $env:GO111MODULE = 'on'; ` | ||
| &go get -d "gotest.tools/gotestsum@${Env:GOTESTSUM_COMMIT}"; ` | ||
| $env:GO111MODULE = 'off'; ` |
Contributor
There was a problem hiding this comment.
this should go after LASTEXITCODE, in case resetting the envvar modifies LASTEXITCODE.
Member
Author
There was a problem hiding this comment.
ah, probably need to add an intermediate variable again 😞
Member
Author
There was a problem hiding this comment.
not sure actually; can $env:FOO = something fail?
Member
Author
There was a problem hiding this comment.
Looks like it's not needed;
PS> go get -d example.com/foobar
unrecognized import path "example.com/foobar": reading https://example.com/foobar?go-get=1: 404 Not Found
PS> echo $LASTEXITCODE
1
PS> $env:GO111MODULE = 'off';
PS> echo $LASTEXITCODE
1
Member
Author
|
@tiborvass all green now; PTAL |
tiborvass
approved these changes
May 17, 2020
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.
Building gotestsum started to fail after the repository removed some
dependencies on master.
What happens is that first, we
go getthe package (with go modules disabled);Which gets the latest version from master, and fetches the dependencies used
on master. Then we checkout the version we want to install (for example
v0.3.5)and run go build.
However,
v0.3.5depends on logrus, and given that we rango getformaster,that dependency was not fetched, and build fails.
This patch modifies the installer to use go modules (alternatively we could
probably run
go get .after checking out thev0.3.5version),We need to modify all installers, as it looks like this is a standard pattern
we use, but other dependencies were not failing (yet), so this patch only
addresses the immediate failure.