From ace63f8701f581914a8f6d46ffe84c0b4adebba8 Mon Sep 17 00:00:00 2001 From: Rob Findley Date: Mon, 10 Aug 2020 11:55:40 -0400 Subject: [PATCH] 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 --- gopls/integration/govim/run_local.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gopls/integration/govim/run_local.sh b/gopls/integration/govim/run_local.sh index 73d0bf050e..b7aba5eb9d 100755 --- a/gopls/integration/govim/run_local.sh +++ b/gopls/integration/govim/run_local.sh @@ -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.