Skip to content
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: unknown warning option '-Wno-nullability-completeness' #49913

Closed
KeeganRen opened this issue Dec 2, 2021 · 9 comments
Closed

runtime/cgo: unknown warning option '-Wno-nullability-completeness' #49913

KeeganRen opened this issue Dec 2, 2021 · 9 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@KeeganRen
Copy link

What version of Go are you using (go version)?

$ go version

go version go1.17.3 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/keegan/Library/Caches/go-build"
GOENV="/Users/keegan/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/keegan/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/keegan/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -gno-record-gcc-switches -fno-common"

What did you do?

My OS is macOS Big Sur 11.6,when i use go build:

go build

runtime/cgo
error: unknown warning option '-Wno-nullability-completeness'; did you mean '-Wno-delete-incomplete'? [-Werror,-Wunknown-warning-option]

I don‘t known how to solve this problem。

@bcmills
Copy link
Contributor

bcmills commented Dec 2, 2021

@bcmills
Copy link
Contributor

bcmills commented Dec 2, 2021

One thing isn't clear to me, though: why isn't this failure showing up on the Go project's own Big Sur builders?

I wonder if this is a regression in between macOS 11.0 (Nov. 17, 2020) and 11.6 (Sept. 13, 2021) — perhaps we haven't upgraded our builder images to track the current minor releases. (CC @golang/release)

@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin labels Dec 2, 2021
@bcmills
Copy link
Contributor

bcmills commented Dec 2, 2021

@KeeganRen, what version of the XCode toolchain do you have installed? (What does clang --version report?)

@gopherbot
Copy link

Change https://golang.org/cl/368634 mentions this issue: runtime/cgo: remove stdlib.h warning workaround on darwin

@bcmills bcmills added this to the Go1.18 milestone Dec 2, 2021
@bcmills bcmills changed the title unknown warning option '-Wno-nullability-completeness' runtime/cgo: unknown warning option '-Wno-nullability-completeness' Dec 2, 2021
@ianlancetaylor
Copy link
Contributor

Why is the compiler in the original report using -Wunknown-warning-option? That should never be the default. Are you turning it on explicitly?

@bcmills bcmills added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Dec 2, 2021
@bcmills
Copy link
Contributor

bcmills commented Dec 2, 2021

According to https://clang.llvm.org/docs/DiagnosticsReference.html#wunknown-warning-option, -Wunknown-warning-option is also enabled by default on Clang 13.

@KeeganRen
Copy link
Author

KeeganRen commented Dec 3, 2021

@KeeganRen, what version of the XCode toolchain do you have installed? (What does clang --version report?)

Hi, Boss @bcmills
My clang version is:

clang --version

clang version 3.5.0
Target: x86_64-apple-darwin20.6.0
Thread model: posix

llvm-g++ --version

Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@bcmills
Copy link
Contributor

bcmills commented Dec 3, 2021

Clang 3.5 was released in 2014. How did you come to have that installed alongside a modern 13.0.0 llvm-g++?

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Dec 3, 2021
@KeeganRen
Copy link
Author

@bcmills
I'm sorry, I compiled clang3.5 a few years ago, but i forget it... and I have recently upgraded my os ..

now I use clang13, it's ok.

thanks.

@bcmills bcmills closed this as completed Dec 6, 2021
gopherbot pushed a commit that referenced this issue Apr 22, 2022
CL 205457 added the flag -Wno-nullability-completeness to work
around a user-reported build breakage on macOS Catalina.

However, according to
https://golang.org/issue/35247#issuecomment-589115489 the root cause
of the breakage may be a toolchain misconfiguration on the host
(perhaps compiling the XCode stdlib using a Homebrew build of the
"clang" compiler?).

Adding an obscure warning flag to enable building stdlib.h with an
otherwise-broken toolchain seems clearly inappropriate to me.
If need be we can instead provide guidance to users on how to unbreak
their toolchain.

Updates #35247
Fixes #49913

Change-Id: I84def34e101bed7911d8d78a991a29095b8791fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/368634
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Dec 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants