From de3bd7ec563313aa732339341809d9831e92ed03 Mon Sep 17 00:00:00 2001 From: Oscar Tovar Date: Sat, 6 May 2023 01:56:00 +0000 Subject: [PATCH] Add Go 1.20 support --- .gitlab/ci/gitaly.images.yml | 2 +- .gitlab/ci/gitlab.images.yml | 6 +++--- scripts/install-golang | 9 ++++++++- scripts/lib/custom-docker-build | 15 ++++++++++----- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.gitlab/ci/gitaly.images.yml b/.gitlab/ci/gitaly.images.yml index ded633c..4b76efa 100644 --- a/.gitlab/ci/gitaly.images.yml +++ b/.gitlab/ci/gitaly.images.yml @@ -16,7 +16,7 @@ gitaly: parallel: matrix: - OS: ['debian:bullseye'] - GOLANG: ['1.18', '1.19'] + GOLANG: ['1.19', '1.20'] RUST: ['1.65'] GIT: ['2.36'] - OS: ['ubi:8.6'] diff --git a/.gitlab/ci/gitlab.images.yml b/.gitlab/ci/gitlab.images.yml index 7ed2708..fc30e5b 100644 --- a/.gitlab/ci/gitlab.images.yml +++ b/.gitlab/ci/gitlab.images.yml @@ -26,7 +26,7 @@ gitlab: RUBY: ['2.7.patched', '3.0.patched', '3.1.patched', '3.2.patched'] GIT: ['2.36'] POSTGRESQL: ['12', '13', '14', '15'] - GOLANG: ['1.18', '1.19'] + GOLANG: ['1.19', '1.20'] RUST: ['1.65'] NODE: ['16.14', '18.12'] CHROME: ['109'] @@ -73,11 +73,11 @@ gitlab-workhorse: matrix: - OS: ['debian:bullseye'] RUBY: ['2.7', '3.0', '3.1', '3.2'] - GOLANG: ['1.18', '1.19'] + GOLANG: ['1.19', '1.20'] RUST: ['1.65'] GIT: ['2.36'] - OS: ['ubi:8.6'] RUBY: ['2.7', '3.0', '3.1', '3.2'] - GOLANG: ['1.18', '1.19'] + GOLANG: ['1.19', '1.20'] RUST: ['1.65'] GIT: ['2.36'] diff --git a/scripts/install-golang b/scripts/install-golang index 64873a2..5ab8025 100755 --- a/scripts/install-golang +++ b/scripts/install-golang @@ -29,7 +29,14 @@ function build_ubi() { cd /usr/local/go/src PATH=$PATH:/tmp/golang/go/bin CGO_ENABLED=1 ./make.bash else - git clone https://github.com/golang-fips/go.git --branch "go${GO_MAJOR_VERSION}-fips-release" --single-branch --depth 1 /tmp/golang-fips + # This is a workaround until https://github.com/golang-fips/go/issues/82 is resolved. + if [[ $GO_MAJOR_VERSION == "1.20" ]]; then + GO_BRANCH="go1.20.3-openssl-fips" + else + GO_BRANCH="go${GO_MAJOR_VERSION}-fips-release" + fi + + git clone https://github.com/golang-fips/go.git --branch "${GO_BRANCH}" --single-branch --depth 1 /tmp/golang-fips cd /tmp/golang-fips # The initialize script ends with a commit, so we need to set the user info. And needs to be global due to submodules in use. diff --git a/scripts/lib/custom-docker-build b/scripts/lib/custom-docker-build index ac4cc6f..5b99853 100755 --- a/scripts/lib/custom-docker-build +++ b/scripts/lib/custom-docker-build @@ -41,13 +41,18 @@ function print_golang_args() { case "$1" in 1.18) INSTALL_GOLANG_VERSION=1.18.10 - GOLANG_DOWNLOAD_SHA256[amd64]=5e05400e4c79ef5394424c0eff5b9141cb782da25f64f79d54c98af0a37f8d49 - GOLANG_DOWNLOAD_SHA256[arm64]=160497c583d4c7cbc1661230e68b758d01f741cf4bece67e48edc4fdd40ed92d + GOLANG_DOWNLOAD_SHA256[amd64]="5e05400e4c79ef5394424c0eff5b9141cb782da25f64f79d54c98af0a37f8d49" + GOLANG_DOWNLOAD_SHA256[arm64]="160497c583d4c7cbc1661230e68b758d01f741cf4bece67e48edc4fdd40ed92d" ;; 1.19) - INSTALL_GOLANG_VERSION=1.19.7 - GOLANG_DOWNLOAD_SHA256[amd64]=7a75720c9b066ae1750f6bcc7052aba70fa3813f4223199ee2a2315fd3eb533d - GOLANG_DOWNLOAD_SHA256[arm64]=071ea7bf386fdd08df524859b878d99fc359e491e7ad65c1c1cc55b67972c882 + INSTALL_GOLANG_VERSION=1.19.8 + GOLANG_DOWNLOAD_SHA256[amd64]="e1a0bf0ab18c8218805a1003fd702a41e2e807710b770e787e5979d1cf947aba" + GOLANG_DOWNLOAD_SHA256[arm64]="f89e7c0ba63782143bd1f896e4b96ea09e4baf39e8bc2f2ddf27339f9e433dd3" + ;; + 1.20) + INSTALL_GOLANG_VERSION=1.20.3 # Update scripts/install-golang for FIPS if this version is bumped + GOLANG_DOWNLOAD_SHA256[amd64]="979694c2c25c735755bf26f4f45e19e64e4811d661dd07b8c010f7a8e18adfca" + GOLANG_DOWNLOAD_SHA256[arm64]="eb186529f13f901e7a2c4438a05c2cd90d74706aaa0a888469b2a4a617b6ee54" ;; *) fail "Unknown golang version $1" ;; esac