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

Bump go4.org/intern to fix build on go1.21 #6609

Merged
merged 1 commit into from
Aug 13, 2023

Conversation

jonjohnsonjr
Copy link
Contributor

Trying to build on go1.21 fails with a scary error about the GC moving heap objects. This is due to a conservative assumption around future go releases in go4.org/unsafe/assume-no-moving-gc

A more recent version actually checks with the go runtime, see:

https://go-review.googlesource.com/c/go/+/498121

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Bumped go4.org/intern to go4org/intern@6c62f75

Verification

At HEAD:

$ git rev-parse HEAD
bf5c275097a5917498a036db8603315fd5849c31

$ gotip run ./cmd/thanos help
go: downloading go4.org/intern v0.0.0-20220617035311-6925f38cc365
go: downloading go4.org/unsafe/assume-no-moving-gc v0.0.0-20230209150437-ee73d164e760
panic: Something in this program imports go4.org/unsafe/assume-no-moving-gc to declare that it assumes a non-moving garbage collector, but your version of go4.org/unsafe/assume-no-moving-gc hasn't been updated to assert that it's safe against the devel go1.22-ac64a362 Sat Aug 12 03:56:58 2023 +0000 runtime. If you want to risk it, run with environment variable ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH="devel go1.22-ac64a362 Sat Aug 12 03:56:58 2023 +0000" set. Notably, if devel go1.22-ac64a362 Sat Aug 12 03:56:58 2023 +0000 adds a moving garbage collector, this program is unsafe to use.

goroutine 1 [running]:
go4.org/unsafe/assume-no-moving-gc.init.0()
	/Users/jonjohnson/go/pkg/mod/go4.org/unsafe/[email protected]/untested.go:25 +0x1a0
exit status 2

With my change:

$ git rev-parse HEAD
33bd69f8fe6e0bf582d551f7cecd25a071f22217

$ gotip run ./cmd/thanos help 2>&1 | head
usage: thanos [<flags>] <command> [<args> ...]

A block storage based long-term storage for Prometheus.

Flags:
  -h, --help               Show context-sensitive help (also try --help-long and
                           --help-man).
      --log.format=logfmt  Log format to use. Possible options: logfmt or json.
      --log.level=info     Log filtering level.
      --tracing.config=<content>

Trying to build on go1.21 fails with a scary error about the GC moving
heap objects. This is due to a conservative assumption around future go
releases in go4.org/unsafe/assume-no-moving-gc

A more recent version actually checks with the go runtime, see:

https://go-review.googlesource.com/c/go/+/498121

Signed-off-by: Jon Johnson <[email protected]>
Copy link
Member

@saswatamcode saswatamcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@saswatamcode saswatamcode merged commit 266a760 into thanos-io:main Aug 13, 2023
14 checks passed
harsh-ps-2003 pushed a commit to harsh-ps-2003/thanos that referenced this pull request Aug 22, 2023
Trying to build on go1.21 fails with a scary error about the GC moving
heap objects. This is due to a conservative assumption around future go
releases in go4.org/unsafe/assume-no-moving-gc

A more recent version actually checks with the go runtime, see:

https://go-review.googlesource.com/c/go/+/498121

Signed-off-by: Jon Johnson <[email protected]>
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 this pull request may close these issues.

2 participants