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: bazel 0.22.0 fails with "cycle in dependency graph" error #30384

Closed
mqy opened this issue Feb 25, 2019 · 3 comments
Closed

x/text: bazel 0.22.0 fails with "cycle in dependency graph" error #30384

mqy opened this issue Feb 25, 2019 · 3 comments

Comments

@mqy
Copy link

mqy commented Feb 25, 2019

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

$ go version
1.11.4

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="/Users/mqy/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/mqy/data/gopath"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/t7/8xrcndgx61z0dzzy5fr4xydh0000gn/T/go-build417926574=/tmp/go-build -gno-record-gcc-switches -fno-common

What did you do?

Try build golang.org/x/text with bazel 0.22.0.

With all deps prepared, add bazel build files to golang.org/x/text, finally run bazel build golang.org/x/text/...

What did you expect to see?

Should build without error.

What did you see instead?

Bazel build fails with error:

.-> //third-party-go/vendor/golang.org/x/text/internal/gen:go_default_library
| //third-party-go/vendor/golang.org/x/text/unicode/cldr:go_default_library
`-- //third-party-go/vendor/golang.org/x/text/internal/gen:go_default_library

I checked the source codes in golang.org/x/text/internal/gen and golang.org/x/text/unicode/cldr, they do cross-import each other.

@gopherbot gopherbot added this to the Unreleased milestone Feb 25, 2019
@bcmills
Copy link
Contributor

bcmills commented Feb 25, 2019

There is likely a problem with your Bazel BUILD file. The file in x/text/unicode that imports x/text/internal/gen is restricted to the ignore build tag:
https://github.com/golang/text/blob/6c92c7dc7f53607809182301b96e4cc1975143f1/unicode/cldr/makexml.go#L5
https://github.com/golang/text/blob/6c92c7dc7f53607809182301b96e4cc1975143f1/unicode/cldr/makexml.go#L23

Did you generate the build file using Gazelle, or by hand?

CC @jayconrod

@bcmills bcmills closed this as completed Feb 25, 2019
@jayconrod
Copy link
Contributor

@mqy If you're still having this issue, please open an issue in the bazelbuild/rules_go repo. Make sure to include the Bazel version, rules_go version, gazelle version, and enough information about your workspace to reproduce the problem.

@mqy
Copy link
Author

mqy commented Feb 26, 2019

Thanks a lot. Build succeeded by excluding makexml.go in BUILD.

@golang golang locked and limited conversation to collaborators Feb 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants