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: generated files keep changing when there is no code change #33552

Closed
linggao opened this issue Aug 8, 2019 · 2 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@linggao
Copy link

linggao commented Aug 8, 2019

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

$ go version
1.11.4 linux/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build093772979=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Run gotext to create a message catalog.
gotext -srclang=en update -out=catalog/catalog.go -lang=en,el

What did you expect to see?

catalog/catalog.go should stay the same if nothing is changed.
locales/en/out.gotext.json and locales/el/out.gotext.json files stays the same if no code has been changed.

What did you see instead?

Index value for a string in the messageKeyToIndex in catalog/catalog.go keeps changing every time gotext is run with the same code. This makes development process hard when there are multiple developers and when this files is checked in a repository. We hope that if there are no message changes, this file stays the same.
locales/en/out.gotext.json and locales/el/out.gotext.json files also changed a lot when there is no code changes.

@gopherbot gopherbot added this to the Unreleased milestone Aug 8, 2019
@linggao linggao changed the title x/cmd/gotext generated catalog.go file x/cmd/gotext generated files keep changing when there is no code change Aug 8, 2019
@dmitshur dmitshur changed the title x/cmd/gotext generated files keep changing when there is no code change x/text/cmd/gotext: generated files keep changing when there is no code change Aug 12, 2019
@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 12, 2019
@gopherbot
Copy link

Change https://golang.org/cl/207280 mentions this issue: message/pipeline: sort maps to generate predictable output

@gopherbot
Copy link

Change https://golang.org/cl/207281 mentions this issue: message/pipeline: sort maps to generate predictable output

@golang golang locked and limited conversation to collaborators Nov 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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