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

Building beats exposes some warning for legacy OS X versions #24193

Closed
ruflin opened this issue Feb 23, 2021 · 5 comments · Fixed by elastic/golang-crossbuild#87
Closed

Building beats exposes some warning for legacy OS X versions #24193

ruflin opened this issue Feb 23, 2021 · 5 comments · Fixed by elastic/golang-crossbuild#87
Assignees
Labels

Comments

@ruflin
Copy link
Contributor

ruflin commented Feb 23, 2021

  • OS: Mac OS X 11.2.1
  • Beats version: master
  • Command: SNAPSHOT=true DEV=true PLATFORMS=darwin mage package (run here in x-pack/elastic-agent)

Running mage package outputs a few warnings in the command line. Some seem to be related to older OS X versions, namely 10.10. These are the log entries for heartbeat but it is seen for all Beats built for platform darwin:

>> Building heartbeat.yml for linux/amd64
>> Building heartbeat.reference.yml for linux/amd64
>> Building heartbeat.docker.yml for linux/amd64
>> golangCrossBuild: Building for darwin/amd64
>> Building using: cmd='build/mage-linux-amd64 golangCrossBuild', env=[CC=o64-clang, CXX=o64-clang++, GOARCH=amd64, GOARM=, GOOS=darwin, PLATFORM_ID=darwin-amd64]
# crypto/x509
ld: warning: object file (/tmp/go-build830650772/b117/_cgo_main.o) was built for newer OSX version (10.11) than being linked (10.10)
ld: warning: object file (/tmp/go-build830650772/b117/_x001.o) was built for newer OSX version (10.11) than being linked (10.10)
ld: warning: object file (/tmp/go-build830650772/b117/_x002.o) was built for newer OSX version (10.11) than being linked (10.10)
# github.com/elastic/beats/v7/x-pack/heartbeat
ld: warning: object file (/tmp/go-link-280111890/000018.o) was built for newer OSX version (10.11) than being linked (10.10)
ld: warning: object file (/tmp/go-link-280111890/000019.o) was built for newer OSX version (10.11) than being linked (10.10)
>> package: Building heartbeat type=tar.gz for platform=darwin/amd64
>> Testing package contents

I did not further investigate this but the reason I'm filing this as I'm worried at one stage this might break because of an old OS X version.

@ruflin ruflin added the Team:Elastic-Agent Label for the Agent team label Feb 23, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@ph
Copy link
Contributor

ph commented May 12, 2021

After discussion with @michel-laterman This seems to be required now to upgrade to the latest 1.16 version of golang.

@michel-laterman
Copy link
Contributor

In my attempts to update to go 1.16.4, the darwin crossbuild is failing with the error message

[2021-05-12T16:17:17.730Z] >> Building using: cmd='build/mage-linux-amd64 golangCrossBuild', env=[CC=o64-clang, CXX=o64-clang++, GOARCH=amd64, GOARM=, GOOS=darwin, PLATFORM_ID=darwin-amd64]

[2021-05-12T16:21:54.944Z] # github.com/elastic/beats/v7/metricbeat

[2021-05-12T16:21:54.945Z] /usr/local/go/pkg/tool/linux_amd64/link: running o64-clang failed: exit status 1

[2021-05-12T16:21:54.945Z] Undefined symbols for architecture x86_64:

[2021-05-12T16:21:54.945Z]   "_clock_gettime", referenced from:

[2021-05-12T16:21:54.945Z]       _runtime.walltime_trampoline in go.o

[2021-05-12T16:21:54.945Z] ld: symbol(s) not found for architecture x86_64

[2021-05-12T16:21:54.945Z] clang: error: linker command failed with exit code 1 (use -v to see invocation)

[2021-05-12T16:21:54.945Z] 

[2021-05-12T16:21:54.945Z] Error: running "go build -o build/golang-crossbuild/metricbeat-darwin-amd64 -buildmode pie -ldflags -s -X github.com/elastic/beats/v7/libbeat/version.buildTime=2021-05-12T16:17:15Z -X github.com/elastic/beats/v7/libbeat/version.commit=afc815dc5b58e87d53f5f9c1b1782242fc1c494b" failed with exit code 2

[2021-05-12T16:21:54.945Z] Error: failed building for darwin/amd64: exit status 2

[2021-05-12T16:21:54.945Z] failed building for darwin/amd64: exit status 2

[2021-05-12T16:21:54.945Z] Error: running "docker run --env EXEC_UID=1163 --env EXEC_GID=1164 -v /var/lib/jenkins/workspace/PR-25671-6-2c39d39a-bf82-41f9-9685-4f19c4a30f75/pkg/mod:/go/pkg/mod:ro --rm --env GOFLAGS=-mod=readonly --env MAGEFILE_VERBOSE= --env MAGEFILE_TIMEOUT= --env SNAPSHOT=true --env DEV=false -v /var/lib/jenkins/workspace/PR-25671-6-2c39d39a-bf82-41f9-9685-4f19c4a30f75/src/github.com/elastic/beats:/go/src/github.com/elastic/beats -w /go/src/github.com/elastic/beats/metricbeat docker.elastic.co/beats-dev/golang-crossbuild:1.16.4-darwin --build-cmd build/mage-linux-amd64 golangCrossBuild -p darwin/amd64" failed with exit code 1

[2021-05-12T16:21:54.945Z] github.com/elastic/beats/v7/dev-tools/mage.ParallelCtx

[2021-05-12T16:21:54.945Z] 	/var/lib/jenkins/workspace/PR-25671-6-2c39d39a-bf82-41f9-9685-4f19c4a30f75/src/github.com/elastic/beats/dev-tools/mage/common.go:511

[2021-05-12T16:21:54.945Z] github.com/elastic/beats/v7/dev-tools/mage.Parallel

[2021-05-12T16:21:54.945Z] 	/var/lib/jenkins/workspace/PR-25671-6-2c39d39a-bf82-41f9-9685-4f19c4a30f75/src/github.com/elastic/beats/dev-tools/mage/common.go:518

[2021-05-12T16:21:54.945Z] github.com/elastic/beats/v7/dev-tools/mage.CrossBuild

[2021-05-12T16:21:54.945Z] 	/var/lib/jenkins/workspace/PR-25671-6-2c39d39a-bf82-41f9-9685-4f19c4a30f75/src/github.com/elastic/beats/dev-tools/mage/crossbuild.go:174

[2021-05-12T16:21:54.945Z] github.com/elastic/beats/v7/dev-tools/mage/target/build.CrossBuild

[2021-05-12T16:21:54.945Z] 	/var/lib/jenkins/workspace/PR-25671-6-2c39d39a-bf82-41f9-9685-4f19c4a30f75/src/github.com/elastic/beats/dev-tools/mage/target/build/build.go:42

[2021-05-12T16:21:54.945Z] main.main.func29

[2021-05-12T16:21:54.945Z] 	/var/lib/jenkins/workspace/PR-25671-6-2c39d39a-bf82-41f9-9685-4f19c4a30f75/src/github.com/elastic/beats/metricbeat/mage_output_file.go:796

[2021-05-12T16:21:54.945Z] main.main.func12.1

[2021-05-12T16:21:54.945Z] 	/var/lib/jenkins/workspace/PR-25671-6-2c39d39a-bf82-41f9-9685-4f19c4a30f75/src/github.com/elastic/beats/metricbeat/mage_output_file.go:307

[2021-05-12T16:21:54.945Z] runtime.goexit

[2021-05-12T16:21:54.945Z] 	/var/lib/jenkins/workspace/PR-25671-6-2c39d39a-bf82-41f9-9685-4f19c4a30f75/.gvm/versions/go1.16.4.linux.amd64/src/runtime/asm_amd64.s:1371

[2021-05-12T16:21:54.945Z] ../dev-tools/make/mage.mk:69: recipe for target 'crosscompile' failed

[2021-05-12T16:21:54.945Z] make: *** [crosscompile] Error 1

[2021-05-12T16:21:54.945Z] make: Leaving directory '/var/lib/jenkins/workspace/PR-25671-6-2c39d39a-bf82-41f9-9685-4f19c4a30f75/src/github.com/elastic/beats/metricbeat'

script returned exit code 2

seen here https://beats-ci.elastic.co/blue/organizations/jenkins/Beats%2Fbeats/detail/PR-25671/6/pipeline/6405/
The release notes for go 1.16 state it's the latest version that will work with macos 10.12 https://golang.org/doc/go1.16#darwin
So we should update our crossbuild image to use 10.13+

@ph
Copy link
Contributor

ph commented May 12, 2021

That seems safe to update to 10.13 this is an old version. I think @urso you were right on this update there a few things that is required to do.

@michel-laterman
Copy link
Contributor

Just to note we are going to use the 10.14 SDK and have increased the min version of MacOS to 10.14.
We may need to report this as a breaking change for beats + whatever other projects share the golang-crossbuild image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants