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

Incompatible with Go 1.23, which doesn't allow //go:linkname to internal symbols, including to runtime package #1

Closed
stefanb opened this issue Jun 25, 2024 · 3 comments

Comments

@stefanb
Copy link

stefanb commented Jun 25, 2024

While testing Go 1.23 rc1 in

there was an error:

go install -ldflags '-X github.com/pulumi/pulumi/pkg/v3/version.Version=v3.120.0' github.com/pulumi/pulumi/pkg/v3/cmd/pulumi
# github.com/pulumi/pulumi/pkg/v3/cmd/pulumi
link: github.com/pgavlin/text/internal/bytealg: invalid reference to internal/bytealg.MaxLen

Go 1.23 no longer allows //go:linkname * runtime.* link instructioins, see

It is used several times in this module, see:

https://github.com/search?q=repo%3Apgavlin%2Ftext%20linkname&type=code

@pgavlin
Copy link
Owner

pgavlin commented Aug 13, 2024

Well, this is unfortunate. Thanks for pointing this out. I'll have to look into what to do here.

@pgavlin
Copy link
Owner

pgavlin commented Aug 14, 2024

Yeah this is going to take some work to fix.

The only feasible option I see is to vendor in the contents of internal/bytealg from the runtime. That will require some edits to the assembly versions of some functions, as they all use the runtime-internal ABI, which is disallowed outside of the runtime.

As a short-term workaround, this package can be used with go1.23 by adding -checklinkname=0 to -ldflags when building.

brandonpollack23 added a commit to brandonpollack23/pulumi that referenced this issue Aug 20, 2024
As per pgavlin/text#1, a workaround for this so go 1.23 works is this ld
flag -checklintname=0 until they get around to fixing it.
brandonpollack23 added a commit to brandonpollack23/pulumi that referenced this issue Aug 20, 2024
As per pgavlin/text#1, a workaround for this so go 1.23 works is this ld
flag -checklintname=0 until they get around to fixing it.
@pgavlin
Copy link
Owner

pgavlin commented Aug 21, 2024

Fixed by b51d099.

@pgavlin pgavlin closed this as completed Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants