gopls/integration/govim: use docker to build gopls in run_local.sh

Kokoro build runners have an old version of the Go command. Update the
run_local.sh script that they use to build in Docker.

For golang/go#40451

Change-Id: I89fc422e6824045ffdb610fe0f9a106c6cdb875e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/247681
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
Rob Findley 2020-08-10 11:55:40 -04:00 committed by Robert Findley
parent 978e77c455
commit ace63f8701
1 changed files with 7 additions and 1 deletions

View File

@ -66,7 +66,13 @@ tools_dir=$(readlink -f "${script_dir}/../../..")
cd "${tools_dir}/gopls"
temp_gopls=$(mktemp -p "$PWD")
trap "rm -f \"${temp_gopls}\"" EXIT
go build -o "${temp_gopls}"
# For consistency across environments, use golang docker to build rather than
# the local go command.
${SUDO_IF_NEEDED}docker run --rm -t \
-v "${tools_dir}:/src/tools" \
-w "/src/tools/gopls" \
golang:latest \
go build -o $(basename ${temp_gopls})
# Build the test harness. Here we are careful to pass in a very limited build
# context so as to optimize caching.