-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix make tools #6372
Fix make tools #6372
Conversation
go install github.com/golangci/golangci-lint/cmd/golangci-lint | ||
|
||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.18.0 | ||
curl -L https://git.io/misspell | BINDIR=$(shell go env GOPATH)/bin bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fetching the compiled binaries means we don't have to build them from source ourselves, which means we don't inherit their dependencies.
Both tools are installed to $GOPATH/bin
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ryboe! Would you be able to provide me steps to reproduce make tools
failing? I've cloned a clean repo and run it and it still succeeds for me. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake! make tools
is working fine. I'm not sure why it was failing earlier for me. I'll close this PR. Thanks for catching this 🙂
import ( | ||
_ "github.com/client9/misspell/cmd/misspell" | ||
_ "github.com/golangci/golangci-lint/cmd/golangci-lint" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This underscore imports are how you vendor dev tools. Since we're not vendoring anymore, these should be deleted.
Also simplify `make test` command. Remove `GO111MODULE=on` and `GOFLAGS=-mod=vendor` env vars, which are no longer necessary in Go 1.14.
There was a slight regression from #6368, which removed `vendor/`. The `misspell` and `golangci-lint` tools were being built out of `vendor/`. I updated `make tools` so that the compiled binaries are fetched from GitHub. Then I ran `go mod tidy` to remove unused packages from `go.mod`. It removed four packages. Removing dev dependencies from `go.mod` is a nice change. The dependency solver will never artificially hold back a package update because of an incompatibility with the linter or `misspell`. Anybody importing packages from `terraform-provider-google` will not inherit the false dependency on `golangci-lint` or `misspell`.
This PR was misguided. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
NOTE: This includes all the changes from #6359 (the Go compiler update). #6359 should be reviewed and merged before this.
There was a slight regression from #6368, which removed
vendor/
. Themisspell
andgolangci-lint
tools are still being built out ofvendor/
, somake tools
fails.I updated
make tools
so that the compiled binaries are fetched from GitHub. Then I rango mod tidy
to remove unused packages fromgo.mod
. It removed four packages. Removing dev dependencies fromgo.mod
is a nice change for two reasons:misspell
.terraform-provider-google
will not inherit the false dependency ongolangci-lint
ormisspell
.