build: support mount on windows/arm64 - all windows binaries now not cgo

This builds all windows binaries without CGO but with cmount.

cgofuse has a compile mode which works without CGO on Windows for
amd64/x86/arm64 architectures so switch to using that.
This commit is contained in:
Nick Craig-Wood 2022-04-22 17:46:12 +01:00
parent c0c5b3bc6b
commit deab86867c
3 changed files with 10 additions and 18 deletions

View File

@ -25,7 +25,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
job_name: ['linux', 'mac_amd64', 'mac_arm64', 'windows_amd64', 'windows_386', 'other_os', 'go1.16', 'go1.17'] job_name: ['linux', 'mac_amd64', 'mac_arm64', 'windows', 'other_os', 'go1.16', 'go1.17']
include: include:
- job_name: linux - job_name: linux
@ -55,23 +55,12 @@ jobs:
build_flags: '-include "^darwin/arm64" -cgo -macos-arch arm64 -cgo-cflags=-I/usr/local/include -cgo-ldflags=-L/usr/local/lib' build_flags: '-include "^darwin/arm64" -cgo -macos-arch arm64 -cgo-cflags=-I/usr/local/include -cgo-ldflags=-L/usr/local/lib'
deploy: true deploy: true
- job_name: windows_amd64 - job_name: windows
os: windows-latest os: windows-latest
go: '1.18.x' go: '1.18.x'
gotags: cmount gotags: cmount
build_flags: '-include "^windows/amd64" -cgo' cgo: '0'
build_args: '-buildmode exe' build_flags: '-include "^windows/"'
quicktest: true
racequicktest: true
deploy: true
- job_name: windows_386
os: windows-latest
go: '1.18.x'
gotags: cmount
goarch: '386'
cgo: '1'
build_flags: '-include "^windows/386" -cgo'
build_args: '-buildmode exe' build_args: '-buildmode exe'
quicktest: true quicktest: true
deploy: true deploy: true
@ -79,7 +68,7 @@ jobs:
- job_name: other_os - job_name: other_os
os: ubuntu-latest os: ubuntu-latest
go: '1.18.x' go: '1.18.x'
build_flags: '-exclude "^(windows/(386|amd64)|darwin/|linux/)"' build_flags: '-exclude "^(windows/|darwin/|linux/)"'
compile_all: true compile_all: true
deploy: true deploy: true

View File

@ -97,7 +97,7 @@ release_dep_linux:
# Get the release dependencies we only install on Windows # Get the release dependencies we only install on Windows
release_dep_windows: release_dep_windows:
GO111MODULE=off GOOS="" GOARCH="" go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo GOOS="" GOARCH="" go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest
# Update dependencies # Update dependencies
showupdates: showupdates:

View File

@ -265,9 +265,12 @@ func buildWindowsResourceSyso(goarch string, versionTag string) string {
"-o", "-o",
sysoPath, sysoPath,
} }
if goarch == "amd64" { if strings.Contains(goarch, "64") {
args = append(args, "-64") // Make the syso a 64-bit coff file args = append(args, "-64") // Make the syso a 64-bit coff file
} }
if strings.Contains(goarch, "arm") {
args = append(args, "-arm") // Make the syso an arm binary
}
args = append(args, jsonPath) args = append(args, jsonPath)
err = runEnv(args, nil) err = runEnv(args, nil)
if err != nil { if err != nil {