diff --git a/.github/workflows/build-helper.yml b/.github/workflows/build-helper.yml index ada14a17cc..39ed2a770a 100644 --- a/.github/workflows/build-helper.yml +++ b/.github/workflows/build-helper.yml @@ -38,7 +38,9 @@ jobs: sudo apt-get update sudo apt-get install --no-install-recommends -y libarchive-tools libopenjp2-tools rpm squashfs-tools sudo snap install snapcraft --classic - sudo snap install zig --classic --beta # We use Zig instead of glibc for cgo compilation as it is more-easily statically linked + - name: Install Zig (not Mac) + if: matrix.platform != 'darwin' + uses: mlugg/setup-zig@v1 # 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) diff --git a/.github/workflows/testdriver-build.yml b/.github/workflows/testdriver-build.yml index 793bd9c30c..028a9af688 100644 --- a/.github/workflows/testdriver-build.yml +++ b/.github/workflows/testdriver-build.yml @@ -57,6 +57,8 @@ jobs: with: version: 3.x repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Install Zig + uses: mlugg/setup-zig@v1 - name: Build run: task package diff --git a/BUILD.md b/BUILD.md index fe7f442f63..ded347dce3 100644 --- a/BUILD.md +++ b/BUILD.md @@ -50,11 +50,9 @@ For packaging, the following additional packages are required: #### Windows -You will need the GNU build toolchain installed in order for Go to work on Windows. In most cases, this requires installing MinGW-w64. +You will need the Zig [Zig](https://ziglang.org/) compiler for statically linking CGO. -The easiest way to install this is using MSYS2: https://www.msys2.org/ - -If you prefer an alternative method, you can find other methods here: https://www.mingw-w64.org/downloads/ +You can find installation instructions for Zig on Windows [here](https://ziglang.org/learn/getting-started/#managers). ### Task diff --git a/Taskfile.yml b/Taskfile.yml index d1212deebc..160142e472 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -150,6 +150,8 @@ tasks: vars: ARCHS: sh: echo {{if eq "arm" ARCH}}arm64{{else}}{{ARCH}}{{end}} + GO_ENV_VARS: + sh: echo "{{if eq "amd64" ARCH}}CC=\"zig cc -target x86_64-windows-gnu\"{{else}}CC=\"zig cc -target aarch64-windows-gnu\"{{end}}" build:server:linux: desc: Build the wavesrv component for Linux platforms (only generates artifacts for the current architecture). @@ -162,7 +164,7 @@ tasks: ARCHS: sh: echo {{if eq "arm" ARCH}}arm64{{else}}{{ARCH}}{{end}} GO_ENV_VARS: - sh: echo "{{if eq "amd64" ARCH}}CC=\"zig cc -target x86_64-linux-gnu.2.28\"{{end}}" + sh: echo "{{if eq "amd64" ARCH}}CC=\"zig cc -target x86_64-linux-gnu.2.28\"{{else}}CC=\"zig cc -target aarch64-linux-gnu.2.28\"{{end}}" build:server:internal: requires: