@@ -71,7 +71,8 @@ function download_file {
7171function verify_checksums {
7272 local archive=$1
7373 local header=$2
74- local sums=$3
74+ local warmup=$3
75+ local sums=$4
7576
7677 # Determine the available SHA hashing utility
7778 if command -v sha256sum & > /dev/null; then
@@ -90,9 +91,9 @@ function verify_checksums {
9091 fi
9192
9293 # Filter the relevant checksums and verify they are not empty
93- checksums=$( grep -e " ${archive} " -e " ${header} " " ${sums} " )
94+ checksums=$( grep -e " ${archive} " -e " ${header} " -e " ${warmup} " " ${sums} " )
9495 if [[ -z " $checksums " ]]; then
95- echo " Error: No matching checksums found for ${archive} or ${header } in ${sums} ." >&2
96+ echo " Error: No matching checksums found for ${archive} , ${header} , or ${warmup } in ${sums} ." >&2
9697 return 1
9798 fi
9899
@@ -144,11 +145,13 @@ function detect_os_and_cpu {
144145 # echo "Using Asherah libraries for Linux x86_64"
145146 ARCHIVE=" libasherah-x64.a"
146147 HEADER=" libasherah-x64-archive.h"
148+ WARMUP=" go-warmup-linux-x64.so"
147149 SUMS=" SHA256SUMS"
148150 elif [[ ${MACHINE} == ' aarch64' ]]; then
149151 # echo "Using Asherah libraries for Linux aarch64"
150152 ARCHIVE=" libasherah-arm64.a"
151153 HEADER=" libasherah-arm64-archive.h"
154+ WARMUP=" go-warmup-linux-arm64.so"
152155 SUMS=" SHA256SUMS"
153156 else
154157 # echo "Unsupported CPU architecture: ${MACHINE}" >&2
@@ -159,11 +162,13 @@ function detect_os_and_cpu {
159162 # echo "Using Asherah libraries for MacOS x86_64"
160163 ARCHIVE=" libasherah-darwin-x64.a"
161164 HEADER=" libasherah-darwin-x64-archive.h"
165+ WARMUP=" go-warmup-darwin-x64.dylib"
162166 SUMS=" SHA256SUMS-darwin"
163167 elif [[ ${MACHINE} == ' arm64' ]]; then
164168 # echo "Using Asherah libraries for MacOS arm64"
165169 ARCHIVE=" libasherah-darwin-arm64.a"
166170 HEADER=" libasherah-darwin-arm64-archive.h"
171+ WARMUP=" go-warmup-darwin-arm64.dylib"
167172 SUMS=" SHA256SUMS-darwin"
168173 else
169174 echo " Unsupported CPU architecture: ${MACHINE} " >&2
@@ -174,7 +179,7 @@ function detect_os_and_cpu {
174179 exit 1
175180 fi
176181
177- echo " ${ARCHIVE} " " ${HEADER} " " ${SUMS} " # Return value
182+ echo " ${ARCHIVE} " " ${HEADER} " " ${WARMUP} " " ${ SUMS}" # Return value
178183}
179184
180185# Parse script arguments
@@ -216,18 +221,20 @@ function main {
216221 no_cache=$( parse_args " $@ " )
217222
218223 # Detect OS and CPU architecture
219- read -r archive header sums < <( detect_os_and_cpu)
224+ read -r archive header warmup sums < <( detect_os_and_cpu)
220225 echo " Archive: $archive "
221226 echo " Header: $header "
227+ echo " Warmup: $warmup "
222228 echo " Sums: $sums "
223229 echo " Version: $ASHERAH_VERSION "
224230
225231 # Interpolate the URLs
226232 url_prefix=" https://github.com/godaddy/asherah-cobhan/releases/download/${ASHERAH_VERSION} "
227- file_names=(" ${archive} " " ${header} " " ${sums} " )
233+ file_names=(" ${archive} " " ${header} " " ${warmup} " " ${ sums}" )
228234 file_urls=(
229235 " ${url_prefix} /${archive} "
230236 " ${url_prefix} /${header} "
237+ " ${url_prefix} /${warmup} "
231238 " ${url_prefix} /${sums} "
232239 )
233240
@@ -249,7 +256,7 @@ function main {
249256 done
250257
251258 # Verify checksums and copy files
252- if verify_checksums " ${archive} " " ${header} " " ${sums} " ; then
259+ if verify_checksums " ${archive} " " ${header} " " ${warmup} " " ${ sums}" ; then
253260 copy_files " ${archive} " " ${header} "
254261 checksums_verified=true
255262 else
0 commit comments