Skip to content

Commit

Permalink
Build the Go toolchain before applying patches
Browse files Browse the repository at this point in the history
This allows us to use this version of the toolchain to run the
`go mod ...` commands, instead of relying on the host toolchain
and having to manipulate the Go module version in the new
toolchain go.mod file.
  • Loading branch information
derekparker committed Sep 5, 2023
1 parent b358ad9 commit 3ac715e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/create-secondary-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
6 changes: 6 additions & 0 deletions scripts/setup-initial-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down

0 comments on commit 3ac715e

Please sign in to comment.