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

x/text: gotext not compatible with Go-1.20.1 #58751

Closed
croessner opened this issue Feb 27, 2023 · 6 comments
Closed

x/text: gotext not compatible with Go-1.20.1 #58751

croessner opened this issue Feb 27, 2023 · 6 comments
Milestone

Comments

@croessner
Copy link

What version of Go are you using (go version)?

$ go version

go version go1.20.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes, the problem started by upgrading 1.19.x to 1.20.1

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/croessner/Library/Caches/go-build"
GOENV="/Users/croessner/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/croessner/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/croessner/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.20.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/croessner/GoLandProjects/authserv/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/1p/ps03vl3150d7nsm9ynkxkbmc0000gn/T/go-build3048905333=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

After upgrading Go, I also did:

  1. go get -u golang.org/x/text/cmd/gotext
  2. go mod tidy
  3. go mod vendor
  4. Change into subfolder server, where the main go code lives.
  5. Call go generate

What did you expect to see?

As I added new strings, I expected to see that texts for German and French would be missing and that the catalog.go file should have been updated.

What did you see instead?

/usr/local/go/src/runtime/debuglog.go:296:20: StringData not declared by package unsafe
/usr/local/go/src/runtime/heapdump.go:159:37: StringData not declared by package unsafe
/usr/local/go/src/runtime/heapdump.go:202:32: StringData not declared by package unsafe
/usr/local/go/src/runtime/heapdump.go:204:32: StringData not declared by package unsafe
/usr/local/go/src/runtime/proc.go:658:16: String not declared by package unsafe
/usr/local/go/src/runtime/runtime.go:115:33: StringData not declared by package unsafe
/usr/local/go/src/runtime/string.go:105:17: String not declared by package unsafe
/usr/local/go/src/runtime/string.go:115:16: String not declared by package unsafe
/usr/local/go/src/runtime/string.go:121:39: StringData not declared by package unsafe
/usr/local/go/src/runtime/string.go:163:16: String not declared by package unsafe
/usr/local/go/src/runtime/string.go:268:16: String not declared by package unsafe
/usr/local/go/src/runtime/type.go:465:16: String not declared by package unsafe
/usr/local/go/src/runtime/type.go:474:16: String not declared by package unsafe
/usr/local/go/src/internal/reflectlite/type.go:346:16: String not declared by package unsafe
/usr/local/go/src/internal/reflectlite/type.go:355:16: String not declared by package unsafe
/usr/local/go/src/strings/builder.go:48:16: String not declared by package unsafe
/usr/local/go/src/strings/builder.go:48:30: SliceData not declared by package unsafe
/usr/local/go/src/strings/clone.go:27:16: String not declared by package unsafe
/usr/local/go/src/net/netip/netip.go:343:28: cannot convert slice (variable of type []byte) to [4]byte
/usr/local/go/src/net/netip/netip.go:345:30: cannot convert slice (variable of type []byte) to [16]byte
/usr/local/go/src/net/netip/netip.go:1013:27: cannot convert b (variable of type []byte) to [4]byte
/usr/local/go/src/net/netip/netip.go:1016:29: cannot convert b (variable of type []byte) to [16]byte
/usr/local/go/src/net/netip/netip.go:1019:29: cannot convert b[:16] (value of type []byte) to [16]byte
/usr/local/go/src/reflect/type.go:532:16: String not declared by package unsafe
/usr/local/go/src/reflect/type.go:541:16: String not declared by package unsafe
/usr/local/go/src/crypto/x509/internal/macos/corefoundation.go:65:29: SliceData not declared by package unsafe
/usr/local/go/src/crypto/x509/internal/macos/corefoundation.go:76:29: StringData not declared by package unsafe
/usr/local/go/src/os/file.go:246:27: StringData not declared by package unsafe
gotext: extract failed: : : couldn't load packages due to errors: reflect, os, internal/reflectlite and 4 more
hydra.go:3: running "gotext": exit status 1

It seems that gotext needs updates for Go 1.20.x

@gopherbot gopherbot added this to the Unreleased milestone Feb 27, 2023
@seankhliao
Copy link
Member

Duplicate of #58737

@seankhliao seankhliao marked this as a duplicate of #58737 Feb 27, 2023
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2023
@croessner
Copy link
Author

I followed the ticket #58737 , but the problem is not solved!

I have updated all modules and the problem persists. Please re-open this issue.

@seankhliao
Copy link
Member

Please include a self contained reproducer for what you did, with specific versions ("updated" is also unclear).
Your original report says you ran "go generate" which is not very useful to us without your code.

@croessner
Copy link
Author

You can find my code at https://gitlab.roessner-net.de/croessner/authserv/-/tree/features

I have one file, which is in server/hydra.go that uses translations. There is also the go generate line:

//go:generate gotext -srclang=en update -out=catalog.go -lang=en,de,fr

When I run "go generate" in this folder, the errors appear as shown in this issue.

You can see the go.mod and go.sum and vendor files. It should have all latest versions. Does this help a little bit? :-)

@seankhliao
Copy link
Member

This was only fixed on master, x/text will get a new tag in the next cycle of upgrades

ilharp added a commit to koishijs/koishi-desktop that referenced this issue Mar 21, 2023
@jeffphp
Copy link

jeffphp commented Sep 5, 2023

@croessner did you find any workaround?. I'm using Go-1.21 using Homebrew on Mac (from 1.19) and I have the same exact problem.

Edit: In the end, I used the following command line that fixed the issue :
go install golang.org/x/text/cmd/gotext@master

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

5 participants
@croessner @jeffphp @gopherbot @seankhliao and others