-
Notifications
You must be signed in to change notification settings - Fork 4.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
Update to go 1.23.2. #41087
base: main
Are you sure you want to change the base?
Update to go 1.23.2. #41087
Conversation
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
buildkite test this |
@rowlandgeoff Any ideas on why this is only to fail to build on ARM with the golang-crossbuild? |
Not a clue, that's outside my knowledge. @v1v, any ideas here? |
I know very little about the Beats build system and the CI Buildkite pipelines, however
That's somehow related to the wrong architecture in the runner versus the architecture that was built for, to list one of them, see this as it contains some details about some other possible errors. If you use |
This pull request is now in conflicts. Could you fix it? 🙏
|
I think I know what's happening here. I've been casually playing around with BuildKite (BK) and crossbuilding for some time. Here cross compiling is failing on a linux/arm64 host. Related issues for Go 1.23.{0,1,2}, supposed to be fixed in Go 1.23.3+:
To check, I tried with Go 1.22.8, it worked fine. See: 4d8ca5c (all checks passed) as part of this #41140 But cross compile works where target is linux/arm64 and the host is linux/amd64. $ PLATFORMS=linux/arm64 PACKAGES=tar.gz mage -v package
...
...
docker run \
--env EXEC_UID=1000 \
--env EXEC_GID=1000 \
-v /home/ubuntu/.gvm/pkgsets/go1.23.2/global/pkg/mod:/go/pkg/mod:ro \
--env DEV=false \
--rm \
--env GOFLAGS="-mod=readonly -buildvcs=false" \
--env MAGEFILE_VERBOSE=true \
--env MAGEFILE_TIMEOUT= \
--env SNAPSHOT=false \
-v /home/ubuntu/beats:/go/src/github.com/elastic/beats \
-w /go/src/github.com/elastic/beats/metricbeat \
docker.elastic.co/beats-dev/golang-crossbuild:1.23.2-arm \
--build-cmd "build/mage-linux-amd64 golangCrossBuild" \
--platforms linux/arm64 For example, this will work, local as well as CI when the host is linux/amd64. When the host is linux/arm64 the But I noticed one thing in our BK pipeline: So, if you see the BK pipeline for metricbeat and others (except agentbeat):
Do note that we are cross-compiling for linux/arm64 here as well.
But still we have a step for Package for arm64. See:
Here we face the failure when using Go 1.23.2 most probably because of the aforementioned issue with Go 1.23.x i.e., trying to cross compile on a linux/arm64 targeting linux/arm64. But see how it is done for
Single step for cross-building for the required platforms. So, my question shouldn't we improve the pipelines to do the cross-compiling in one step like we are doing for agentbeat. In this PR as well I made some improvements in BK pipeline for agentbeat by removing the commands that seemed necessary. So, could you also check if we even need the additional step for metricbeat, packetbeat, etc. Is it intentional to have the "Packaging Linux arm64" step because of some reason? |
Thank you so much for the detailed reasoning behind why this was failing. I was shocked that a simple update of golang would cause the error, but it being an issue with upstream golang makes a lot of sense.
@rowlandgeoff Would be best to answer that information, or some others from that team. I do not know, I was just trying to update to go 1.23. |
Do you think that this will also solve the issue raised in #40755 (comment) ? (Also tested in #41129) ? |
@blakerouse Given the issues with upstream Golang and that we're probably ~3 weeks away from a |
Support for QEMU as a platform in Go has always been limited and generally operates on a best-effort basis. I encountered numerous issues when implementing runtime and atomic operations for various architectures due to QEMU's limitations. If this is indeed a QEMU issue, it would be helpful to clearly identify which specific issue it is, so we can ensure it gets properly addressed. Additionally, I wonder if it makes sense to set up daily or weekly gotip builds of golang-crossbuild. This would allow us to detect breaking changes and test cutting-edge features without waiting for a new release. |
Proposed commit message
Update to the latest go 1.23.2.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.