-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: 'go mod tidy' breaks our build #45223
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
Comments
I suppose I could prepare a demo repo for this. |
It's very likely we're using this wrong. I tried to prepare a repro at https://github.com/tailscale/go-mod-tidy-broken but now I'm hitting something else I don't understand:
But that is literally the only version: https://pkg.go.dev/inet.af/netstack@v0.0.0-20210317161235-a1bf4e56ef22?tab=versions |
There are no go files in the root of the
|
From the first set of error messages, it looks like So the question is why
This package won't actually get built because of the build tag. If that doesn't fix the issue, there are a couple other edge cases: when |
@seankhliao, doh! Thanks. My attempt at a minimal repro wasn't quite accurate. That error message could've been a bit more helpful, but oh well. @jayconrod, thanks for the link! I'd been splitting all our package main binaries in two halves (but apparently missed some) so we could empty import the package half. I didn't think using a build tag to hide it from the compiler but not from Anyway, sorry for the distraction! I think this'll be enough to get us working again. Still not exactly sure how we got into this state. I suspect Go 1.15 modifying the go.mod files for us papered over some of this previously. |
go mod tidy
breaks our build.Does tidy not work with
replace
directives? Our closed-source mono/megarepo is a Go module with git submodule directories of a few other [all open source] Go repos. (Yes, painful, and we all wish there was something less terrible.)In any case, I hear that
go mod tidy
shouldn't be able to break our builds, and yet:A build of a
tailscale.com
target builds here, from theoss/
replace directory:And then
go mod tidy
works:Which results in changes:
And those changes break our build:
This should be reproducible without our closed-source repo since all the git submodules are public:
The revs of each submodule is currently:
The text was updated successfully, but these errors were encountered: