gopath: switch to the archive mode

With the link mode, we see stale files from previous runs in
bazel-bin/gopath.
This commit is contained in:
Andrei Vagin
2023-03-13 16:25:09 -07:00
parent ee8a6b9584
commit 7453ba9edd
3 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ function install_pkgs() {
}
install_pkgs make linux-libc-dev graphviz jq curl binutils gnupg gnupg-agent \
gcc pkg-config apt-transport-https ca-certificates \
software-properties-common rsync kmod systemd
software-properties-common rsync kmod systemd unzip
# Install headers, only if available.
if test -n "$(apt-cache search --names-only "^linux-headers-$(uname -r)$")"; then
+1 -1
View File
@@ -120,7 +120,7 @@ build_test(
# The files in this tree are symlinks to the true sources.
go_path(
name = "gopath",
mode = "link",
mode = "archive",
deps = [
# Main binaries.
#
+2 -5
View File
@@ -45,13 +45,10 @@ origpwd=$(pwd)
othersrc=("go.mod" "go.sum" "AUTHORS" "LICENSE")
readonly module origpwd othersrc
# 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.
# Build a full gopath.
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}"
unzip bazel-bin/gopath.zip -d "${go_output}"
# We expect to have an existing go branch that we will use as the basis for this
# commit. That branch may be empty, but it must exist. We search for this branch