From 937487bfbe171bc23c9d9df6b6f1dc6117d8e3e2 Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 16 Jun 2024 15:29:08 +0100 Subject: [PATCH 01/12] Add script to build with libc musl --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cb8edea..a40b7db 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,9 @@ "test": "standard && tape test/net.js test/sockets.js test/udp.js", "install": "node-gyp-build", "fetch-libutp": "git submodule update --recursive --init", - "prebuild": "prebuildify --napi --strip", - "prebuild-ia32": "prebuildify --napi --strip --arch=ia32" + "prebuild": "prebuildify --napi --strip --tag-libc", + "prebuild-musl": "prebuildify --napi --strip --libc=musl --tag-libc", + "prebuild-ia32": "prebuildify --napi --strip --arch=ia32 --tag-libc" }, "bin": { "ucat": "./ucat.js" From b8367ce3c692b73d56e482b460e9917157bbf14e Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 16 Jun 2024 15:48:04 +0100 Subject: [PATCH 02/12] Install and build musl --- .github/workflows/build-release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 01357f9..99fe879 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -15,9 +15,12 @@ jobs: - uses: actions/setup-node@v1 with: node-version: 14.x + - run: sudo apt install -y musl + if: ${{ matrix.os == 'ubuntu-16.04' }} - run: npm run fetch-libutp - run: npm install - run: npm run prebuild + - run: npm run prebuild-musl - run: npm run prebuild-ia32 if: ${{ matrix.os == 'windows-latest' }} - uses: actions/upload-artifact@v2 From f2c0d1ace70b1bc97d575bb4cc88ffec5c0b858a Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 16 Jun 2024 15:59:08 +0100 Subject: [PATCH 03/12] fix: bump nodejs to 16 --- .github/workflows/build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 99fe879..37105a4 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v2.1.0 - uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 16.x - run: sudo apt install -y musl if: ${{ matrix.os == 'ubuntu-16.04' }} - run: npm run fetch-libutp From fa7ab7262a3d24e3d30c7f82ef41ebc79873a206 Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 16 Jun 2024 16:07:36 +0100 Subject: [PATCH 04/12] fix: update submodule to use https source, as git:// appears to be failing. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 3da5228..218e15f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "libutp"] path = deps/libutp - url = git://github.com/mafintosh/libutp.git + url = https://github.com/mafintosh/libutp.git From b686256d6e69d1aa2f45eb9c8cfe89adda30169d Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 16 Jun 2024 16:28:29 +0100 Subject: [PATCH 05/12] fix: ensure a newer version of node-gyp is installed which supports Python 3.12, which is now default for the version of the ubuntu 16 action runner. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a40b7db..512dd70 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "devDependencies": { "prebuildify": "^4.1.2", "standard": "^14.3.1", - "tape": "^4.11.0" + "tape": "^4.11.0", + "node-gyp": "^10.1.0" }, "repository": { "type": "git", From 7780dc0730af499fa89bb3470f7f649905c66358 Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 16 Jun 2024 16:34:32 +0100 Subject: [PATCH 06/12] fix: update runner to use ubuntu-latest, as ubuntu-16.04 runner is discontinued. --- .github/workflows/build-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 37105a4..1ad4d0c 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -7,7 +7,7 @@ jobs: build: strategy: matrix: - os: [windows-latest, macos-latest, ubuntu-16.04] + os: [windows-latest, macos-latest, ubuntu-latest] runs-on: ${{ matrix.os }} name: Build steps: @@ -16,7 +16,7 @@ jobs: with: node-version: 16.x - run: sudo apt install -y musl - if: ${{ matrix.os == 'ubuntu-16.04' }} + if: ${{ matrix.os == 'ubuntu-latest' }} - run: npm run fetch-libutp - run: npm install - run: npm run prebuild From 66f3c55176762eda0d1731f328bbc48671062789 Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 16 Jun 2024 16:39:11 +0100 Subject: [PATCH 07/12] fix: forgot to update the release runner... --- .github/workflows/build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 1ad4d0c..7d4bba3 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -29,7 +29,7 @@ jobs: path: ./prebuilds release: name: Create Release - runs-on: ubuntu-16.04 + runs-on: ubuntu-latest needs: build steps: - name: Checkout code From f92dac737ad915b030d70c4b63b91ef19a0efe29 Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 16 Jun 2024 16:45:00 +0100 Subject: [PATCH 08/12] fix: directory name --- .github/workflows/build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 7d4bba3..325ecbf 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -54,7 +54,7 @@ jobs: - name: Compress builds run: | tar --create --verbose --file="./${{ steps.get_version.outputs.VERSION }}-windows-all.tar" --directory "prebuilds/windows-latest" . - tar --create --verbose --file="./${{ steps.get_version.outputs.VERSION }}-linux-x86.tar" --directory "prebuilds/ubuntu-16.04" . + tar --create --verbose --file="./${{ steps.get_version.outputs.VERSION }}-linux-x86.tar" --directory "prebuilds/ubuntu-latest" . tar --create --verbose --file="./${{ steps.get_version.outputs.VERSION }}-osx-x86.tar" --directory "prebuilds/macos-latest" . - name: Upload x86 build uses: actions/upload-release-asset@v1 From 55ed184558343e97dd85ebd69bc3c381fb34de51 Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 16 Jun 2024 17:07:01 +0100 Subject: [PATCH 09/12] fix: add musl specific build path, as previous outputs were the exact same, as while being tagged with musl, nothing musl was actually being set. --- .github/workflows/build-release.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 325ecbf..43119c8 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -15,14 +15,18 @@ jobs: - uses: actions/setup-node@v1 with: node-version: 16.x - - run: sudo apt install -y musl + - run: sudo apt install -y musl musl-tools if: ${{ matrix.os == 'ubuntu-latest' }} - run: npm run fetch-libutp - run: npm install - run: npm run prebuild - - run: npm run prebuild-musl - run: npm run prebuild-ia32 if: ${{ matrix.os == 'windows-latest' }} + - run: npm run prebuild-musl + if: ${{ matrix.os == 'ubuntu-latest' }} + env: + CC: musl-gcc + CXX: musl-gcc - uses: actions/upload-artifact@v2 with: name: ${{ matrix.os }} From 65ed9c90205e40f002c6b9e27449fbe71aed19b0 Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 16 Jun 2024 17:15:32 +0100 Subject: [PATCH 10/12] fix: provide permissions to perform releases, unsure how the last run worked though. --- .github/workflows/build-release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 43119c8..4fba594 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -35,6 +35,8 @@ jobs: name: Create Release runs-on: ubuntu-latest needs: build + permissions: + contents: write steps: - name: Checkout code uses: actions/checkout@v2 From 258286c4e0416f8cdebebc34de408ad83e184ffb Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 23 Jun 2024 15:33:36 +0100 Subject: [PATCH 11/12] Update build-release.yml to use older ubuntu for build This ensures that we use an early version of glibc is used to provide the widest compatibility. --- .github/workflows/build-release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 4fba594..87db8e8 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -7,7 +7,7 @@ jobs: build: strategy: matrix: - os: [windows-latest, macos-latest, ubuntu-latest] + os: [windows-latest, macos-latest, ubuntu-18.04] runs-on: ${{ matrix.os }} name: Build steps: @@ -16,14 +16,14 @@ jobs: with: node-version: 16.x - run: sudo apt install -y musl musl-tools - if: ${{ matrix.os == 'ubuntu-latest' }} + if: ${{ matrix.os == 'ubuntu-18.04' }} - run: npm run fetch-libutp - run: npm install - run: npm run prebuild - run: npm run prebuild-ia32 if: ${{ matrix.os == 'windows-latest' }} - run: npm run prebuild-musl - if: ${{ matrix.os == 'ubuntu-latest' }} + if: ${{ matrix.os == 'ubuntu-18.04' }} env: CC: musl-gcc CXX: musl-gcc @@ -60,7 +60,7 @@ jobs: - name: Compress builds run: | tar --create --verbose --file="./${{ steps.get_version.outputs.VERSION }}-windows-all.tar" --directory "prebuilds/windows-latest" . - tar --create --verbose --file="./${{ steps.get_version.outputs.VERSION }}-linux-x86.tar" --directory "prebuilds/ubuntu-latest" . + tar --create --verbose --file="./${{ steps.get_version.outputs.VERSION }}-linux-x86.tar" --directory "prebuilds/ubuntu-18.04" . tar --create --verbose --file="./${{ steps.get_version.outputs.VERSION }}-osx-x86.tar" --directory "prebuilds/macos-latest" . - name: Upload x86 build uses: actions/upload-release-asset@v1 From 83a9ac5a24bce4a96377848167a15ac675580d9a Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 23 Jun 2024 15:37:54 +0100 Subject: [PATCH 12/12] Update build-release.yml to Ubuntu 20.04 Update ubuntu 18.04 to 20.04 as the runner for 18.04 was removed earlier this year, causing the run to hang. --- .github/workflows/build-release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 87db8e8..aa9b328 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -7,7 +7,7 @@ jobs: build: strategy: matrix: - os: [windows-latest, macos-latest, ubuntu-18.04] + os: [windows-latest, macos-latest, ubuntu-20.04] runs-on: ${{ matrix.os }} name: Build steps: @@ -16,14 +16,14 @@ jobs: with: node-version: 16.x - run: sudo apt install -y musl musl-tools - if: ${{ matrix.os == 'ubuntu-18.04' }} + if: ${{ matrix.os == 'ubuntu-20.04' }} - run: npm run fetch-libutp - run: npm install - run: npm run prebuild - run: npm run prebuild-ia32 if: ${{ matrix.os == 'windows-latest' }} - run: npm run prebuild-musl - if: ${{ matrix.os == 'ubuntu-18.04' }} + if: ${{ matrix.os == 'ubuntu-20.04' }} env: CC: musl-gcc CXX: musl-gcc @@ -60,7 +60,7 @@ jobs: - name: Compress builds run: | tar --create --verbose --file="./${{ steps.get_version.outputs.VERSION }}-windows-all.tar" --directory "prebuilds/windows-latest" . - tar --create --verbose --file="./${{ steps.get_version.outputs.VERSION }}-linux-x86.tar" --directory "prebuilds/ubuntu-18.04" . + tar --create --verbose --file="./${{ steps.get_version.outputs.VERSION }}-linux-x86.tar" --directory "prebuilds/ubuntu-20.04" . tar --create --verbose --file="./${{ steps.get_version.outputs.VERSION }}-osx-x86.tar" --directory "prebuilds/macos-latest" . - name: Upload x86 build uses: actions/upload-release-asset@v1