From c19164f02ed2ccd1790b9485fa7dea14e1b0a876 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 23 Nov 2022 19:42:39 +0100 Subject: [PATCH 01/10] dotnet-core: bump GitHub actions versions, and use Ubuntu 18.04 as a base --- .github/workflows/dotnet-core.yml | 74 +++++++++++++++---------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 66746628..f06161a5 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -10,16 +10,16 @@ jobs: build-windows: runs-on: windows-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: buildbase.bat run: buildbase.bat ..\vs2022\libsodium.sln 17 working-directory: builds/msvc/build/ shell: cmd - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: build-win-x64 path: bin/x64/Release/v143/dynamic/libsodium.dll - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: build-win-x86 path: bin/Win32/Release/v143/dynamic/libsodium.dll @@ -27,12 +27,12 @@ jobs: build-linux-glibc: runs-on: ubuntu-latest container: - image: ubuntu:16.04 + image: ubuntu:18.04 steps: - name: Set up build environment run: | apt-get update && apt-get install -y build-essential - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: configure run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build - name: make @@ -43,7 +43,7 @@ jobs: run: make install - name: strip run: strip --strip-all .libsodium-build/lib/libsodium.so - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: build-linux-x64 path: .libsodium-build/lib/libsodium.so @@ -51,7 +51,7 @@ jobs: build-linux-glibc-arm64: runs-on: ubuntu-latest container: - image: ubuntu:16.04 + image: ubuntu:18.04 steps: - name: Set up build environment run: | @@ -73,7 +73,7 @@ jobs: 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 + - uses: actions/checkout@v3 - name: configure run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu - name: make @@ -90,7 +90,7 @@ jobs: - name: strip run: aarch64-linux-gnu-strip --strip-all .libsodium-build/lib/libsodium.so - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: build-linux-arm64 path: .libsodium-build/lib/libsodium.so @@ -118,7 +118,7 @@ jobs: 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 + - uses: actions/checkout@v3 - name: configure run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=arm-linux-gnueabihf - name: make @@ -133,7 +133,7 @@ jobs: - name: strip run: arm-linux-gnueabihf-strip --strip-all .libsodium-build/lib/libsodium.so - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: build-linux-arm path: .libsodium-build/lib/libsodium.so @@ -141,13 +141,13 @@ jobs: build-linux-musl: runs-on: ubuntu-latest container: - image: alpine:3.15 + image: alpine:3.17 steps: - name: Set up build environment run: | apk update apk add alpine-sdk ca-certificates - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: configure run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build - name: make @@ -158,7 +158,7 @@ jobs: run: make install - name: strip run: strip --strip-all .libsodium-build/lib/libsodium.so - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: build-linux-musl-x64 path: .libsodium-build/lib/libsodium.so @@ -166,13 +166,13 @@ jobs: build-linux-musl-arm64: runs-on: ubuntu-latest container: - image: alpine:3.15 + image: alpine:3.17 steps: - name: Set up build environment run: | apk update apk add alpine-sdk ca-certificates - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: configure run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu - name: make @@ -183,7 +183,7 @@ jobs: run: make install - name: strip run: strip --strip-all .libsodium-build/lib/libsodium.so - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: build-linux-musl-arm64 path: .libsodium-build/lib/libsodium.so @@ -191,7 +191,7 @@ jobs: build-macos-x64: runs-on: macos-11 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - 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 - name: make @@ -200,7 +200,7 @@ jobs: run: make check - name: make install run: make install - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: build-osx-x64 path: .libsodium-build/lib/libsodium.dylib @@ -208,14 +208,14 @@ jobs: build-macos-arm64: runs-on: macos-11 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - 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 - name: make run: make - name: make install run: make install - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: build-osx-arm64 path: .libsodium-build/lib/libsodium.dylib @@ -238,40 +238,40 @@ jobs: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 steps: - - uses: actions/checkout@v1 - - uses: actions/download-artifact@v2 + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 with: name: build-win-x64 path: .libsodium-pack/runtimes/win-x64/native/ - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: build-win-x86 path: .libsodium-pack/runtimes/win-x86/native/ - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: build-linux-x64 path: .libsodium-pack/runtimes/linux-x64/native/ - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: build-linux-arm64 path: .libsodium-pack/runtimes/linux-arm64/native/ - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: build-linux-arm path: .libsodium-pack/runtimes/linux-arm/native/ - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: build-linux-musl-x64 path: .libsodium-pack/runtimes/linux-musl-x64/native/ - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: build-linux-musl-arm64 path: .libsodium-pack/runtimes/linux-musl-arm64/native/ - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: build-osx-x64 path: .libsodium-pack/runtimes/osx-x64/native/ - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: build-osx-arm64 path: .libsodium-pack/runtimes/osx-arm64/native/ @@ -279,7 +279,7 @@ jobs: run: cp AUTHORS ChangeLog LICENSE packaging/dotnet-core/libsodium.pkgproj .libsodium-pack/ - name: Create NuGet package run: dotnet pack -c Release .libsodium-pack/libsodium.pkgproj - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: nuget-package path: .libsodium-pack/bin/Release/*.nupkg @@ -295,8 +295,8 @@ jobs: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 steps: - - uses: actions/checkout@v1 - - uses: actions/download-artifact@v2 + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 with: name: nuget-package path: .libsodium-pack/ @@ -321,7 +321,7 @@ jobs: 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-x64/publish .libsodium-builds/linux-x64 - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: test-builds path: .libsodium-builds/* @@ -339,7 +339,7 @@ jobs: env: DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: test-builds path: .libsodium-builds/ @@ -385,7 +385,7 @@ jobs: sudo apt-get update && sudo apt-get install -y qemu-user qemu-user-static libstdc++6:armhf libstdc++6:arm64 - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: test-builds path: .libsodium-builds/ From 9ee4e3ddb487fe14a4d4834b8f291c34044c2f55 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 23 Nov 2022 19:44:10 +0100 Subject: [PATCH 02/10] Use current versions of GitHub actions --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/codeql-analysis.yml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37f7d130..a89c5c92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: tcc: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Update packages list run: sudo apt-get update @@ -35,7 +35,7 @@ jobs: zig: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Update packages list run: sudo apt-get update @@ -65,7 +65,7 @@ jobs: regular: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Update packages list run: sudo apt-get update @@ -94,7 +94,7 @@ jobs: check-globals: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Update packages list run: sudo apt-get update @@ -112,7 +112,7 @@ jobs: other-comp: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Update packages list run: sudo apt-get update @@ -138,7 +138,7 @@ jobs: other-arch: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Update packages list run: sudo apt-get update diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a3e482a6..86b84fb7 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,12 +12,12 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: cpp @@ -27,4 +27,4 @@ jobs: make -j $(nproc) check - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 From 1bc69129430473dca31b56d8e63ffb158bf55064 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 23 Nov 2022 19:56:12 +0100 Subject: [PATCH 03/10] dotnet-core: build on Ubuntu 18.04, don't import backports Backports are going to be removed in a couple weeks when the distro will reach EOL. --- .github/workflows/dotnet-core.yml | 35 ++++++++++++++----------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index f06161a5..5ab20bf7 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -58,13 +58,12 @@ jobs: export DEBIAN_FRONTEND=noninteractive 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 + deb [arch=arm64] http://ports.ubuntu.com/ bionic main restricted + deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates main restricted + deb [arch=arm64] http://ports.ubuntu.com/ bionic universe + deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates universe + deb [arch=arm64] http://ports.ubuntu.com/ bionic multiverse + deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates multiverse EOF sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list @@ -96,20 +95,19 @@ jobs: path: .libsodium-build/lib/libsodium.so build-linux-glibc-arm: - runs-on: ubuntu-20.04 + runs-on: ubuntu-18.04 steps: - name: Set up build environment run: | export DEBIAN_FRONTEND=noninteractive cat <<-EOF | sudo tee /etc/apt/sources.list.d/armhf.list >/dev/null - deb [arch=armhf] http://ports.ubuntu.com/ focal main restricted - deb [arch=armhf] http://ports.ubuntu.com/ focal-updates main restricted - deb [arch=armhf] http://ports.ubuntu.com/ focal universe - deb [arch=armhf] http://ports.ubuntu.com/ focal-updates universe - 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 + deb [arch=armhf] http://ports.ubuntu.com/ bionic main restricted + deb [arch=armhf] http://ports.ubuntu.com/ bionic-updates main restricted + deb [arch=armhf] http://ports.ubuntu.com/ bionic universe + deb [arch=armhf] http://ports.ubuntu.com/ bionic-updates universe + deb [arch=armhf] http://ports.ubuntu.com/ bionic multiverse + deb [arch=armhf] http://ports.ubuntu.com/ bionic-updates multiverse EOF sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list @@ -193,7 +191,7 @@ jobs: steps: - uses: actions/checkout@v3 - 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 run: make - name: make check @@ -210,7 +208,7 @@ jobs: steps: - uses: actions/checkout@v3 - 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 run: make - name: make install @@ -363,7 +361,7 @@ jobs: 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 + # don't work as expected. As a result, installing Ubuntu 18.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 @@ -375,7 +373,6 @@ jobs: 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 From a0ebe66e6f1fe4214c8ad8075cc4437164844202 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 23 Nov 2022 20:05:50 +0100 Subject: [PATCH 04/10] Current LTS version of Ubuntu is 22.04 -- Test on that one --- .github/workflows/dotnet-core.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 5ab20bf7..10c4ffcc 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -347,7 +347,7 @@ jobs: .libsodium-builds/linux-x64/Tests run-test-binaries-cross-plat: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: - build-test-binaries env: @@ -361,18 +361,18 @@ jobs: 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 18.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 # 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 - 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/ jammy main restricted + deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-updates main restricted + deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy universe + deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-updates universe + deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy multiverse + deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-updates multiverse EOF sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list From e15ded0cef4fd799de37b5f1e5cab69ec6f49261 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 23 Nov 2022 20:13:26 +0100 Subject: [PATCH 05/10] Debian 9 has reached EOL 2 years ago --- .github/workflows/dotnet-core.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 10c4ffcc..75afe664 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -330,8 +330,8 @@ jobs: - 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' ] + # CentOS 7 and Debian 10 use an older GCC version; make sure we can run on those platforms. + arch: [ 'centos:7', 'debian:10' ] container: image: ${{ matrix.arch }} env: From a4a6e64f2be43ee585b00c338b2bdd4bc061bf5e Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 23 Nov 2022 20:20:10 +0100 Subject: [PATCH 06/10] Back to Xenial in order to build code that works on CentOS 7 This is going to be an issue soon. Maybe we should use CentOS 7 directly to test? --- .github/workflows/dotnet-core.yml | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 75afe664..44b06db9 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -27,7 +27,7 @@ jobs: build-linux-glibc: runs-on: ubuntu-latest container: - image: ubuntu:18.04 + image: ubuntu:16.04 steps: - name: Set up build environment run: | @@ -51,26 +51,26 @@ jobs: build-linux-glibc-arm64: runs-on: ubuntu-latest container: - image: ubuntu:18.04 + image: ubuntu:16.04 steps: - name: Set up build environment run: | export DEBIAN_FRONTEND=noninteractive cat <<-EOF | tee /etc/apt/sources.list.d/arm64.list >/dev/null - deb [arch=arm64] http://ports.ubuntu.com/ bionic main restricted - deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates main restricted - deb [arch=arm64] http://ports.ubuntu.com/ bionic universe - deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates universe - deb [arch=arm64] http://ports.ubuntu.com/ bionic multiverse - deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates multiverse + 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 EOF sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list dpkg --add-architecture 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 + apt-get update && apt-get install -y build-essential qemu-user qemu-user-static gcc-aarch64-linux-gnu - uses: actions/checkout@v3 - name: configure @@ -95,26 +95,26 @@ jobs: path: .libsodium-build/lib/libsodium.so build-linux-glibc-arm: - runs-on: ubuntu-18.04 + runs-on: ubuntu-16.04 steps: - name: Set up build environment run: | export DEBIAN_FRONTEND=noninteractive cat <<-EOF | sudo tee /etc/apt/sources.list.d/armhf.list >/dev/null - deb [arch=armhf] http://ports.ubuntu.com/ bionic main restricted - deb [arch=armhf] http://ports.ubuntu.com/ bionic-updates main restricted - deb [arch=armhf] http://ports.ubuntu.com/ bionic universe - deb [arch=armhf] http://ports.ubuntu.com/ bionic-updates universe - deb [arch=armhf] http://ports.ubuntu.com/ bionic multiverse - deb [arch=armhf] http://ports.ubuntu.com/ bionic-updates multiverse + deb [arch=armhf] http://ports.ubuntu.com/ xenial main restricted + deb [arch=armhf] http://ports.ubuntu.com/ xenial-updates main restricted + deb [arch=armhf] http://ports.ubuntu.com/ xenial universe + deb [arch=armhf] http://ports.ubuntu.com/ xenial-updates universe + deb [arch=armhf] http://ports.ubuntu.com/ xenial multiverse + deb [arch=armhf] http://ports.ubuntu.com/ xenial-updates 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 + sudo apt-get update && sudo apt-get install -y build-essential qemu-user qemu-user-static gcc-arm-linux-gnueabihf - uses: actions/checkout@v3 - name: configure @@ -139,7 +139,7 @@ jobs: build-linux-musl: runs-on: ubuntu-latest container: - image: alpine:3.17 + image: alpine:latest steps: - name: Set up build environment run: | @@ -164,7 +164,7 @@ jobs: build-linux-musl-arm64: runs-on: ubuntu-latest container: - image: alpine:3.17 + image: alpine:latest steps: - name: Set up build environment run: | From 9159da5c8a7f1cfd3270ad5dfab8abe307d16285 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 23 Nov 2022 21:07:55 +0100 Subject: [PATCH 07/10] build.zig: statically compile and install all the tests --- build.zig | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/build.zig b/build.zig index faa019d8..a1e819fe 100644 --- a/build.zig +++ b/build.zig @@ -93,4 +93,34 @@ pub fn build(b: *std.build.Builder) !void { } } } + + const test_path = "test/default"; + const out_bin_path = "zig-out/bin"; + const test_dir = try fs.Dir.openIterableDir(fs.cwd(), test_path, .{ .no_follow = true }); + fs.Dir.makePath(fs.cwd(), out_bin_path) catch {}; + const out_bin_dir = try fs.Dir.openDir(fs.cwd(), out_bin_path, .{}); + var allocator = heap.page_allocator; + var walker = try test_dir.walk(allocator); + while (try walker.next()) |entry| { + const name = entry.basename; + if (mem.endsWith(u8, name, ".exp")) { + try test_dir.dir.copyFile(name, out_bin_dir, name, .{}); + continue; + } + if (!mem.endsWith(u8, name, ".c")) { + continue; + } + const exe_name = name[0 .. name.len - 2]; + var exe = b.addExecutable(exe_name, null); + exe.setTarget(target); + exe.setBuildMode(mode); + exe.linkLibC(); + exe.linkLibrary(static); + exe.addIncludePath("src/libsodium/include"); + exe.addIncludePath("test/quirks"); + const full_path = try fmt.allocPrint(allocator, "{s}/{s}", .{ test_path, entry.path }); + exe.addCSourceFiles(&.{full_path}, &.{}); + exe.strip = true; + exe.install(); + } } From 03137a5817d1ed867976cfe55e86a1ee9202d8d7 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 23 Nov 2022 21:32:10 +0100 Subject: [PATCH 08/10] Add a simple test runner to zig-out/bin/ --- build.zig | 1 + test/default/Makefile.am | 1 + test/default/run.sh | 9 +++++++++ 3 files changed, 11 insertions(+) create mode 100755 test/default/run.sh diff --git a/build.zig b/build.zig index a1e819fe..9c621c53 100644 --- a/build.zig +++ b/build.zig @@ -99,6 +99,7 @@ pub fn build(b: *std.build.Builder) !void { const test_dir = try fs.Dir.openIterableDir(fs.cwd(), test_path, .{ .no_follow = true }); fs.Dir.makePath(fs.cwd(), out_bin_path) catch {}; const out_bin_dir = try fs.Dir.openDir(fs.cwd(), out_bin_path, .{}); + try test_dir.dir.copyFile("run.sh", out_bin_dir, "run.sh", .{}); var allocator = heap.page_allocator; var walker = try test_dir.walk(allocator); while (try walker.next()) |entry| { diff --git a/test/default/Makefile.am b/test/default/Makefile.am index 12aa7eb4..d319160d 100644 --- a/test/default/Makefile.am +++ b/test/default/Makefile.am @@ -1,5 +1,6 @@ EXTRA_DIST = \ + run.sh \ cmptest.h \ wasi-test-wrapper.sh \ wintest.bat \ diff --git a/test/default/run.sh b/test/default/run.sh new file mode 100755 index 00000000..9e792b50 --- /dev/null +++ b/test/default/run.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +find . -type f -perm +100 -print | grep -v run.sh | sort | while read -r x; do + echo "[$x]" + if ! "$x"; then + echo "*** [$x] FAILED" >&2 + exit 1 + fi +done From 23b3ca60163a410f14dd09a8cb8db54b816efa75 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 24 Nov 2022 19:02:00 +0100 Subject: [PATCH 09/10] dotnet core: try to fix build-linux-glibc-arm --- .github/workflows/dotnet-core.yml | 79 +++++++++---------------------- 1 file changed, 23 insertions(+), 56 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 44b06db9..d4fb15e4 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -52,41 +52,26 @@ jobs: runs-on: ubuntu-latest container: image: ubuntu:16.04 + options: --privileged steps: - name: Set up build environment run: | export DEBIAN_FRONTEND=noninteractive - - 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 - EOF - - sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list - + 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 dpkg --add-architecture arm64 - - apt-get update && apt-get install -y build-essential qemu-user qemu-user-static gcc-aarch64-linux-gnu - + update-binfmts --enable qemu-aarch64 + update-binfmts --display + ln -s /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.* /lib - uses: actions/checkout@v3 - name: configure run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu - name: make run: make -j $(nproc) - - name: make check - # Disable make check on this platform - if: ${{ false }} run: | - make check - + env LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib make check - name: make install run: make install - - name: strip run: aarch64-linux-gnu-strip --strip-all .libsodium-build/lib/libsodium.so - uses: actions/upload-artifact@v3 @@ -95,40 +80,29 @@ jobs: path: .libsodium-build/lib/libsodium.so build-linux-glibc-arm: - runs-on: ubuntu-16.04 + runs-on: ubuntu-latest + container: + image: ubuntu:16.04 + options: --privileged steps: - name: Set up build environment run: | export DEBIAN_FRONTEND=noninteractive - - cat <<-EOF | sudo tee /etc/apt/sources.list.d/armhf.list >/dev/null - deb [arch=armhf] http://ports.ubuntu.com/ xenial main restricted - deb [arch=armhf] http://ports.ubuntu.com/ xenial-updates main restricted - deb [arch=armhf] http://ports.ubuntu.com/ xenial universe - deb [arch=armhf] http://ports.ubuntu.com/ xenial-updates universe - deb [arch=armhf] http://ports.ubuntu.com/ xenial multiverse - deb [arch=armhf] http://ports.ubuntu.com/ xenial-updates 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 - + 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 + dpkg --add-architecture armhf + update-binfmts --enable qemu-arm + update-binfmts --display + ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.* /lib - uses: actions/checkout@v3 - name: configure run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=arm-linux-gnueabihf - name: make run: make -j $(nproc) - - name: make check run: | - make check - + env LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib make check - name: make install run: make install - - name: strip run: arm-linux-gnueabihf-strip --strip-all .libsodium-build/lib/libsodium.so - uses: actions/upload-artifact@v3 @@ -364,23 +338,16 @@ jobs: # 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 # 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/ jammy main restricted - deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-updates main restricted - deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy universe - deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-updates universe - deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy multiverse - deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-updates multiverse - EOF - - sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list + sudo mkdir -p /etc/gcrypt && echo all | sudo tee /etc/gcrypt/hwf.deny + sudo apt-get update && sudo apt-get install -y qemu binfmt-support qemu-user-static qemu-system-arm gcc-arm-linux-gnueabihf libc6-armhf-cross libc6-arm64-cross sudo dpkg --add-architecture armhf sudo dpkg --add-architecture arm64 - - sudo apt-get update && sudo apt-get install -y qemu-user qemu-user-static libstdc++6:armhf libstdc++6: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 - uses: actions/download-artifact@v3 with: From 84697a789db5d335669073b8b88e1512da0b6633 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 24 Nov 2022 22:48:10 +0100 Subject: [PATCH 10/10] dotnet core: try fixing run-test-binaries-cross-plat --- .github/workflows/dotnet-core.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index d4fb15e4..0f45beac 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -328,6 +328,13 @@ jobs: DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 strategy: 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] steps: - name: Set up build environment @@ -340,7 +347,7 @@ jobs: # gcrypt, which the apt-get command relies on. sudo mkdir -p /etc/gcrypt && echo all | sudo tee /etc/gcrypt/hwf.deny - sudo apt-get update && sudo apt-get install -y qemu binfmt-support qemu-user-static qemu-system-arm gcc-arm-linux-gnueabihf libc6-armhf-cross libc6-arm64-cross + 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 arm64 sudo update-binfmts --enable qemu-aarch64 @@ -357,4 +364,4 @@ jobs: - name: Run ${{ matrix.arch }} run: | 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