BaiduPCS-Go icon indicating copy to clipboard operation
BaiduPCS-Go copied to clipboard

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

Open stefanb opened this issue 1 year ago • 4 comments
trafficstars

While testing Go 1.23 rc1 in

  • https://github.com/Homebrew/homebrew-core/pull/175310

there was an error:

  # github.com/qjfoidnh/BaiduPCS-Go
  link: github.com/qjfoidnh/BaiduPCS-Go/pcsutil/cachepool: invalid reference to runtime.rawbyteslice

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

  • https://tip.golang.org/doc/go1.23#linker
  • https://github.com/golang/go/issues/67401

It is used in https://github.com/search?q=repo%3Aqjfoidnh%2FBaiduPCS-Go%20linkname&type=code

stefanb avatar Jun 26 '24 05:06 stefanb

Build is still failing with Go 1.23 rc2

stefanb avatar Jul 18 '24 21:07 stefanb

maybe you can try "ldflags=-checklinkname=0" if you just want to run.

Ted-bug avatar Jul 30 '24 03:07 Ted-bug

Thanks for the workaround. I don't need to run it just for myself, I encountered this problem when trying to build it with upcoming Go 1.23 and giving you a heads-up to find a solution before it annoys more users.

stefanb avatar Jul 30 '24 19:07 stefanb

Was this fixed in recent https://github.com/qjfoidnh/BaiduPCS-Go/commit/a1d664808c4c60c348f51f9ed3726c4c27faec25 and just needs a release?

stefanb avatar Dec 15 '24 10:12 stefanb