-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Makefile: simplify for modern Go #13870
Makefile: simplify for modern Go #13870
Conversation
25a494e
to
9d7da20
Compare
/approve |
Test failures seem related |
@kolyshkin RE:
|
I wonder if it's related to your fork being called |
9d7da20
to
073166b
Compare
OK, this should work now. The problem with rpm building was caused by the fact that
|
LGTM in principle, but I don't know enough Go to approve. It's not passing CI, though. |
The error from "Test Code Consistency" job
seems like a network glitch. Perhaps we should remove "make vendor" from most of the jobs, since it is error prone and doing it once is enough. |
c213b13
to
f250fb7
Compare
OK, for some reason Cirrus-CI has So I had to add the following to # Sane (default) value for GOPROXY and GOSUMDB.
GOPROXY: "https://proxy.golang.org,direct"
GOSUMDB: "sum.golang.org" |
I am still working on it, thus it's a draft. |
This was originally added in commit a824186 to be used from Travis CI. Travis was removed in commit 8771a03 and there is no need to have this target ever since (October 2018). Also, remove the comment about BUILD_TAGS, which originally belonged to varlink target (removed by commit f62a356) but got misplaced later. Signed-off-by: Kir Kolyshkin <[email protected]>
Since about Go 1.10 (or whereabouts) the specific package structure is no longer required. This also removes GOPKGDIR and GOPKGBASEDIR as they were only used by gopathok. Signed-off-by: Kir Kolyshkin <[email protected]>
Recent commit 3b91779 removes this target, but some artifacts remain. Remove those. Fixes: 3b91779 Signed-off-by: Kir Kolyshkin <[email protected]>
Remove GOPATH setting as since Go 1.9 it defaults to $HOME/go (for earlier versions it had to be specified explicitly). Remove GOPATH-related code from the spec, using relative paths when compiling packages, and enable Go modules, simplifying the spec. Remove support for multiple paths in GOPATH (which is rarely used and doesn't really work with modules). Remove setting GOBIN, rely on $GOPATH/bin instead. In case GOBIN is explicitly set (which is highly unlikely), forcefully ignore by unsetting it. Remove GOBIN from tools invocation since we added GOPATH/bin to PATH. Signed-off-by: Kir Kolyshkin <[email protected]>
GOPROXY's default value is "https://proxy.golang.org,direct" since go 1.13, so it is redundant to set it explicitly. For some reason though, GOPROXY in Cirrus CI is set to direct, which makes things such as go mod tidy very slow. So, set the proper (default) value for in in .cirrus.yml. Do the same for GOSUMDB. Signed-off-by: Kir Kolyshkin <[email protected]>
"go build" no longer requires explicit "-mod=vendor", as this is the default since go 1.14. Signed-off-by: Kir Kolyshkin <[email protected]>
Those are not used since commit 0d1ba0a. Fixes: 0d1ba0a Signed-off-by: Kir Kolyshkin <[email protected]>
It is superceded by golangci-lint, which has gofmt as one of the linters. Signed-off-by: Kir Kolyshkin <[email protected]>
Using it is no longer needed. Signed-off-by: Kir Kolyshkin <[email protected]>
Add .golangci.yml, podman.spec.rpkg, and non top-level Makefiles. Signed-off-by: Kir Kolyshkin <[email protected]>
f250fb7
to
6531170
Compare
OK, this one is ready, PTAL @edsantiago @lsm5 @Luap99 @vrothberg |
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.
Thanks, @kolyshkin! Much appreciated.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kolyshkin, lsm5, vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
@lsm5 can you, if it's not too hard, trigger a manual koji build? This is a big scary PR with lots of potential to break builds, and it would be nice to catch breakage early. (Clarification: good stuff, but still big and scary) |
@edsantiago sorry about the late response, the Thanks @kolyshkin !! |
This removes about 100 lines from the top-level Makefile.
Please review commit by commit, and see commit messages for details.
Note some of these changes are standing on the assumption that Go >= 1.16 is used (which is true since we use things like filepath.WalkDir which require go 1.16).