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

make test fails with GO 1.23 #7696

Open
amaury-d opened this issue Sep 3, 2024 · 7 comments
Open

make test fails with GO 1.23 #7696

amaury-d opened this issue Sep 3, 2024 · 7 comments
Labels

Comments

@amaury-d
Copy link

amaury-d commented Sep 3, 2024

Thanos, Prometheus and Golang version used:

thanos, version 0.37.0-dev (branch: main, revision: dfeaf6e258bca159c39fa6f7dadba51c27ff06b0)
  build date:       20240903-12:16:12
  go version:       go1.23.0
  platform:         darwin/arm64

Object Storage Provider:

What happened:

❯ make test
(re)installing /Users/adecreme/git/thanos/.bin/alertmanager-v0.24.0
# github.com/prometheus/alertmanager/cmd/alertmanager
link: golang.org/x/net/internal/socket: invalid reference to syscall.recvmsg
make: *** [.bingo/Variables.mk:24: /Users/adecreme/git/thanos/.bin/alertmanager-v0.24.0] Error 1

What you expected to happen:
make test success

How to reproduce it (as minimally and precisely as possible):

  • Upgrade to go 1.23
  • make build test

Full logs to relevant components:

Logs

Makefile:358: update target 'check-git' due to: target is .PHONY
test -x /opt/homebrew/bin//git || (echo >&2 "No git executable binary found at /opt/homebrew/bin//git."; exit 1)
.bingo/Variables.mk:22: update target '/Users/adecreme/git/thanos/.bin/alertmanager-v0.24.0' due to: target does not exist
# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
echo "(re)installing /Users/adecreme/git/thanos/.bin/alertmanager-v0.24.0"
(re)installing /Users/adecreme/git/thanos/.bin/alertmanager-v0.24.0
cd .bingo/ && GOWORK=off /opt/homebrew/bin//go build -mod=mod -modfile=alertmanager.mod -o=/Users/adecreme/git/thanos/.bin/alertmanager-v0.24.0 "github.com/prometheus/alertmanager/cmd/alertmanager"
# github.com/prometheus/alertmanager/cmd/alertmanager
link: golang.org/x/net/internal/socket: invalid reference to syscall.recvmsg
make: *** [.bingo/Variables.mk:24: /Users/adecreme/git/thanos/.bin/alertmanager-v0.24.0] Error 1

Anything else we need to know:

  • Caused by linker update in golang 1.23: https://go.dev/doc/go1.23#linker
  • I was able to launch the tests by bumping to:
    • alertmanager 0.25.1
    • minio v0.0.0-20240903063353-69258d5945c2
    • prometheus v0.37.9
      but they ended in errors
Copy link

dosubot bot commented Sep 3, 2024

Hey there, @amaury-d! I'm here to help you with any bugs, questions, or becoming a contributor. Let's squash those bugs together!

The make test command fails with Go 1.23 due to an invalid reference to syscall.recvmsg in the Alertmanager. This issue arises because the go.mod file specifies Go version 1.22.0, and the syscall package has undergone changes in Go 1.23.

To resolve this issue, update the Go version in the go.mod file to 1.23.0 and ensure all dependencies are compatible with Go 1.23. Here is the relevant part of the go.mod file that needs to be updated:

module github.com/thanos-io/thanos

go 1.23.0

toolchain go1.23.0

After updating the Go version, run go mod tidy to update the dependencies and then try running make test again [1].

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the bug label Sep 3, 2024
amaury-d added a commit to amaury-d/thanos that referenced this issue Sep 3, 2024
Signed-off-by: Amaury Decrême <[email protected]>
@mehran-prs
Copy link

If the @dosu comment didn't resolve your issue, update the net library: go get -u golang.org/x/net.

@lachruzam
Copy link
Contributor

another workaround to start tests: add -ldflags="-checklinkname=0" to alertmanager, minio and prometheus builds in .bingo/Variables.mk

@fpetkovski
Copy link
Contributor

This should be fixed on main after bumping go and deps here #7796

Copy link

dosubot bot commented Oct 14, 2024

Updating the golang.org/x/net library to the latest version can help resolve compatibility issues. The current version used in Thanos is v0.30.0 [1][2]. You can update it by running:

go get -u golang.org/x/net

After updating, run go mod tidy to clean up the go.mod and go.sum files, and then try running make test again.

To continue talking to Dosu, mention @dosu.

@lachruzam
Copy link
Contributor

@fpetkovski In my case, I tried to build a version that already had #7796 merged.
The build failed for alertmanager, minio and prometheus. If I'm not missing something then deps weren't bump here.

@fpetkovski
Copy link
Contributor

Maybe this should help #7833.

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

No branches or pull requests

4 participants