From 32cba2b5e90c2b98b61e8cc4c8105c0a27725fb0 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 27 Feb 2022 11:39:46 +0100 Subject: [PATCH] Build dotnet core x64 binaries in Ubuntu 16.04 ...to provide support for CentOS 7 and Debian 9 Contributed by @enclave-alistair Fixes #1099 --- .github/workflows/dotnet-core.yml | 60 ++++++++++++++++++------- packaging/dotnet-core/libsodium.pkgproj | 2 +- packaging/nuget/package.config | 2 +- 3 files changed, 45 insertions(+), 19 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 79d95405..98d57a22 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -12,22 +12,22 @@ jobs: steps: - uses: actions/checkout@v1 - name: buildbase.bat - run: buildbase.bat ..\vs2019\libsodium.sln 16 + run: buildbase.bat ..\vs2022\libsodium.sln 17 working-directory: builds/msvc/build/ shell: cmd - uses: actions/upload-artifact@v2 with: name: build-win-x64 - path: bin/x64/Release/v142/dynamic/libsodium.dll + path: bin/x64/Release/v143/dynamic/libsodium.dll - uses: actions/upload-artifact@v2 with: name: build-win-x86 - path: bin/Win32/Release/v142/dynamic/libsodium.dll + path: bin/Win32/Release/v143/dynamic/libsodium.dll build-linux-glibc: runs-on: ubuntu-latest container: - image: ubuntu:20.04 + image: ubuntu:16.04 steps: - name: Set up build environment run: | @@ -50,26 +50,28 @@ jobs: build-linux-glibc-arm64: runs-on: ubuntu-latest + container: + image: ubuntu:16.04 steps: - name: Set up build environment run: | export DEBIAN_FRONTEND=noninteractive - cat <<-EOF | sudo tee /etc/apt/sources.list.d/arm64.list >/dev/null - deb [arch=arm64] http://ports.ubuntu.com/ focal main restricted - deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main restricted - deb [arch=arm64] http://ports.ubuntu.com/ focal universe - deb [arch=arm64] http://ports.ubuntu.com/ focal-updates universe - deb [arch=arm64] http://ports.ubuntu.com/ focal multiverse - deb [arch=arm64] http://ports.ubuntu.com/ focal-updates multiverse - deb [arch=arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse + cat <<-EOF | tee /etc/apt/sources.list.d/arm64.list >/dev/null + deb [arch=arm64] http://ports.ubuntu.com/ xenial main restricted + deb [arch=arm64] http://ports.ubuntu.com/ xenial-updates main restricted + deb [arch=arm64] http://ports.ubuntu.com/ xenial universe + deb [arch=arm64] http://ports.ubuntu.com/ xenial-updates universe + deb [arch=arm64] http://ports.ubuntu.com/ xenial multiverse + deb [arch=arm64] http://ports.ubuntu.com/ xenial-updates multiverse + deb [arch=arm64] http://ports.ubuntu.com/ xenial-backports main restricted universe multiverse EOF - sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list + sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list - sudo dpkg --add-architecture arm64 + dpkg --add-architecture arm64 - sudo apt-get update && sudo apt-get install -y build-essential qemu-user qemu-user-static gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libstdc++6:arm64 + apt-get update && apt-get install -y build-essential qemu-user qemu-user-static gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libstdc++6:arm64 - uses: actions/checkout@v1 - name: configure @@ -78,6 +80,8 @@ jobs: run: make -j $(nproc) - name: make check + # Disable make check on this platform + if: ${{ false }} run: | make check @@ -137,7 +141,7 @@ jobs: build-linux-musl: runs-on: ubuntu-latest container: - image: alpine:3.13 + image: alpine:3.15 steps: - name: Set up build environment run: | @@ -292,7 +296,29 @@ jobs: name: test-builds path: .libsodium-builds/* - run-test-binaries: + run-test-binaries-os-versions: + runs-on: ubuntu-latest + needs: + - build-test-binaries + strategy: + matrix: + # CentOS 7 and Debian 9 use an older GCC version; make sure we can run on those platforms. + arch: [ 'centos:7', 'debian:9' ] + container: + image: ${{ matrix.arch }} + env: + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 + steps: + - uses: actions/download-artifact@v2 + with: + name: test-builds + path: .libsodium-builds/ + - name: Run x64 tests + run: | + chmod +x .libsodium-builds/linux-x64/Tests + .libsodium-builds/linux-x64/Tests + + run-test-binaries-cross-plat: runs-on: ubuntu-20.04 needs: - build-test-binaries diff --git a/packaging/dotnet-core/libsodium.pkgproj b/packaging/dotnet-core/libsodium.pkgproj index ccc0a9e5..aea77343 100644 --- a/packaging/dotnet-core/libsodium.pkgproj +++ b/packaging/dotnet-core/libsodium.pkgproj @@ -9,7 +9,7 @@ libsodium - 1.0.18.1 + 1.0.18.2 Frank Denis Internal implementation package not meant for direct consumption. Please do not reference directly. © $([System.DateTime]::UtcNow.ToString(yyyy)) Frank Denis diff --git a/packaging/nuget/package.config b/packaging/nuget/package.config index 729035fc..9a0f1603 100644 --- a/packaging/nuget/package.config +++ b/packaging/nuget/package.config @@ -1,4 +1,4 @@ - +