Merge pull request #39512 from ixdy/bazel-srcs-infinite-loop
Automatic merge from submit-queue
Generate a dummy BUILD file in _output/local/go to keep Bazel out of trouble
**What this PR does / why we need it**: the Kubernetes build system creates a symlink from `_output/local/go/src/k8s.io/kubernetes` back to `$KUBE_ROOT`, likely to deal with folks that don't have their `GOPATH `set up correctly.
Bazel's `glob()` is not very smart, and runs into issues with this; the `package-srcs` glob in `//BUILD.bazel` first evaluates the `**` before matching any excludes, and thus explodes on the infinite loop.
By generating a `BUILD` file along the path to the symlink, Bazel treats this as a separate package and descends no further.
(Oddly, generating a `BUILD.bazel` file doesn't seem to solve the glob explosion, but a directory with a `BUILD.bazel` file is still treated as a separate package. There's probably a subtle bug in Bazel somewhere.)
**Release note**:
```release-note
NONE
```
Showing
Please
register
or
sign in
to comment