-
-
Notifications
You must be signed in to change notification settings - Fork 723
Closed
buildbuddy-io/buildbuddy
#3393Description
What version of rules_go are you using?
v0.37.0
What version of gazelle are you using?
None
What version of Bazel are you using?
6.0.0
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
$ uname -srvio
Linux 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 GNU/Linux
Any other potentially useful information about your toolchain?
What did you do?
Please see the below for a minimally reproducible example.
.bazelversion:
6.0.0
WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "56d8c5a5c91e1af73eca71a6fab2ced959b67c86d12ba37feedb0a2dfea441a6",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.37.0/rules_go-v0.37.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.37.0/rules_go-v0.37.0.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(
nogo = "@//:lint",
version = "1.19.3",
)BUILD:
load("@io_bazel_rules_go//go:def.bzl", "nogo")
nogo(
name = "lint",
visibility = ["//visibility:public"],
)Invocation:
$ bazelisk build //...What did you expect to see?
bazel-bin symlink is valid and created.
What did you see instead?
bazel-bin is not created due to ambiguous destinations:
INFO: Invocation ID: 84e6b1d4-b26b-4a91-b30c-4459ff3f3088
INFO: Analyzed 2 targets (1 packages loaded, 38 targets configured).
INFO: Found 2 targets...
WARNING: cleared convenience symlink(s) bazel-bin, bazel-testlogs because their destinations would be ambiguous
INFO: Elapsed time: 0.198s, Critical Path: 0.01s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
Note that:
- This is a regression starting with Bazel 6 (the symlinks are created properly on Bazel 5)
- Removing the
nogotarget inBUILD, and removing thenogoparameter ingo_register_toolchains, causes the symlink to be created correctly
The warning is sourced from here: https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java#L172
To debug, I compiled a version of Bazel with additional debug logging, and found that the two candidate paths for bazel-bin are:
/home/kiwi/.cache/bazel/_bazel_kiwi/89a35363ec8de7131a16c2ed7419999a/execroot/__main__/bazel-out/k8-fastbuild/bin
/home/kiwi/.cache/bazel/_bazel_kiwi/89a35363ec8de7131a16c2ed7419999a/execroot/__main__/bazel-out/k8-fastbuild-ST-e0d274b3679e/bin
When I remove nogo, there is only one candidate path for bazel-bin, as expected.
Metadata
Metadata
Assignees
Labels
No labels