diff --git a/tools/go_branch.sh b/tools/go_branch.sh index b7ec9c5d3..67d808f89 100755 --- a/tools/go_branch.sh +++ b/tools/go_branch.sh @@ -45,9 +45,12 @@ origpwd=$(pwd) othersrc=("go.mod" "go.sum" "AUTHORS" "LICENSE") readonly module origpwd othersrc -# Build a full gopath. +# Build a full gopath. Before copying, this scans the generated directory +# and removes broken symbolic links. It's not clear what conditions this bug +# is hit with bazel, but it happens on occasion. declare -r go_output="${tmp_dir}/output" make build BAZEL_OPTIONS="" TARGETS="//:gopath" +find bazel-bin/gopath/ -xtype l -delete # See above. rsync --recursive --delete --copy-links bazel-bin/gopath/ "${go_output}" # We expect to have an existing go branch that we will use as the basis for this