-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
runtime/cgo: should not set -Werror #63903
Comments
The |
@cherrymui I have not, but here is another bug that has been marked as a duplicate and seems to show that -Werror is added to user code. |
The |
Ok, that makes sense. |
Yes and no. CGO_CFLAGS will be added to the C compilations, but not replacing the existing flags. I don't think we document/guarantee the order of flags that are passed. So if you set Just to add, from the build.log.xz, the |
I realize it isn't causing any compilation errors, but I'm getting flagged by our distro's qa just because it is there. Their documentation suggests dropping it for releases and keeping it for development. |
I don't think we currently have such a way. One way that I can think of is to have a wrapper script for the C compiler that scans the flags and drops Are you proposing we introduce a way to do that? |
I'm not sure that would be a good way to do it since we already set CC, so I'm going to bring one of our toolchain guys into this bug. @thesamesam What do you think? |
Policy-wise, I understand that some people may not agree with using |
The issue is it makes building Go (or something using Go, given this came up when building e.g. Podman) a pain when testing new compilers which may introduce new warnings. Those things may either not be appropriate to report to Go upstream (e.g. trying out an option which is unlikely to be suitable for widespread deployment) or need investigation first. |
@cherrymui Do you have any thoughts on this? |
Personally I don't have strong opinion about |
With
And setting |
Sorry, I thought I'd answered this. Yeah, if it's simply a new default warning with GCC or Clang, we should report it and get it fixed in Go if appropriate, but if we're e.g. customising the toolchain to enable our own stuff by default, that becomes more problematic. It's also then a pain for keeping older Go versions working. |
Not to miss the obvious, but I would expect that you could avoid the clang error with That said, I think that we should always put |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
This was reported by a user a while back for go 1.19, but looking at the source for 1.21.3 as indicated in the gentoo bug, the issue still exists.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The only thing I can provide is the comment in the gentoo bug linked above.
The distro policy is that we shouldn't be setting -Werror on any compilations.
What did you expect to see?
cgo seems to force -Werror into all compilations of c code.
What did you see instead?
This should not happen according to our distro policy linked in the bug because it causes compilations to break much more often than necessary.
I don't know if you are willing to make this change upstream or not, but if you aren't, can you please advise me as the maintainer on Gentoo with regard to making this change?
Thanks for your time,
William
The text was updated successfully, but these errors were encountered: