From d0d2186a46732afdba99ee8f4a39a84ff51c6fd8 Mon Sep 17 00:00:00 2001 From: David Benoit Date: Tue, 19 Sep 2023 15:43:47 -0400 Subject: [PATCH] use local toolchain for Go mod tidy and disable ubi7 test (#125) * run go mod tidy with local Go toolchain * target golang-fips/release and disable ubi7 --- .github/workflows/gating.yml | 2 +- scripts/create-secondary-patch.sh | 4 ++-- scripts/full-initialize-repo.sh | 6 ++++++ scripts/setup-initial-patch.sh | 6 ++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gating.yml b/.github/workflows/gating.yml index 18ef73906a..de1332b771 100644 --- a/.github/workflows/gating.yml +++ b/.github/workflows/gating.yml @@ -29,4 +29,4 @@ jobs: uses: golang-fips/release/.github/workflows/test-ubi-centos.yml@main with: go_fips_ref: ${{ github.event.pull_request.head.sha }} - composes: "ubi7,ubi8,ubi9,c8s,c9s" + composes: "ubi8,ubi9,c8s,c9s" diff --git a/scripts/create-secondary-patch.sh b/scripts/create-secondary-patch.sh index e8fb612d78..148c2d0ee8 100755 --- a/scripts/create-secondary-patch.sh +++ b/scripts/create-secondary-patch.sh @@ -37,8 +37,8 @@ replace="${1}" if [ -n "${replace}" ]; then echo "replace github.com/golang-fips/openssl-fips => ${replace}" >> go.mod fi -go mod tidy -go mod vendor +../bin/go mod tidy +../bin/go mod vendor # Generate the final patch. git add . diff --git a/scripts/full-initialize-repo.sh b/scripts/full-initialize-repo.sh index 51724ae110..65b14e412e 100755 --- a/scripts/full-initialize-repo.sh +++ b/scripts/full-initialize-repo.sh @@ -3,6 +3,12 @@ # This script generates and applies FIPS # patches to a Go tree. +echo "Host Go Version:" +go version + +echo "Host Go Env:" +go env + SCRIPT_DIR=$(readlink -f $(dirname $0)) GO_DIR=${SCRIPT_DIR}/../go diff --git a/scripts/setup-initial-patch.sh b/scripts/setup-initial-patch.sh index f835c0ddd1..b1dab7ecaa 100755 --- a/scripts/setup-initial-patch.sh +++ b/scripts/setup-initial-patch.sh @@ -38,6 +38,12 @@ shift $((OPTIND-1)) cd ./go ORIGINAL_GIT_SHA=$(git rev-parse HEAD) +# Build the Go toolchain before applying patches. This allows us to use this toolchain in later steps +# when running `go mod` commands. +pushd ./src +./make.bash +popd + "${ROOT}"/scripts/apply-initial-patch.sh "${ROOT}"/scripts/create-secondary-patch.sh "${replacement}"