Merge branch 'next' into stable

* next:
  dotnet core: try fixing run-test-binaries-cross-plat
  dotnet core: try to fix build-linux-glibc-arm
  Add a simple test runner to zig-out/bin/
  build.zig: statically compile and install all the tests
  Use current versions of GitHub actions
This commit is contained in:
Frank Denis 2022-11-24 23:24:20 +01:00
commit eb04310952

View File

@ -10,16 +10,16 @@ jobs:
build-windows: build-windows:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- name: buildbase.bat - name: buildbase.bat
run: buildbase.bat ..\vs2022\libsodium.sln 17 run: buildbase.bat ..\vs2022\libsodium.sln 17
working-directory: builds/msvc/build/ working-directory: builds/msvc/build/
shell: cmd shell: cmd
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
name: build-win-x64 name: build-win-x64
path: bin/x64/Release/v143/dynamic/libsodium.dll path: bin/x64/Release/v143/dynamic/libsodium.dll
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
name: build-win-x86 name: build-win-x86
path: bin/Win32/Release/v143/dynamic/libsodium.dll path: bin/Win32/Release/v143/dynamic/libsodium.dll
@ -32,7 +32,7 @@ jobs:
- name: Set up build environment - name: Set up build environment
run: | run: |
apt-get update && apt-get install -y build-essential apt-get update && apt-get install -y build-essential
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- name: configure - name: configure
run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build
- name: make - name: make
@ -43,7 +43,7 @@ jobs:
run: make install run: make install
- name: strip - name: strip
run: strip --strip-all .libsodium-build/lib/libsodium.so run: strip --strip-all .libsodium-build/lib/libsodium.so
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
name: build-linux-x64 name: build-linux-x64
path: .libsodium-build/lib/libsodium.so path: .libsodium-build/lib/libsodium.so
@ -52,88 +52,60 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: ubuntu:16.04 image: ubuntu:16.04
options: --privileged
steps: steps:
- name: Set up build environment - name: Set up build environment
run: | run: |
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get install -y build-essential qemu binfmt-support qemu-user-static qemu-system-arm gcc-aarch64-linux-gnu libc6-arm64-cross
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
sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list
dpkg --add-architecture arm64 dpkg --add-architecture arm64
update-binfmts --enable qemu-aarch64
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 update-binfmts --display
ln -s /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.* /lib
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- name: configure - name: configure
run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu
- name: make - name: make
run: make -j $(nproc) run: make -j $(nproc)
- name: make check - name: make check
# Disable make check on this platform
if: ${{ false }}
run: | run: |
make check env LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib make check
- name: make install - name: make install
run: make install run: make install
- name: strip - name: strip
run: aarch64-linux-gnu-strip --strip-all .libsodium-build/lib/libsodium.so run: aarch64-linux-gnu-strip --strip-all .libsodium-build/lib/libsodium.so
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
name: build-linux-arm64 name: build-linux-arm64
path: .libsodium-build/lib/libsodium.so path: .libsodium-build/lib/libsodium.so
build-linux-glibc-arm: build-linux-glibc-arm:
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
container:
image: ubuntu:16.04
options: --privileged
steps: steps:
- name: Set up build environment - name: Set up build environment
run: | run: |
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get install -y build-essential qemu binfmt-support qemu-user-static qemu-system-arm gcc-arm-linux-gnueabihf libc6-armhf-cross
cat <<-EOF | sudo tee /etc/apt/sources.list.d/armhf.list >/dev/null dpkg --add-architecture armhf
deb [arch=armhf] http://ports.ubuntu.com/ focal main restricted update-binfmts --enable qemu-arm
deb [arch=armhf] http://ports.ubuntu.com/ focal-updates main restricted update-binfmts --display
deb [arch=armhf] http://ports.ubuntu.com/ focal universe ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.* /lib
deb [arch=armhf] http://ports.ubuntu.com/ focal-updates universe - uses: actions/checkout@v3
deb [arch=armhf] http://ports.ubuntu.com/ focal multiverse
deb [arch=armhf] http://ports.ubuntu.com/ focal-updates multiverse
deb [arch=armhf] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse
EOF
sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list
sudo dpkg --add-architecture armhf
sudo apt-get update && sudo apt-get install -y build-essential qemu-user qemu-user-static gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libstdc++6:armhf
- uses: actions/checkout@v1
- name: configure - name: configure
run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=arm-linux-gnueabihf run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=arm-linux-gnueabihf
- name: make - name: make
run: make -j $(nproc) run: make -j $(nproc)
- name: make check - name: make check
run: | run: |
make check env LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib make check
- name: make install - name: make install
run: make install run: make install
- name: strip - name: strip
run: arm-linux-gnueabihf-strip --strip-all .libsodium-build/lib/libsodium.so run: arm-linux-gnueabihf-strip --strip-all .libsodium-build/lib/libsodium.so
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
name: build-linux-arm name: build-linux-arm
path: .libsodium-build/lib/libsodium.so path: .libsodium-build/lib/libsodium.so
@ -141,13 +113,13 @@ jobs:
build-linux-musl: build-linux-musl:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: alpine:3.15 image: alpine:latest
steps: steps:
- name: Set up build environment - name: Set up build environment
run: | run: |
apk update apk update
apk add alpine-sdk ca-certificates apk add alpine-sdk ca-certificates
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- name: configure - name: configure
run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build
- name: make - name: make
@ -158,7 +130,7 @@ jobs:
run: make install run: make install
- name: strip - name: strip
run: strip --strip-all .libsodium-build/lib/libsodium.so run: strip --strip-all .libsodium-build/lib/libsodium.so
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
name: build-linux-musl-x64 name: build-linux-musl-x64
path: .libsodium-build/lib/libsodium.so path: .libsodium-build/lib/libsodium.so
@ -166,13 +138,13 @@ jobs:
build-linux-musl-arm64: build-linux-musl-arm64:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: alpine:3.15 image: alpine:latest
steps: steps:
- name: Set up build environment - name: Set up build environment
run: | run: |
apk update apk update
apk add alpine-sdk ca-certificates apk add alpine-sdk ca-certificates
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- name: configure - name: configure
run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu
- name: make - name: make
@ -183,7 +155,7 @@ jobs:
run: make install run: make install
- name: strip - name: strip
run: strip --strip-all .libsodium-build/lib/libsodium.so run: strip --strip-all .libsodium-build/lib/libsodium.so
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
name: build-linux-musl-arm64 name: build-linux-musl-arm64
path: .libsodium-build/lib/libsodium.so path: .libsodium-build/lib/libsodium.so
@ -191,16 +163,16 @@ jobs:
build-macos-x64: build-macos-x64:
runs-on: macos-11 runs-on: macos-11
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- name: configure - name: configure
run: env CFLAGS="-O2 -arch x86_64 -mmacosx-version-min=10.10" LDFLAGS="-arch x86_64 -mmacosx-version-min=10.10" ./configure --host=arm-apple-darwin20 --prefix=$PWD/.libsodium-build run: env CFLAGS="-Ofast -arch x86_64 -mmacosx-version-min=10.10" LDFLAGS="-arch x86_64 -mmacosx-version-min=10.10" ./configure --host=arm-apple-darwin20 --prefix=$PWD/.libsodium-build
- name: make - name: make
run: make run: make
- name: make check - name: make check
run: make check run: make check
- name: make install - name: make install
run: make install run: make install
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
name: build-osx-x64 name: build-osx-x64
path: .libsodium-build/lib/libsodium.dylib path: .libsodium-build/lib/libsodium.dylib
@ -208,14 +180,14 @@ jobs:
build-macos-arm64: build-macos-arm64:
runs-on: macos-11 runs-on: macos-11
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- name: configure - name: configure
run: env CFLAGS="-O2 -arch arm64 -mmacosx-version-min=10.10" LDFLAGS="-arch arm64 -mmacosx-version-min=10.10" ./configure --host=arm-apple-darwin20 --prefix=$PWD/.libsodium-build run: env CFLAGS="-Ofast -arch arm64 -mmacosx-version-min=10.10" LDFLAGS="-arch arm64 -mmacosx-version-min=10.10" ./configure --host=arm-apple-darwin20 --prefix=$PWD/.libsodium-build
- name: make - name: make
run: make run: make
- name: make install - name: make install
run: make install run: make install
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
name: build-osx-arm64 name: build-osx-arm64
path: .libsodium-build/lib/libsodium.dylib path: .libsodium-build/lib/libsodium.dylib
@ -238,40 +210,40 @@ jobs:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: build-win-x64 name: build-win-x64
path: .libsodium-pack/runtimes/win-x64/native/ path: .libsodium-pack/runtimes/win-x64/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: build-win-x86 name: build-win-x86
path: .libsodium-pack/runtimes/win-x86/native/ path: .libsodium-pack/runtimes/win-x86/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: build-linux-x64 name: build-linux-x64
path: .libsodium-pack/runtimes/linux-x64/native/ path: .libsodium-pack/runtimes/linux-x64/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: build-linux-arm64 name: build-linux-arm64
path: .libsodium-pack/runtimes/linux-arm64/native/ path: .libsodium-pack/runtimes/linux-arm64/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: build-linux-arm name: build-linux-arm
path: .libsodium-pack/runtimes/linux-arm/native/ path: .libsodium-pack/runtimes/linux-arm/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: build-linux-musl-x64 name: build-linux-musl-x64
path: .libsodium-pack/runtimes/linux-musl-x64/native/ path: .libsodium-pack/runtimes/linux-musl-x64/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: build-linux-musl-arm64 name: build-linux-musl-arm64
path: .libsodium-pack/runtimes/linux-musl-arm64/native/ path: .libsodium-pack/runtimes/linux-musl-arm64/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: build-osx-x64 name: build-osx-x64
path: .libsodium-pack/runtimes/osx-x64/native/ path: .libsodium-pack/runtimes/osx-x64/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: build-osx-arm64 name: build-osx-arm64
path: .libsodium-pack/runtimes/osx-arm64/native/ path: .libsodium-pack/runtimes/osx-arm64/native/
@ -279,7 +251,7 @@ jobs:
run: cp AUTHORS ChangeLog LICENSE packaging/dotnet-core/libsodium.pkgproj .libsodium-pack/ run: cp AUTHORS ChangeLog LICENSE packaging/dotnet-core/libsodium.pkgproj .libsodium-pack/
- name: Create NuGet package - name: Create NuGet package
run: dotnet pack -c Release .libsodium-pack/libsodium.pkgproj run: dotnet pack -c Release .libsodium-pack/libsodium.pkgproj
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
name: nuget-package name: nuget-package
path: .libsodium-pack/bin/Release/*.nupkg path: .libsodium-pack/bin/Release/*.nupkg
@ -295,8 +267,8 @@ jobs:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: nuget-package name: nuget-package
path: .libsodium-pack/ path: .libsodium-pack/
@ -321,7 +293,7 @@ jobs:
mv .libsodium-test/bin/Release/net6.0/linux-arm/publish .libsodium-builds/linux-arm mv .libsodium-test/bin/Release/net6.0/linux-arm/publish .libsodium-builds/linux-arm
mv .libsodium-test/bin/Release/net6.0/linux-arm64/publish .libsodium-builds/linux-arm64 mv .libsodium-test/bin/Release/net6.0/linux-arm64/publish .libsodium-builds/linux-arm64
mv .libsodium-test/bin/Release/net6.0/linux-x64/publish .libsodium-builds/linux-x64 mv .libsodium-test/bin/Release/net6.0/linux-x64/publish .libsodium-builds/linux-x64
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
name: test-builds name: test-builds
path: .libsodium-builds/* path: .libsodium-builds/*
@ -332,14 +304,14 @@ jobs:
- build-test-binaries - build-test-binaries
strategy: strategy:
matrix: matrix:
# CentOS 7 and Debian 9 use an older GCC version; make sure we can run on those platforms. # CentOS 7 and Debian 10 use an older GCC version; make sure we can run on those platforms.
arch: [ 'centos:7', 'debian:9' ] arch: [ 'centos:7', 'debian:10' ]
container: container:
image: ${{ matrix.arch }} image: ${{ matrix.arch }}
env: env:
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
steps: steps:
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: test-builds name: test-builds
path: .libsodium-builds/ path: .libsodium-builds/
@ -349,13 +321,20 @@ jobs:
.libsodium-builds/linux-x64/Tests .libsodium-builds/linux-x64/Tests
run-test-binaries-cross-plat: run-test-binaries-cross-plat:
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
needs: needs:
- build-test-binaries - build-test-binaries
env: env:
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
strategy: strategy:
matrix: matrix:
include:
- arch: x64
libs: /usr/lib
- arch: arm
libs: /usr/arm-linux-gnueabihf/lib
- arch: arm64
libs: /usr/aarch64-linux-gnu/lib
arch: [x64, arm, arm64] arch: [x64, arm, arm64]
steps: steps:
- name: Set up build environment - name: Set up build environment
@ -363,29 +342,21 @@ jobs:
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
# On virtualization systems such as the one used by WSL2, the ARM crypto extensions # 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 # don't work as expected. As a result, installing on Ubuntu fails during integrity
# checks. As a workaround, the following command disables hardware acceleration for # checks. As a workaround, the following command disables hardware acceleration for
# gcrypt, which the apt-get command relies on. # gcrypt, which the apt-get command relies on.
mkdir -p /etc/gcrypt && echo all >> /etc/gcrypt/hwf.deny sudo mkdir -p /etc/gcrypt && echo all | sudo tee /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
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal universe
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates universe
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal multiverse
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates multiverse
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse
EOF
sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list
sudo apt-get update && sudo apt-get install -y qemu binfmt-support qemu-user-static qemu-system-arm gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu libc6-armhf-cross libc6-arm64-cross
sudo dpkg --add-architecture armhf sudo dpkg --add-architecture armhf
sudo dpkg --add-architecture arm64 sudo dpkg --add-architecture arm64
sudo update-binfmts --enable qemu-aarch64
sudo update-binfmts --enable qemu-arm
sudo update-binfmts --display
sudo ln -s /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.* /lib
sudo ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.* /lib
sudo apt-get update && sudo apt-get install -y qemu-user qemu-user-static libstdc++6:armhf libstdc++6:arm64 - uses: actions/download-artifact@v3
- uses: actions/download-artifact@v2
with: with:
name: test-builds name: test-builds
path: .libsodium-builds/ path: .libsodium-builds/
@ -393,4 +364,4 @@ jobs:
- name: Run ${{ matrix.arch }} - name: Run ${{ matrix.arch }}
run: | run: |
chmod +x .libsodium-builds/linux-${{ matrix.arch }}/Tests chmod +x .libsodium-builds/linux-${{ matrix.arch }}/Tests
.libsodium-builds/linux-${{ matrix.arch }}/Tests env LD_LIBRARY_PATH=${{ matrix.libs }} .libsodium-builds/linux-${{ matrix.arch }}/Tests