Can be reproduced with the following rules
genrule(
name = "dummy",
srcs = ["dummy.txt"],
outs = ["dummy.go"],
cmd = "cp $< $@",
)
go_library(
name = "lib",
srcs = [":dummy"],
importpath = "dummy",
)
go_path(
name = "foobar",
deps = [
":lib",
],
mode = "link",
)
// dummy.txt
package dummy
$ bazel build //go:foobar
INFO: Analysed target //go:foobar (0 packages loaded).
INFO: Found 1 target...
ERROR: /home/shimin/<redacted>/go/BUILD.bazel:43:1: GoPath go/foobar/src/dummy/dummy.go failed (Exit 1)
symlink ../../../../../genfiles/go/dummy.go bazel-out/k8-fastbuild/bin/go/foobar/src/dummy/dummy.go: file exists
Target //go:foobar failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.331s, Critical Path: 0.06s
FAILED: Build did NOT complete successfully
Using rules_go at 27b444a
Can be reproduced with the following rules
Using rules_go at 27b444a