Skip to content

Commit ef6517d

Browse files
committed
fix build (by avoiding purego) on 32-bit GOARCH builds
This makes those architectures effectively always build in "nodynamic" mode without having to set the build tag. Signed-off-by: Brad Fitzpatrick <brad@danga.com>
1 parent 97b4f06 commit ef6517d

4 files changed

Lines changed: 52 additions & 3 deletions

File tree

.github/workflows/test.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,52 @@ jobs:
3838
dir
3939
- name: Test
4040
run: go test -v -bench=. -benchtime=1x
41+
42+
cross-build:
43+
runs-on: ubuntu-latest
44+
strategy:
45+
fail-fast: false # don't abort the entire matrix if one element fails
46+
matrix:
47+
include:
48+
# Note: {linux,windows,darwin}/amd64 is not in this matrix, because those
49+
# are tested more exhaustively in the 'test' job above.
50+
- goos: linux
51+
goarch: "386" # quoted for yaml
52+
- goos: linux
53+
goarch: mips
54+
- goos: linux
55+
goarch: mipsle
56+
- goos: linux
57+
goarch: loong64
58+
- goos: linux
59+
goarch: arm
60+
goarm: "5"
61+
- goos: linux
62+
goarch: arm
63+
goarm: "7"
64+
# Windows
65+
- goos: windows
66+
goarch: arm64
67+
# BSDs
68+
- goos: freebsd
69+
goarch: amd64
70+
- goos: openbsd
71+
goarch: amd64
72+
73+
steps:
74+
- name: Checkout code
75+
uses: actions/checkout@v4
76+
- name: Install Go
77+
uses: actions/setup-go@v5
78+
with:
79+
go-version-file: go.mod
80+
- name: build
81+
working-directory: src
82+
run:
83+
go install ./...
84+
go test --exec=true ./...
85+
env:
86+
GOOS: ${{ matrix.goos }}
87+
GOARCH: ${{ matrix.goarch }}
88+
GOARM: ${{ matrix.goarm }}
89+
CGO_ENABLED: "0"

decode_dynamic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build (unix || darwin || windows) && !nodynamic
1+
//go:build (unix || darwin || windows) && !(nodynamic || arm || 386 || mips || mipsle)
22

33
package heic
44

purego_other.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build (!unix && !darwin && !windows) || nodynamic
1+
//go:build (!unix && !darwin && !windows) || nodynamic || arm || 386 || mips || mipsle
22

33
package heic
44

purego_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build unix && !darwin && !nodynamic
1+
//go:build unix && !darwin && !(nodynamic || arm || 386 || mips || mipsle)
22

33
package heic
44

0 commit comments

Comments
 (0)