Try using Zig instead (#831)

This commit is contained in:
Evan Simkowitz 2024-09-24 20:26:04 -07:00 committed by GitHub
parent 203db99b5f
commit 76f4ec641c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 7 deletions

View File

@ -39,10 +39,10 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install --no-install-recommends -y libarchive-tools libopenjp2-tools rpm squashfs-tools sudo apt-get install --no-install-recommends -y libarchive-tools libopenjp2-tools rpm squashfs-tools
# We use musl-gcc instead of glibc for cgo compilation as it is more-easily statically linked # We use Zig instead of glibc for cgo compilation as it is more-easily statically linked
- name: Setup musl-gcc (Linux only) - name: Setup Zig (Linux only)
if: matrix.platform == 'linux' if: matrix.platform == 'linux'
uses: ./.github/actions/setup-musl-gcc run: sudo snap install zig --classic --beta
# The pre-installed version of the AWS CLI has a segfault problem so we'll install it via Homebrew instead. # The pre-installed version of the AWS CLI has a segfault problem so we'll install it via Homebrew instead.
- name: Upgrade AWS CLI (Mac only) - name: Upgrade AWS CLI (Mac only)

View File

@ -71,10 +71,10 @@ jobs:
go-version: stable go-version: stable
cache-dependency-path: | cache-dependency-path: |
go.sum go.sum
# We use musl-gcc instead of glibc for cgo compilation as it is more-easily statically linked # We use Zig instead of glibc for cgo compilation as it is more-easily statically linked
- name: Setup musl-gcc (Go only) - name: Setup Zig (Go only)
if: matrix.language == 'go' if: matrix.language == 'go'
uses: ./.github/actions/setup-musl-gcc run: sudo snap install zig --classic --beta
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL

View File

@ -95,7 +95,7 @@ tasks:
ARCHS: ARCHS:
sh: echo {{if eq "arm" ARCH}}arm64{{else}}{{ARCH}}{{end}} sh: echo {{if eq "arm" ARCH}}arm64{{else}}{{ARCH}}{{end}}
GO_LDFLAGS: -linkmode 'external' -extldflags=-static GO_LDFLAGS: -linkmode 'external' -extldflags=-static
GO_ENV_VARS: CC=/usr/local/musl/bin/musl-gcc GO_ENV_VARS: CC="zig cc"
build:server:internal: build:server:internal:
requires: requires: