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