From 880398c3c33cf981e7db38357de34dc3cfd8d051 Mon Sep 17 00:00:00 2001 From: Adin Scannell Date: Thu, 26 Jan 2023 15:29:33 -0800 Subject: [PATCH] Remove broken links. PiperOrigin-RevId: 504957670 --- tools/go_branch.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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