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}"