Use Go to 1.21.6 and 1.20.13 to build

This commit is contained in:
Robert Marshall 2024-02-06 16:29:58 +00:00 committed by Balasankar 'Balu' C
parent 653ecf8dc0
commit bd863cd03d
6 changed files with 22 additions and 40 deletions

View file

@ -22,28 +22,20 @@ function build_ubi() {
tar -C /tmp/golang -xzf golang.tar.gz
# For UBI, we will be installing golang-fips
# Use a different build process when golang version is less-than-equal to 1.18
if [[ $(echo -e "1.18\n${GO_MAJOR_VERSION}" | sort -V | tail -1) == '1.18' ]]; then
git clone https://github.com/golang-fips/go.git --branch "go${GO_MAJOR_VERSION}-openssl-fips" --single-branch --depth 1 /usr/local/go
GO_BRANCH="go${GO_MAJOR_VERSION}-fips-release"
cd /usr/local/go/src
PATH=$PATH:/tmp/golang/go/bin CGO_ENABLED=1 ./make.bash
else
GO_BRANCH="go${GO_MAJOR_VERSION}-fips-release"
git clone https://github.com/golang-fips/go.git --branch "${GO_BRANCH}" --single-branch --depth 1 /tmp/golang-fips
cd /tmp/golang-fips
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.
git config --global user.email "builder@example.com"
git config --global user.name "Builder"
# 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.
git config --global user.email "builder@example.com"
git config --global user.name "Builder"
PATH=$PATH:/tmp/golang/go/bin ./scripts/full-initialize-repo.sh
PATH=$PATH:/tmp/golang/go/bin ./scripts/full-initialize-repo.sh
cd /tmp/golang-fips/go/src
PATH=$PATH:/tmp/golang/go/bin GOROOT_FINAL=/usr/local/go CGO_ENABLED=1 ./make.bash
mv /tmp/golang-fips/go /usr/local/go
fi
cd /tmp/golang-fips/go/src
PATH=$PATH:/tmp/golang/go/bin GOROOT_FINAL=/usr/local/go CGO_ENABLED=1 ./make.bash
mv /tmp/golang-fips/go /usr/local/go
rm -rf /usr/local/go/pkg/*/cmd /usr/local/go/pkg/bootstrap \
/usr/local/go/pkg/obj /usr/local/go/pkg/tool/*/api \