From c516ceb32815a9d66e0cbe3d0d111f382eff55f2 Mon Sep 17 00:00:00 2001 From: Andreas Gruber Date: Thu, 16 Jul 2026 15:39:19 +0200 Subject: [PATCH 01/12] Add more verbose config --- .github/workflows/build.yml | 51 ++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c5c34f13..58a2e7944 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,20 +1,47 @@ name: Build on: push: - branches: [ master ] + branches: [ dockerbuild ] + jobs: build: - runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [windows-latest, macos-15, ubuntu-24.04, ubuntu-24.04-arm] + config: + - { + name: "Windows Latest", + os: windows-latest + } + - { + name: "macOS 15", + os: macos-15 + } + - { + name: "Ubuntu 24.04", + os: ubuntu-24.04 + } + - { + name: "Ubuntu 24.04 ARM", + os: ubuntu-24.04-arm + } + # - { + # name: "Debian Bookworm", + # os: ubuntu-24.04, + # container_image: "debian:bookworm-slim" + # } + + runs-on: ${{ matrix.config.os }} + container: + image: ${{ matrix.config.container_image }} + options: --user root + steps: - name: Setup Windows - if: matrix.os == 'windows-latest' + if: matrix.config.os == 'windows-latest' uses: ilammy/msvc-dev-cmd@v1 - name: Setup NASM for Windows - if: matrix.os == 'windows-latest' + if: matrix.config.os == 'windows-latest' uses: ilammy/setup-nasm@v1.2.1 - name: Setup Node.js uses: actions/setup-node@v4 @@ -22,9 +49,9 @@ jobs: node-version: 26 - name: Update binaries run: | - git clone --recursive https://github.com/uNetworking/uWebSockets.js.git + git clone --recursive https://github.com/andygruber/uWebSockets.js.git -b dockerbuild cd uWebSockets.js - ${{ matrix.os == 'windows-latest' && 'nmake' || 'make' }} + ${{ matrix.config.os == 'windows-latest' && 'nmake' || 'make' }} ls dist cd tests && npm install ws && node smoke.js && cd .. ls dist @@ -34,9 +61,9 @@ jobs: cp dist/*.js . git rev-parse master > source_commit ls - ${{ matrix.os != 'windows-latest' && 'git checkout master docs/index.d.ts && mv docs/index.d.ts .' || '' }} + ${{ matrix.config.os != 'windows-latest' && 'git checkout master docs/index.d.ts && mv docs/index.d.ts .' || '' }} git status - git config --global user.email "alexhultman@gmail.com" - git config --global user.name "Alex Hultman" - git commit -a -m "[GitHub Actions] Updated ${{ matrix.os }} binaries" || true - git push "https://unetworkingab:${{ secrets.SECRET }}@github.com/uNetworking/uWebSockets.js" binaries + git config --global user.email "andreas@gruber.info" + git config --global user.name "Andreas Gruber" + git commit -a -m "[GitHub Actions] Updated ${{ matrix.config.os }} binaries" || true + git push "https://andygruber:${{ secrets.SECRET }}@github.com/andygruber/uWebSockets.js" binaries From 2201c9079781beaf3dac1e47eef18d8f172c400e Mon Sep 17 00:00:00 2001 From: Andreas Gruber Date: Fri, 17 Jul 2026 10:07:06 +0200 Subject: [PATCH 02/12] Change to github token and add Docker build --- .github/workflows/build.yml | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58a2e7944..65142875e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,9 @@ on: push: branches: [ dockerbuild ] +permissions: + contents: write + jobs: build: strategy: @@ -17,19 +20,19 @@ jobs: name: "macOS 15", os: macos-15 } - - { - name: "Ubuntu 24.04", - os: ubuntu-24.04 - } + # - { + # name: "Ubuntu 24.04", + # os: ubuntu-24.04 + # } - { name: "Ubuntu 24.04 ARM", os: ubuntu-24.04-arm } - # - { - # name: "Debian Bookworm", - # os: ubuntu-24.04, - # container_image: "debian:bookworm-slim" - # } + - { + name: "Debian Bookworm", + os: ubuntu-latest, + container_image: "debian:bookworm-slim" + } runs-on: ${{ matrix.config.os }} container: @@ -43,6 +46,11 @@ jobs: - name: Setup NASM for Windows if: matrix.config.os == 'windows-latest' uses: ilammy/setup-nasm@v1.2.1 + - name: Setup build tools for containers + if: matrix.config.container_image != null + run: | + sudo apt-get update + sudo apt-get install -y build-essential git libssl-dev file zip curl jq - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -61,9 +69,9 @@ jobs: cp dist/*.js . git rev-parse master > source_commit ls - ${{ matrix.config.os != 'windows-latest' && 'git checkout master docs/index.d.ts && mv docs/index.d.ts .' || '' }} + ${{ matrix.config.os != 'windows-latest' && 'git checkout dockerbuild docs/index.d.ts && mv docs/index.d.ts .' || '' }} git status git config --global user.email "andreas@gruber.info" git config --global user.name "Andreas Gruber" git commit -a -m "[GitHub Actions] Updated ${{ matrix.config.os }} binaries" || true - git push "https://andygruber:${{ secrets.SECRET }}@github.com/andygruber/uWebSockets.js" binaries + git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/andygruber/uWebSockets.js" binaries From f23b38beb915988b5ed8a6a2ef591a1976eead1e Mon Sep 17 00:00:00 2001 From: Andreas Gruber Date: Fri, 17 Jul 2026 10:13:11 +0200 Subject: [PATCH 03/12] No sudo in default Debian image --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 65142875e..c523c5331 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,8 +49,8 @@ jobs: - name: Setup build tools for containers if: matrix.config.container_image != null run: | - sudo apt-get update - sudo apt-get install -y build-essential git libssl-dev file zip curl jq + apt-get update + apt-get install -y build-essential git libssl-dev file zip curl jq - name: Setup Node.js uses: actions/setup-node@v4 with: From da329a13cd1d0538d2aaf48c8b8d39bdad0a7cf7 Mon Sep 17 00:00:00 2001 From: Andreas Gruber Date: Fri, 17 Jul 2026 10:32:11 +0200 Subject: [PATCH 04/12] Make sure to build with the available clang instead of a specific version --- .github/workflows/build.yml | 26 +++++++++++++------------- build.c | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c523c5331..be9187c18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,22 +12,22 @@ jobs: fail-fast: false matrix: config: - - { - name: "Windows Latest", - os: windows-latest - } - - { - name: "macOS 15", - os: macos-15 - } + # - { + # name: "Windows Latest", + # os: windows-latest + # } + # - { + # name: "macOS 15", + # os: macos-15 + # } # - { # name: "Ubuntu 24.04", # os: ubuntu-24.04 # } - - { - name: "Ubuntu 24.04 ARM", - os: ubuntu-24.04-arm - } + # - { + # name: "Ubuntu 24.04 ARM", + # os: ubuntu-24.04-arm + # } - { name: "Debian Bookworm", os: ubuntu-latest, @@ -50,7 +50,7 @@ jobs: if: matrix.config.container_image != null run: | apt-get update - apt-get install -y build-essential git libssl-dev file zip curl jq + apt-get install -y build-essential git libssl-dev file zip curl jq cmake clang - name: Setup Node.js uses: actions/setup-node@v4 with: diff --git a/build.c b/build.c index 9644984ff..fad5fb4cb 100644 --- a/build.c +++ b/build.c @@ -213,8 +213,8 @@ int main() { #else /* Linux does not cross-compile but picks whatever arch the host is on (we run on both x64 and ARM64) */ - build("clang-18", - "clang++-18", + build("clang", + "clang++", LINUX_LINK_EXTRAS, OS, arch); From 11a5cdb426ea0a55ff7e0e31a5fd7f51d5eb012d Mon Sep 17 00:00:00 2001 From: Andreas Gruber Date: Fri, 17 Jul 2026 10:45:43 +0200 Subject: [PATCH 05/12] Fix compile errors and missing libs --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be9187c18..fd3102f0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,11 @@ jobs: if: matrix.config.container_image != null run: | apt-get update - apt-get install -y build-essential git libssl-dev file zip curl jq cmake clang + apt-get install -y build-essential git libssl-dev zlib1g-dev file zip curl jq cmake clang-16 + # Debian Bookworm's bare "clang" is clang-14, which lacks __builtin_source_location + # and cannot compile Node 26's V8 headers (std::source_location). Force clang-16. + update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100 + update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100 - name: Setup Node.js uses: actions/setup-node@v4 with: From 11d256979de68201477f8598441c0d6fc08584f3 Mon Sep 17 00:00:00 2001 From: Andreas Gruber Date: Fri, 17 Jul 2026 11:51:48 +0200 Subject: [PATCH 06/12] Fix temporary usage of feature branch --- .github/workflows/build.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd3102f0b..cfe862050 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,14 +12,14 @@ jobs: fail-fast: false matrix: config: - # - { - # name: "Windows Latest", - # os: windows-latest - # } - # - { - # name: "macOS 15", - # os: macos-15 - # } + - { + name: "Windows Latest", + os: windows-latest + } + - { + name: "macOS 15", + os: macos-15 + } # - { # name: "Ubuntu 24.04", # os: ubuntu-24.04 @@ -71,7 +71,7 @@ jobs: git checkout binaries cp dist/*.node . cp dist/*.js . - git rev-parse master > source_commit + git rev-parse origin/dockerbuild > source_commit ls ${{ matrix.config.os != 'windows-latest' && 'git checkout dockerbuild docs/index.d.ts && mv docs/index.d.ts .' || '' }} git status From ed1e0ba52353c3d94bd23fe5856373e893f6cf39 Mon Sep 17 00:00:00 2001 From: Andreas Gruber Date: Fri, 17 Jul 2026 13:02:41 +0200 Subject: [PATCH 07/12] Reenable regular arm64 build --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfe862050..40ea82042 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,10 +24,10 @@ jobs: # name: "Ubuntu 24.04", # os: ubuntu-24.04 # } - # - { - # name: "Ubuntu 24.04 ARM", - # os: ubuntu-24.04-arm - # } + - { + name: "Ubuntu 24.04 ARM", + os: ubuntu-24.04-arm + } - { name: "Debian Bookworm", os: ubuntu-latest, From 49127d550cb0d23185d2a0b157825e8a3c0acb80 Mon Sep 17 00:00:00 2001 From: Andreas Gruber Date: Tue, 21 Jul 2026 11:13:03 +0200 Subject: [PATCH 08/12] Switch Linux Builds to Ubuntu 22.04 containers --- .github/workflows/build.yml | 41 ++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40ea82042..e0d8ebeaf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,14 +24,19 @@ jobs: # name: "Ubuntu 24.04", # os: ubuntu-24.04 # } + # - { + # name: "Ubuntu 24.04 ARM", + # os: ubuntu-24.04-arm + # } - { - name: "Ubuntu 24.04 ARM", - os: ubuntu-24.04-arm + name: "Ubuntu 22.04", + os: ubuntu-latest, + container_image: "ubuntu:22.04" } - { - name: "Debian Bookworm", - os: ubuntu-latest, - container_image: "debian:bookworm-slim" + name: "Ubuntu 22.04 ARM64", + os: ubuntu-latest-arm, + container_image: "ubuntu:22.04" } runs-on: ${{ matrix.config.os }} @@ -50,11 +55,33 @@ jobs: if: matrix.config.container_image != null run: | apt-get update - apt-get install -y build-essential git libssl-dev zlib1g-dev file zip curl jq cmake clang-16 - # Debian Bookworm's bare "clang" is clang-14, which lacks __builtin_source_location + apt-get install -y build-essential git libssl-dev zlib1g-dev file zip curl jq cmake + # clang-16 is not in Ubuntu 22.04 (jammy), whose newest is clang-15. + # Add the official LLVM apt repo to install it. + . /etc/os-release + apt-get install -y wget gnupg + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm.gpg + echo "deb [signed-by=/usr/share/keyrings/llvm.gpg] http://apt.llvm.org/$VERSION_CODENAME/ llvm-toolchain-$VERSION_CODENAME-16 main" > /etc/apt/sources.list.d/llvm.list + apt-get update + apt-get install -y clang-16 + # Ubuntu 22.04's bare "clang" is clang-14, which lacks __builtin_source_location # and cannot compile Node 26's V8 headers (std::source_location). Force clang-16. update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100 update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100 + echo "::group::Environment info" + echo "--- distro ---" + cat /etc/os-release + echo "--- architecture ---" + uname -a + dpkg --print-architecture + echo "--- glibc ---" + # ldd --version prints the glibc version on the first line; getconf gives it raw. + ldd --version | head -n 1 + getconf GNU_LIBC_VERSION + echo "--- compiler ---" + clang --version + clang++ --version + echo "::endgroup::" - name: Setup Node.js uses: actions/setup-node@v4 with: From 3321a1976797a24cfb8133f21258aa3cb8c51fac Mon Sep 17 00:00:00 2001 From: Andreas Gruber Date: Tue, 21 Jul 2026 22:22:15 +0200 Subject: [PATCH 09/12] Cleanup and corrections --- .github/workflows/build.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0d8ebeaf..c7b6287aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,14 +20,6 @@ jobs: name: "macOS 15", os: macos-15 } - # - { - # name: "Ubuntu 24.04", - # os: ubuntu-24.04 - # } - # - { - # name: "Ubuntu 24.04 ARM", - # os: ubuntu-24.04-arm - # } - { name: "Ubuntu 22.04", os: ubuntu-latest, @@ -35,7 +27,7 @@ jobs: } - { name: "Ubuntu 22.04 ARM64", - os: ubuntu-latest-arm, + os: ubuntu-24.04-arm, container_image: "ubuntu:22.04" } @@ -102,7 +94,7 @@ jobs: ls ${{ matrix.config.os != 'windows-latest' && 'git checkout dockerbuild docs/index.d.ts && mv docs/index.d.ts .' || '' }} git status - git config --global user.email "andreas@gruber.info" - git config --global user.name "Andreas Gruber" + git config --global user.email "alexhultman@gmail.com" + git config --global user.name "Alex Hultman" git commit -a -m "[GitHub Actions] Updated ${{ matrix.config.os }} binaries" || true - git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/andygruber/uWebSockets.js" binaries + git push "https://andygruber:${{ secrets.SECRET }}@github.com/andygruber/uWebSockets.js" binaries From ab7914ab67ae0e1bf02824a0a1f0792eb6ffc8cd Mon Sep 17 00:00:00 2001 From: Andreas Gruber Date: Tue, 21 Jul 2026 22:38:05 +0200 Subject: [PATCH 10/12] Switch to ubuntu 20.04 --- .github/workflows/build.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7b6287aa..44d28e596 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,14 +21,14 @@ jobs: os: macos-15 } - { - name: "Ubuntu 22.04", + name: "Ubuntu 20.04", os: ubuntu-latest, - container_image: "ubuntu:22.04" + container_image: "ubuntu:20.04" } - { - name: "Ubuntu 22.04 ARM64", + name: "Ubuntu 20.04 ARM64", os: ubuntu-24.04-arm, - container_image: "ubuntu:22.04" + container_image: "ubuntu:20.04" } runs-on: ${{ matrix.config.os }} @@ -45,6 +45,11 @@ jobs: uses: ilammy/setup-nasm@v1.2.1 - name: Setup build tools for containers if: matrix.config.container_image != null + env: + # Prevent tzdata (pulled in by cmake/build-essential) from launching an + # interactive timezone prompt that hangs the build with no TTY attached. + DEBIAN_FRONTEND: noninteractive + TZ: Etc/UTC run: | apt-get update apt-get install -y build-essential git libssl-dev zlib1g-dev file zip curl jq cmake From 2b522c0efbcd4eae29821852d8f12469635119a5 Mon Sep 17 00:00:00 2001 From: Andreas Gruber Date: Tue, 21 Jul 2026 22:44:03 +0200 Subject: [PATCH 11/12] Make ready for PR to upstream --- .github/workflows/build.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44d28e596..a05d3f9c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,7 @@ name: Build on: push: - branches: [ dockerbuild ] - -permissions: - contents: write - + branches: [ master ] jobs: build: strategy: @@ -34,7 +30,6 @@ jobs: runs-on: ${{ matrix.config.os }} container: image: ${{ matrix.config.container_image }} - options: --user root steps: - name: Setup Windows @@ -85,7 +80,7 @@ jobs: node-version: 26 - name: Update binaries run: | - git clone --recursive https://github.com/andygruber/uWebSockets.js.git -b dockerbuild + git clone --recursive https://github.com/uNetworking/uWebSockets.js.git -b master cd uWebSockets.js ${{ matrix.config.os == 'windows-latest' && 'nmake' || 'make' }} ls dist @@ -95,11 +90,11 @@ jobs: git checkout binaries cp dist/*.node . cp dist/*.js . - git rev-parse origin/dockerbuild > source_commit + git rev-parse origin/master > source_commit ls - ${{ matrix.config.os != 'windows-latest' && 'git checkout dockerbuild docs/index.d.ts && mv docs/index.d.ts .' || '' }} + ${{ matrix.config.os != 'windows-latest' && 'git checkout master docs/index.d.ts && mv docs/index.d.ts .' || '' }} git status git config --global user.email "alexhultman@gmail.com" git config --global user.name "Alex Hultman" git commit -a -m "[GitHub Actions] Updated ${{ matrix.config.os }} binaries" || true - git push "https://andygruber:${{ secrets.SECRET }}@github.com/andygruber/uWebSockets.js" binaries + git push "https://unetworkingab:${{ secrets.SECRET }}@github.com/uNetworking/uWebSockets.js" binaries From ffb22b66b8af68c898d7cfcb8d8a3a5e8985c6d3 Mon Sep 17 00:00:00 2001 From: Andreas Gruber Date: Tue, 21 Jul 2026 22:48:57 +0200 Subject: [PATCH 12/12] Change back to Ubuntu 22.04, cmake too old. --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a05d3f9c1..3ac70e1e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,14 +17,14 @@ jobs: os: macos-15 } - { - name: "Ubuntu 20.04", + name: "Ubuntu 22.04", os: ubuntu-latest, - container_image: "ubuntu:20.04" + container_image: "ubuntu:22.04" } - { - name: "Ubuntu 20.04 ARM64", + name: "Ubuntu 22.04 ARM64", os: ubuntu-24.04-arm, - container_image: "ubuntu:20.04" + container_image: "ubuntu:22.04" } runs-on: ${{ matrix.config.os }}