Disable CGO for cross-compilation releases

CGO_ENABLED=0 uses pure Go fallbacks for lux/accel.
For native builds with CGO acceleration, build locally with CGO_ENABLED=1.
This commit is contained in:
Zach Kelling
2026-01-26 17:25:57 -08:00
parent 654e1fad30
commit c519512db7
2 changed files with 3 additions and 37 deletions
-21
View File
@@ -21,26 +21,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: '1.25.5'
- name: Set up arm64 cross compiler
run: |
sudo apt-get -y update
sudo apt-get -y install gcc-aarch64-linux-gnu
- name: Checkout osxcross
uses: actions/checkout@v4
with:
repository: tpoechtrager/osxcross
path: osxcross
- name: Build osxcross
run: |
sudo apt-get -y install clang llvm-dev libxml2-dev uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio libbz2-dev
cd osxcross
wget https://github.com/joseluisq/macosx-sdks/releases/download/12.3/$MACOS_SDK_FNAME -O tarballs/$MACOS_SDK_FNAME
echo $MACOS_SDK_CHECKSUM tarballs/$MACOS_SDK_FNAME | sha256sum -c -
UNATTENDED=1 ./build.sh
echo $PWD/target/bin >> $GITHUB_PATH
env:
MACOS_SDK_FNAME: MacOSX12.3.sdk.tar.xz
MACOS_SDK_CHECKSUM: 3abd261ceb483c44295a6623fdffe5d44fc4ac2c872526576ec5ab5ad0f6e26c
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
@@ -49,5 +29,4 @@ jobs:
args: release --clean
workdir: ./netrunner/
env:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+3 -16
View File
@@ -14,22 +14,9 @@ builds:
- amd64
- arm64
env:
- CGO_ENABLED=1
- CGO_CFLAGS=-O -D__BLST_PORTABLE__ # Set the CGO flags to use the portable version of BLST
overrides:
- goos: linux
goarch: arm64
env:
- CC=aarch64-linux-gnu-gcc
- goos: darwin
goarch: arm64
env:
- CC=oa64-clang
- goos: darwin
goarch: amd64
goamd64: v1
env:
- CC=o64-clang
# CGO disabled for cross-compilation - uses pure Go fallbacks
# For native builds with CGO acceleration, build locally with CGO_ENABLED=1
- CGO_ENABLED=0
release:
# Repo in which the release will be created.
# Default is extracted from the origin remote URL or empty if its private hosted.