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

warning 'TARGET_OS_MAC' is not defined when running make build #70819

Closed
celiala opened this issue Sep 28, 2021 · 2 comments · Fixed by #72686
Closed

warning 'TARGET_OS_MAC' is not defined when running make build #70819

celiala opened this issue Sep 28, 2021 · 2 comments · Fixed by #72686
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-server-and-security DB Server & Security

Comments

@celiala
Copy link
Collaborator

celiala commented Sep 28, 2021

Describe the problem

When running make build, I see this warning:

# github.com/shirou/gopsutil/cpu
vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go:13:5: warning: 'TARGET_OS_MAC' is not defined, evaluates to 0 [-Wundef-prefix=TARGET_OS_]

(See "Additional data" for more logging output/context)

To Reproduce

Run:

  1. make clean
  2. make build

I see 'TARGET_OS_MAC' warning

Environment:

  • CockroachDB version: (latest master)
  • Server OS: MacOS Big Sur, 11.6

Additional data / screenshots

✔ Db-console: Compiled successfully in 2.06m
touch pkg/ui/assets.ccl.installed
GOFLAGS= go build -o cockroach -v  -mod=vendor -tags 'make x86_64_apple_darwin20.6.0' -ldflags '-X github.com/cockroachdb/cockroach/pkg/build.typ=development -extldflags "" -X "github.com/cockroachdb/cockroach/pkg/build.tag=v21.2.0-alpha.00000000-4556-g55e2bcd4af" -X "github.com/cockroachdb/cockroach/pkg/build.rev=55e2bcd4affa844b8288da23407649d8f52a1e23" -X "github.com/cockroachdb/cockroach/pkg/build.cgoTargetTriple=x86_64-apple-darwin20.6.0"   -X "github.com/cockroachdb/cockroach/pkg/build.utcTime=2021/09/28 10:32:32"' ./pkg/cmd/cockroach
github.com/cockroachdb/cockroach/pkg/util/bufalloc
github.com/cockroachdb/cockroach/pkg/sql/sqlfsm
github.com/cockroachdb/cockroach/pkg/sql/rowinfra
github.com/cockroachdb/cockroach/pkg/sql/vtable
github.com/cockroachdb/cockroach/pkg/util/growstack
github.com/shurcooL/sanitized_anchor_name
github.com/cockroachdb/cockroach/pkg/col/colserde/arrowserde
github.com/cockroachdb/cockroach/pkg/util/system
github.com/cockroachdb/cockroach/pkg/util/syncutil/singleflight

...

github.com/cockroachdb/cockroach/pkg/workload/histogram
cloud.google.com/go/iam
golang.org/x/text/cases
github.com/prometheus/client_golang/prometheus/promhttp
github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl/denylist
github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl/idle
github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl/tenant
github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl/throttler
google.golang.org/api/option
google.golang.org/api/transport/internal/dca
github.com/cockroachdb/cockroach/pkg/kv/kvserver
golang.org/x/text/secure/precis
github.com/cockroachdb/cockroach/pkg/security/certmgr
github.com/cockroachdb/cockroach/pkg/cli/clierror
github.com/cockroachdb/cockroach/pkg/cli/clicfg
golang.org/x/term
github.com/Shopify/sarama
github.com/jcmturner/gokrb5/v8/service
github.com/cockroachdb/cockroach/pkg/sql/catalog/hydratedtables
github.com/knz/go-libedit/unix
google.golang.org/api/option/internaloption
# github.com/shirou/gopsutil/cpu
vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go:13:5: warning: 'TARGET_OS_MAC' is not defined, evaluates to 0 [-Wundef-prefix=TARGET_OS_]
google.golang.org/api/transport/http
github.com/shirou/gopsutil/process
github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl

...
@celiala celiala added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Sep 28, 2021
@blathers-crl blathers-crl bot added the T-server-and-security DB Server & Security label Sep 28, 2021
@stevendanna
Copy link
Collaborator

stevendanna commented Nov 4, 2021

It looks like this was fixed upstream shirou/gopsutil#1042

Note that this can also cause the linters we run with go vet -vettool (roachvet) to fail since we assume any output is a failure:

https://github.com/cockroachdb/cockroach/blob/master/pkg/testutils/lint/lint_test.go#L109-L111

stevendanna added a commit to stevendanna/cockroach that referenced this issue Nov 12, 2021
This dependency has unfortunately grown rather large and has a number
of changes since we last updated it.

Fixes cockroachdb#70819

Release note: None
craig bot pushed a commit that referenced this issue Nov 15, 2021
72686: update gopsutil to v3.21.10 r=knz a=stevendanna

This dependency has unfortunately grown rather large and has a number
of changes since we last updated it.

Fixes #70819

Release note: None

Co-authored-by: Steven Danna <danna@cockroachlabs.com>
@craig craig bot closed this as completed in 0ef045d Nov 15, 2021
@turion
Copy link

turion commented Jan 27, 2022

Is this going to be backported to 21.1? I.e. are the vendored versions bumped there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-server-and-security DB Server & Security
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants