Skip to content

Commit b0cde9e

Browse files
authored
Merge pull request #174 from crazy-max/alpine-321
ci: update alpine to 3.21
2 parents ddc255f + e6955cb commit b0cde9e

File tree

6 files changed

+90
-11
lines changed

6 files changed

+90
-11
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ jobs:
3535
fail-fast: false
3636
matrix:
3737
include:
38-
-
39-
image: alpine:3.16
40-
typ: alpine
41-
allow-failure: false
4238
-
4339
image: alpine:3.17
4440
typ: alpine
@@ -55,6 +51,10 @@ jobs:
5551
image: alpine:3.20
5652
typ: alpine
5753
allow-failure: false
54+
-
55+
image: alpine:3.21
56+
typ: alpine
57+
allow-failure: false
5858
-
5959
image: alpine:edge
6060
typ: alpine

src/test-apk.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ load 'assert'
3737
assert_output "$(xx-info alpine-arch)"
3838
run xx-apk add --no-cache zlib
3939
assert_success
40-
[ -f "/$(xx-info)/lib/libz.so.1" ]
40+
[ -f "/$(xx-info)/lib/libz.so.1" ] || [ -f "/$(xx-info)/usr/lib/libz.so.1" ]
4141
run xx-apk del zlib
4242
assert_success
43-
[ ! -f "/$(xx-info)/lib/libz.so.1" ]
43+
[ ! -f "/$(xx-info)/lib/libz.so.1" ] && [ ! -f "/$(xx-info)/usr/lib/libz.so.1" ]
4444
run xx-apk clean
4545
assert_success
4646
[ ! -d "/$(xx-info)" ]

src/test-go.bats

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ testEnv() {
226226
export TARGETOS=darwin
227227
export TARGETARCH=amd64
228228
testEnv
229+
unset TARGETOS
229230
}
230231

231232
@test "darwin-arm64-env" {
@@ -235,6 +236,30 @@ testEnv() {
235236
unset TARGETOS
236237
}
237238

239+
@test "windows-386-env" {
240+
export TARGETOS=windows
241+
export TARGETARCH=386
242+
testEnv
243+
unset TARGETOS
244+
}
245+
246+
@test "windows-amd64-env" {
247+
export TARGETOS=windows
248+
export TARGETARCH=amd64
249+
testEnv
250+
unset TARGETOS
251+
}
252+
253+
@test "windows-arm64-env" {
254+
if ! supportWindowsArm64Go; then
255+
skip "Windows ARM64 not supported"
256+
fi
257+
export TARGETOS=windows
258+
export TARGETARCH=arm64
259+
testEnv
260+
unset TARGETOS
261+
}
262+
238263
testHelloGO() {
239264
run xx-go build -o /tmp/a.out ./fixtures/hello.go
240265
assert_success
@@ -346,6 +371,31 @@ testHelloGO() {
346371
export TARGETARCH=amd64
347372
export TARGETOS=darwin
348373
testHelloGO
374+
unset TARGETOS
375+
}
376+
377+
@test "windows-386-hellogo" {
378+
export TARGETARCH=386
379+
export TARGETOS=windows
380+
testHelloGO
381+
unset TARGETOS
382+
}
383+
384+
@test "windows-amd64-hellogo" {
385+
export TARGETARCH=amd64
386+
export TARGETOS=windows
387+
testHelloGO
388+
unset TARGETOS
389+
}
390+
391+
@test "windows-arm64-hellogo" {
392+
if ! supportWindowsArm64Go; then
393+
skip "Windows ARM64 not supported"
394+
fi
395+
export TARGETARCH=arm64
396+
export TARGETOS=windows
397+
testHelloGO
398+
unset TARGETOS
349399
}
350400

351401
testHelloCGO() {

src/test-verify.bats

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ load 'assert'
121121
run xx-verify /idontexist
122122
assert_failure
123123

124+
export XX_VERIFY_FILE_CMD_OUTPUT=": PE32+ executable (console) ARM64 (stripped to external PDB), for MS Windows"
125+
export TARGETPLATFORM=windows/arm64
126+
run xx-verify /idontexist
127+
assert_success
128+
124129
export XX_VERIFY_FILE_CMD_OUTPUT=": PE32+ executable (console) Aarch64 (stripped to external PDB), for MS Windows"
125130
export TARGETPLATFORM=windows/arm64
126131
run xx-verify /idontexist
@@ -147,6 +152,11 @@ load 'assert'
147152
run xx-verify /idontexist
148153
assert_failure
149154

155+
export XX_VERIFY_FILE_CMD_OUTPUT=": PE32 executable (console) Intel i386 (stripped to external PDB), for MS Windows"
156+
export TARGETPLATFORM=windows/386
157+
run xx-verify /idontexist
158+
assert_success
159+
150160
export XX_VERIFY_FILE_CMD_OUTPUT=": PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows"
151161
export TARGETPLATFORM=windows/386
152162
run xx-verify /idontexist
@@ -208,6 +218,11 @@ load 'assert'
208218
run xx-verify /idontexist
209219
assert_failure
210220

221+
export XX_VERIFY_FILE_CMD_OUTPUT=": ELF 32-bit LSB executable, Intel i386, version 1 (SYSV), statically linked, Go BuildID=GUb5psm2_Qmc_LlEF7GP/wcIHIg_4MjQh8NC5wfep/LSmTmWKKZ5smuAQbfeFE/FBYRjFmbJQpV--JKtz4i, not stripped"
222+
export TARGETPLATFORM=linux/386
223+
run xx-verify /idontexist
224+
assert_success
225+
211226
export XX_VERIFY_FILE_CMD_OUTPUT=": ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, Go BuildID=GUb5psm2_Qmc_LlEF7GP/wcIHIg_4MjQh8NC5wfep/LSmTmWKKZ5smuAQbfeFE/FBYRjFmbJQpV--JKtz4i, not stripped"
212227
export TARGETPLATFORM=linux/386
213228
run xx-verify /idontexist

src/test_helper.bash

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ supportMipsBuildGo() {
101101
! grep -q 'ID=ubuntu' /etc/os-release && ! grep -q 'VERSION_ID="22.04"' /etc/os-release && versionGTE "$(go version | awk '{print $3}' | sed 's/^go//')" "1.13"
102102
}
103103

104+
supportWindowsArm64Go() {
105+
versionGTE "$(go version | awk '{print $3}' | sed 's/^go//')" "1.17"
106+
}
107+
104108
supportRC() {
105109
command -v llvm-rc >/dev/null 2>&1
106110
}

src/xx-verify

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,17 @@ for f in "$@"; do
144144
fi
145145

146146
expArch=""
147-
expArch2="" # extra check for endianness
147+
expArchAlt="" # alternate arch name
148+
expArch2="" # extra check for endianness
148149
case "$TARGETARCH" in
149150
"arm64")
150151
case "$TARGETOS" in
151152
"darwin")
152153
expArch="arm64"
153154
;;
154155
"windows")
155-
expArch="Aarch64"
156+
expArch="ARM64"
157+
expArchAlt="Aarch64"
156158
;;
157159
*)
158160
expArch="ARM aarch64"
@@ -226,7 +228,8 @@ for f in "$@"; do
226228
expArch2="64-bit LSB"
227229
;;
228230
"386")
229-
expArch="Intel 80386"
231+
expArch="Intel i386"
232+
expArchAlt="Intel 80386"
230233
if [ "$TARGETOS" != "windows" ]; then
231234
expArch2="32-bit LSB"
232235
fi
@@ -239,8 +242,15 @@ for f in "$@"; do
239242
fi
240243

241244
if ! echo "$out" | grep "$expArch" >/dev/null; then
242-
echo >&2 "file ${f} does not match expected target architecture ${TARGETARCH}: $out"
243-
exit 1
245+
if [ -n "$expArchAlt" ]; then
246+
if ! echo "$out" | grep "$expArchAlt" >/dev/null; then
247+
echo >&2 "file ${f} does not match expected target architecture ${TARGETARCH}: $out"
248+
exit 1
249+
fi
250+
else
251+
echo >&2 "file ${f} does not match expected target architecture ${TARGETARCH}: $out"
252+
exit 1
253+
fi
244254
fi
245255

246256
if [ -n "$expArch2" ]; then

0 commit comments

Comments
 (0)