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/unsafe/assume-no-moving-gc for Go 1.21 support #1796

Merged
merged 2 commits into from
Jul 22, 2023
Merged

Bump go4.org/unsafe/assume-no-moving-gc for Go 1.21 support #1796

merged 2 commits into from
Jul 22, 2023

Conversation

stefanb
Copy link
Contributor

@stefanb stefanb commented Jul 22, 2023

Upgrades indirect dependancy go4.org/unsafe/assume-no-moving-gc for compatibility with upcoming Go 1.21: go4org/unsafe-assume-no-moving-gc@e7c30c7

Full upstream diff: go4org/unsafe-assume-no-moving-gc@c31fa08...e7c30c7

It is required via (now archived) module inet.af/netaddr that is used in some Deprecated functions of the public API.

Problem noticed in Homebrew/homebrew-core#134468
Log: https://github.com/Homebrew/homebrew-core/actions/runs/5618619997/job/15224884480?pr=134468#step:3:9232

==> /opt/homebrew/Cellar/gomplate/3.11.5/bin/gomplate --version
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 go1.21rc3 runtime. If you want to risk it, run with environment variable ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH="go1.21rc3" set. Notably, if go1.21rc3 adds a moving garbage collector, this program is unsafe to use.

I was able to reproduce the error locally with Go 1.21rc3, but afrer bumping the go4.org/unsafe/assume-no-moving-gc the error went away.

Upgrades indirect dependancy for compatibility with upcoming Go 1.21:
go4org/unsafe-assume-no-moving-gc@e7c30c7

It is required via (now archived) module inet.af/netaddr
@stefanb stefanb requested a review from hairyhenderson as a code owner July 22, 2023 05:57
@stefanb stefanb mentioned this pull request Jul 22, 2023
89 tasks
@stefanb stefanb changed the title Bump go4.org/unsafe/assume-no-moving-gc for compatibility with Go 1.21 Support Go 1.21 Jul 22, 2023
@hairyhenderson
Copy link
Owner

Thanks @stefanb, I appreciate this!

@hairyhenderson hairyhenderson enabled auto-merge (squash) July 22, 2023 18:07
@hairyhenderson hairyhenderson changed the title Support Go 1.21 Bump go4.org/unsafe/assume-no-moving-gc for Go 1.21 support Jul 22, 2023
@hairyhenderson hairyhenderson merged commit 86fc10b into hairyhenderson:main Jul 22, 2023
@stefanb stefanb deleted the go1.21 branch July 22, 2023 20:21
@mihaitodor
Copy link
Contributor

Thank you for fixing this! I bumped into it by installing gomplate via go install github.com/hairyhenderson/gomplate/v4/cmd/gomplate@latest:

> gomplate --help
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 go1.21 runtime. If you want to risk it, run with environment variable ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH="go1.21" set. Notably, if go1.21 adds a moving garbage collector, this program is unsafe to use.

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

Would it be possible to have a new tag released so go install can pick up this fix?

@hairyhenderson
Copy link
Owner

Hmm... if you're installing github.com/hairyhenderson/gomplate/v4 you shouldn't be seeing this (because of this PR)... I would expect this to happen with gomplate v3 though - can you double-check your go install command?

@mihaitodor
Copy link
Contributor

@hairyhenderson I am installing v4, but the issue is that @latest picks up the latest tagged release, namely v4.0.0-pre-0, which doesn't contain the fix. Try running the following:

> go install github.com/hairyhenderson/gomplate/v4/cmd/gomplate@latest
go: downloading github.com/hairyhenderson/gomplate/v4 v4.0.0-pre-0
...
some more output...
...

@hairyhenderson
Copy link
Owner

🤦‍♂️ I totally forgot v4.0.0-pre-0 existed... sorry about that. I'll tag a -1 soon!

@hairyhenderson
Copy link
Owner

Done: https://github.com/hairyhenderson/gomplate/releases/tag/v4.0.0-pre-1 - sorry for the confusion!

@mihaitodor
Copy link
Contributor

Thank you very much! ❤️

@erharb
Copy link

erharb commented Oct 5, 2023

Hmm... if you're installing github.com/hairyhenderson/gomplate/v4 you shouldn't be seeing this (because of this PR)... I would expect this to happen with gomplate v3 though - can you double-check your go install command?

@hairyhenderson I am currently using gomplate v3 and can confirm we just hit this after updating to go 1.21.1

go: downloading github.com/hairyhenderson/gomplate/v3 v3.11.5
...
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 go1.21 runtime. If you want to risk it, run with environment variable ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH="go1.21" set. Notably, if go1.21 adds a moving garbage collector, this program is unsafe to use.

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

Successfully merging this pull request may close these issues.

4 participants