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/cmd/gotext: gotext extract fails on type incompatibility issues #29217

Open
fgm opened this issue Dec 13, 2018 · 1 comment
Open

x/text/cmd/gotext: gotext extract fails on type incompatibility issues #29217

fgm opened this issue Dec 13, 2018 · 1 comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@fgm
Copy link

fgm commented Dec 13, 2018

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

$ go version
go version go1.11.2 darwin/amd64

Does this issue reproduce with the latest release?

This is the latest release today.

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/fgm/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/fgm/src/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.2/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/fgm/src/OSInet/net/plusvite/kurz/src/code.osinet.fr/fgm/kurz/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0g/p780bc554njc4qj110_8rmbr0000gn/T/go-build677218822=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

What did you expect to see?

  • Nothing on the output
  • Directories locales/fr and locales/en created with an out.gotext.json file in each, ideally containing message definitions for NoError and Unimplemented strings.

What did you see instead?

  • On the first invocation:
    • errors on the output:
/Users/fgm/src/go/src/golang.org/x/text/internal/number/number.go:150:42: cannot convert t (variable of type golang.org/x/text/language.Tag) to golang.org/x/text/internal/language/compact.Tag
/Users/fgm/src/go/src/golang.org/x/text/feature/plural/plural.go:259:42: cannot convert t (variable of type golang.org/x/text/language.Tag) to golang.org/x/text/internal/language/compact.Tag
gotext: extract failed: : : couldn't load packages due to errors: golang.org/x/text/feature/plural, golang.org/x/text/internal/number
  • a locales/en-US directory created with an out.gotext.json file containing only this:
{
    "language": "en-US",
    "messages": null
}
  • On subsequent invocations:
    • nothing on the output
    • same locale/en-US directory with the same file in it
@fgm
Copy link
Author

fgm commented Dec 13, 2018

Note that on a local build of x/text at commit 17bcc04 (current master HEAD), the error does not appear, and 3 directories are created: the two expected ones, plus the unexpected en-US one. Messages files are similarly empty.

Strangely enough, on the locally built gotext, the -srclang attribute is not supported, although it is defined in the source in main.go line 39. Same for the update command.

@fgm fgm changed the title go/text: gotext update fails on type incompatibility issues x/text: gotext update fails on type incompatibility issues Dec 13, 2018
@gopherbot gopherbot added this to the Unreleased milestone Dec 13, 2018
@fgm fgm changed the title x/text: gotext update fails on type incompatibility issues x/text/cmd/gotext: gotext extract fails on type incompatibility issues Dec 13, 2018
@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants