From a0503b5c2412d09b82b1d1b35f95086efd42ee9e Mon Sep 17 00:00:00 2001 From: bfren Date: Mon, 15 Aug 2022 15:46:14 +0100 Subject: [PATCH] [dotnet core] build for linux-musl-arm64 (#1174) * Adding aarch64 build * Removing workflow_dispatch * Re-adding x64 * Disable libgcrypt hash - #1173 * Adding sudo to gcrypt disable - #1173 * Remove sudo, put gcrypt disable before building source list - #1173 * Adding linux-musl-arm64 build to NuGet package - #1174 * Explain the gcrypt configuration hack --- .github/workflows/dotnet-core.yml | 36 +++++++++++++++++++++++++ packaging/dotnet-core/libsodium.pkgproj | 1 + 2 files changed, 37 insertions(+) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 2082aaeb..66746628 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -163,6 +163,31 @@ jobs: name: build-linux-musl-x64 path: .libsodium-build/lib/libsodium.so + build-linux-musl-arm64: + runs-on: ubuntu-latest + container: + image: alpine:3.15 + steps: + - name: Set up build environment + run: | + apk update + apk add alpine-sdk ca-certificates + - uses: actions/checkout@v1 + - name: configure + run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu + - name: make + run: make + - name: make check + run: make check + - name: make install + run: make install + - name: strip + run: strip --strip-all .libsodium-build/lib/libsodium.so + - uses: actions/upload-artifact@v2 + with: + name: build-linux-musl-arm64 + path: .libsodium-build/lib/libsodium.so + build-macos-x64: runs-on: macos-11 steps: @@ -203,6 +228,7 @@ jobs: - build-linux-glibc-arm - build-linux-glibc-arm64 - build-linux-musl + - build-linux-musl-arm64 - build-macos-x64 - build-macos-arm64 container: @@ -237,6 +263,10 @@ jobs: with: name: build-linux-musl-x64 path: .libsodium-pack/runtimes/linux-musl-x64/native/ + - uses: actions/download-artifact@v2 + with: + name: build-linux-musl-arm64 + path: .libsodium-pack/runtimes/linux-musl-arm64/native/ - uses: actions/download-artifact@v2 with: name: build-osx-x64 @@ -332,6 +362,12 @@ jobs: run: | export DEBIAN_FRONTEND=noninteractive + # On virtualization systems such as the one used by WSL2, the ARM crypto extensions + # don't work as expected. As a result, installing Ubuntu 20.04 fails during integrity + # checks. As a workaround, the following command disables hardware acceleration for + # gcrypt, which the apt-get command relies on. + mkdir -p /etc/gcrypt && echo all >> /etc/gcrypt/hwf.deny + cat <<-EOF | sudo tee /etc/apt/sources.list.d/multiarch.list >/dev/null deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal main restricted deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates main restricted diff --git a/packaging/dotnet-core/libsodium.pkgproj b/packaging/dotnet-core/libsodium.pkgproj index 0be9efb6..aa0f2aad 100644 --- a/packaging/dotnet-core/libsodium.pkgproj +++ b/packaging/dotnet-core/libsodium.pkgproj @@ -31,6 +31,7 @@ +