From e2cfe73ff3d79f1b0b2919d893fb97805790fa61 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Tue, 23 Oct 2018 12:08:09 +0100 Subject: [PATCH 1/3] CI: Use variable to avoid duplication Use a variable in the golang install script to avoid repetition. Signed-off-by: James O. D. Hunt --- .ci/install_go.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.ci/install_go.sh b/.ci/install_go.sh index a07d73ced..7bf8e2277 100755 --- a/.ci/install_go.sh +++ b/.ci/install_go.sh @@ -101,9 +101,11 @@ case "$(arch)" in ;; esac +archive="go${go_version}.linux-${goarch}.tar.gz" + info "Download go version ${go_version}" -curl -OL "https://storage.googleapis.com/golang/go${go_version}.linux-${goarch}.tar.gz" +curl -OL "https://storage.googleapis.com/golang/${archive}" info "Install go" mkdir -p "${install_dest}" -sudo tar -C "${install_dest}" -xzf "go${go_version}.linux-${goarch}.tar.gz" +sudo tar -C "${install_dest}" -xzf "${archive}" popd From 33b2bb765706c508e3db8b4d3655f3bd25733b04 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Tue, 23 Oct 2018 12:09:00 +0100 Subject: [PATCH 2/3] CI: Ensure downloaded version of golang used The script used to install golang was downloading and installing the binary package, but not actually using the new golang version. Signed-off-by: James O. D. Hunt --- .ci/install_go.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.ci/install_go.sh b/.ci/install_go.sh index 7bf8e2277..0474bbc17 100755 --- a/.ci/install_go.sh +++ b/.ci/install_go.sh @@ -109,3 +109,17 @@ info "Install go" mkdir -p "${install_dest}" sudo tar -C "${install_dest}" -xzf "${archive}" popd + +# Make sure we use the golang version we just installed +goroot="${install_dest}/go" + +[ -d "${goroot}" ] || die "failed to find expected golang path ${goroot} (from ${archive})" + +export GOROOT="${goroot}" + +gorootbin="${GOROOT}/bin" +[ -d "${gorootbin}" ] || die "failed to find expected golang binary path ${gorootbin} (from ${archive})" + +export PATH="${gorootbin}:$PATH" + +info "Using golang binary $(command -v go) version $(go version)" From 3324e20188bcb42ac5b335b044190d5bd2992d21 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Tue, 23 Oct 2018 12:04:08 +0100 Subject: [PATCH 3/3] CI: Undo xurls URL change Undo URL change from [1] since the xurls install issue was caused by the CI using a version of golang that is too old for xurls. Fixes #841. --- [1] - https://github.com/kata-containers/tests/pull/839 Signed-off-by: James O. D. Hunt --- .ci/static-checks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/static-checks.sh b/.ci/static-checks.sh index b1e58e3ec..dbd7dbbe0 100755 --- a/.ci/static-checks.sh +++ b/.ci/static-checks.sh @@ -385,7 +385,7 @@ check_docs() if [ ! "$(command -v $cmd)" ] then info "Installing $cmd utility" - go get -u "github.com/mvdan/xurls/cmd/${cmd}" + go get -u -v "mvdan.cc/xurls/cmd/${cmd}" 2>&1 fi info "Checking documentation"