-
Notifications
You must be signed in to change notification settings - Fork 3.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
build: cockroachdb build is broken on master
#67216
Comments
Here's the upstream PR: bufbuild/buf#363 I'll fork the upstream repo inside the cockroachdb org and revendor that, just in case. |
I don’t think the build directive is bogus - it has been working for years, can you explain what the issue is?
|
I think the issue is that a unix platform which is not darwin, eg FreeBSD, doesn’t match either “linux” or “darwin” in the _unix.go tagged file and of course doesn’t match “windows” either in the _windows.go file, so neither end up matching. |
I've checked that my upstream PR fixes this. Either it's accepted upstream, or we can use a fork. The added value of buf is too good to revert #66913. |
I think that's the issue bufbuild/buf#362 (comment) however this was intentional in each of these cases - we purposefully meant to limit to darwin and linux for each of these build tags. Each of these build tags protected some OS-specific code that we've only checked to work in darwin and linux, and we want to be opt-in, not opt-out in these situations. I don't think the fix is There's four places:
All solvable, and quickly. We just don't want to do an opt-out |
Just as an example of the opt-in strategy being used elsewhere: https://github.com/golang/go/blob/master/src/os/sys_unix.go#L6 |
Although not the cause of the issue here, another thing to note as we're going through this as: you might want to reconsider your overall tool vendoring strategy here https://github.com/cockroachdb/cockroach/blob/master/pkg/cmd/import-tools/main.go as we've seen this cause active issues with Golang tool usage (not specifically Tools have their own individual dependency pins - as a contrived example, With the "import Golang tools with blank imports and a We solve this by effectively doing:
But there are different strategies around this. |
All the Unix systems supported by Go are compatible with the code already in buf. There's absolutely no variation in these particular features. |
I don't think this can be said without further investigation - for example, is the filename for stdin always named |
They are the same for all Unix systems. The js and wasm platforms do not support file Io so many other things in buf are broken for them. Also look the change I'm proposing is making things work that ought to work and didn't work before. You're pulling strawmen using platforms where the buf binary can't even run today. What is the precise conversation we're having? |
I don't think that's the case - fundamentally, saying that expanding the build tags in these cases to be opt-out is removing a check in the code that is preventing builds on platforms that are unsupported - many other Golang programs including the Golang source itself do the exact same opt-in style for OS-specific code. We're not going to change to opt-out build tags and remove this safety. The issue you're having is that you are building Buf on platforms we haven't supported yet. We're actively stopping what we're doing and going through the issues I laid out above to come up with a solution for you, the solution of which might be that we expect this to build on unix-like, but that it's not offically supported. |
If that is too inconvenient on your side, we're comfortable forking |
We almost have this solved in a way we're comfortable with for now, see bufbuild/buf#364 for the first half. We'll have another PR up in a short bit. |
the first PR took care of some of the errors indeed.
|
Yes - as mentioned on that PR, and in the comment above, we are doing that in a separate PR that will be up in a short bit. |
amazing, thank you so much for your help here |
This is fixed on |
As a follow up though, I would open a different issue and consider the implications of #67216 (comment) but this is very separate from this. |
Thank you very much for your high-quality and fast response on this. |
No problem - happy to help - let us know if there are any other issues |
This reduces the impact of using buf on our dependency closure, which was significant. It also avoids potential issues with building buf given our own internal dependency constraints. This has caused issues (including crashes!) in the past. See cockroachdb/cockroach#67216 (comment) for more discussion on using tool dependencies generally, and bufbuild/buf#52 for an example of where this sort of thing caused an issue for a user.
This reduces the impact of using buf on our dependency closure, which was significant. It also avoids potential issues with building buf given our own internal dependency constraints. This has caused issues (including crashes!) in the past. See cockroachdb/cockroach#67216 (comment) for more discussion on using tool dependencies generally, and bufbuild/buf#52 for an example of where this sort of thing caused an issue for a user.
This reduces the impact of using buf on our dependency closure, which was significant. It also avoids potential issues with building buf given our own internal dependency constraints. This has caused issues (including crashes!) in the past. See cockroachdb/cockroach#67216 (comment) for more discussion on using tool dependencies generally, and bufbuild/buf#52 for an example of where this sort of thing caused an issue for a user.
* Install buf with go install This reduces the impact of using buf on our dependency closure, which was significant. It also avoids potential issues with building buf given our own internal dependency constraints. This has caused issues (including crashes!) in the past. See cockroachdb/cockroach#67216 (comment) for more discussion on using tool dependencies generally, and bufbuild/buf#52 for an example of where this sort of thing caused an issue for a user. * Upgrade buf version We should migrate to v1 sooner rather than later, as it has some breaking changes from v0. * Change buf lint/breaking commands These commands were moved up one level for v1 * Migrate to buf.yaml to v1 * Remove unused imports These were uncovered by using "buf lint". * Use buf v1.3.1 * Depend on googleapis and grpc-gateway via BSR * Switch to buf for proto generation * Remove third party dependency * Remove unused tools and scripts * Move local protos up one level * Temporarily don't fail on breaking changes * Generate CI config * Fix generation of controller.json * Replace use of deprecated flag * Remove unused import, regenerate files * Remove temporary skipping over breaking check
cc @bufdev @dt
I can't build CockroachDB any more since #66913 went in.
I'm going to send a PR upstream (the
+build
directive in there is bogus) but if it doesn't get merged quick, I'll revert #66913.The text was updated successfully, but these errors were encountered: