Skip to content
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

GO111MODULE=off while installing errcheck + switch to go mod #5

Merged
merged 6 commits into from
Dec 16, 2020

Conversation

viktorbenei
Copy link
Contributor

@viktorbenei viktorbenei commented Sep 21, 2020

Running go get with GO111MODULE=off set, so if you run this step in a go module directory it'll still install errcheck to PATH.

@viktorbenei
Copy link
Contributor Author

Build failed due to bitrise-steplib/steps-go-list#2

@viktorbenei
Copy link
Contributor Author

Workaround implementation: #6

@viktorbenei
Copy link
Contributor Author

Alternatively we could change the workdir to /tmp or such, so when go get is called it won't install it in our own module but will install it "globally".

@godrei
Copy link
Contributor

godrei commented Nov 23, 2020

Hi @viktorbenei ,

build fails with this error:

Configs:
- packages: github.com/bitrise-steplib/steps-errcheck
Installing golint
$ go "get" "-u" "golang.org/x/lint/golint"
Running golint...
$ golint "-set_exit_status" "github.com/bitrise-steplib/steps-errcheck"
golint failed
go/build: go list github.com/bitrise-steplib/steps-errcheck: exit status 1
go: inconsistent vendoring in /bitrise/go/src/github.com/bitrise-steplib/steps-errcheck:
	golang.org/x/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	golang.org/x/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
run 'go mod vendor' to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory
golint failed: %!s(<nil>)

It fails by the lack of a global dependency install option: golang/go#30515.

I agree with you, each step installing a go dependency via go get ..., should run the install cmd in a tmp dir / outside of the actual module.

I create a ticket to solve this.

@imrekel imrekel marked this pull request as draft December 16, 2020 15:25
@imrekel
Copy link
Contributor

imrekel commented Dec 16, 2020

so, running go get in / (outside of any module) solves the issue. Since it affects both golint and this step itself, I had to run the validation with both of them fixed. I did this by pinning the errcheck run to the branch of this PR and using a temporary repo with the golint fix. See the green run: https://app.bitrise.io/build/6fff197794d38d3d#?tab=log

After removing the references to the fixes it fails again but can be merged as the issue will be fixed if both this and the new golint get released.

@imrekel imrekel marked this pull request as ready for review December 16, 2020 15:37
@trapacska trapacska merged commit 9846afc into master Dec 16, 2020
@trapacska trapacska deleted the gomod-off-for-install branch December 16, 2020 15:48
@viktorbenei
Copy link
Contributor Author

Thanks everyone! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants