-
Notifications
You must be signed in to change notification settings - Fork 519
Build: Use go tool and separate module file, go run to remove some build scripts
#6491
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
Conversation
go tool and separate module file, tool.mod for stringergo tool and separate module file, tool.mod for stringer
|
This is a good start, I tried making a tools.mod too at one point but gave up, because go-swagger broke backwards compatibility when they updated for Go versions ... fixed in go-swagger/go-swagger#3239 but now we're using github.com/algorand/go-swagger until their next official release. So having a tools.mod should work now I think. There might be dependency clashes with golangci-lint because it imports so many other packages, we might want to just run that with a make target that runs |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6491 +/- ##
==========================================
- Coverage 47.57% 47.42% -0.16%
==========================================
Files 666 659 -7
Lines 88478 88417 -61
==========================================
- Hits 42096 41932 -164
- Misses 43618 43712 +94
- Partials 2764 2773 +9 ☔ View full report in Codecov by Sentry. |
go tool and separate module file, tool.mod for stringergo tool and separate module file, tool.mod for stringer
What became of that? We skipped 1.24 for 1.25 but didn't make all the extra changes? |
051fb3a to
cb84f14
Compare
`go tool` is nice for managing versions in the tool.mod file, but there's no point when you have excatly one call to the tool.
|
This is reviewable now, but I took out the caching of @cce ideas? |
go tool and separate module file, tool.mod for stringergo tool and separate module file, go run to remove some build scripts
|
I think the go mod and build caching we're getting already from setup-go should be helping caching the compilation of gotestsum and its dependencies already? |
I'll try to figure that out, but if it is, why did we have explicit gotestsum caching tasks in CI? I would think that just installing/compiling Go would not cache the compilation of these tools unless they've been invoked. |
|
The entire go build cache and mod cache directories are saved and restored at the beginning and end of CI jobs ... so eventually it should make it in there. I added the gotestsum caching to CI in #6397 because the additional step of running install_buildtools.sh just to get that one tool was slowing down the builds, especially since we only needed one of the several tools installed in there. So I made it its own step and added caching for good measure. |
Oh that's true since not all jobs are invoking gotestsum, I guess it might not be guaranteed to be cached in the go build/mod cache ... but that's why I added a |
For
go toolusage, it uses-modfileand new filestool.modandtool.sumso that build dependency versions are clear, but not mixed with runtime dependencies.Tools that are invoked from a single place, (
msgp,golangci-lint,swagger) are handled withgo runwhich avoids mingling dependencies for different tools intool.mod, but still only puts the version in one place.Summary
Test Plan