Skip to content

Commit 00b310d

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 00b310d

4 files changed

Lines changed: 54 additions & 3 deletions

File tree

.github/workflows/test.yml

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

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)