name: Build Linux x64 [glibc] on: workflow_dispatch: workflow_call: inputs: build_timestamp: required: true type: string jobs: linux-x64: runs-on: ubuntu-24.04 container: ubuntu:22.04 steps: - name: Install git and clang-21 env: DEBIAN_FRONTEND: noninteractive run: | apt-get update apt-get install -y git ca-certificates gnupg wget software-properties-common curl wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-21 main" > /etc/apt/sources.list.d/llvm.list curl -fsSL https://deb.nodesource.com/setup_22.x | bash - apt-get update apt-get install -y clang-21 lld-21 llvm-21 nodejs git config --global --add safe.directory "$GITHUB_WORKSPACE" - uses: actions/checkout@v4 with: submodules: recursive - env: DEBIAN_FRONTEND: noninteractive run: | apt-get install -y python3-pip ninja-build cmake pkg-config \ uuid-dev libssl-dev libsodium-dev pip3 install meson - name: Cache native dependencies id: cache-deps uses: actions/cache@v4 with: path: ~/deps-cache key: deps-linux-glibc-x64-llhttp-9.2.1-libuv-1.51.0-v1 - name: Build llhttp if: steps.cache-deps.outputs.cache-hit != 'true' run: | export CFLAGS="-Os -flto" export AR=llvm-ar-21 export RANLIB=llvm-ranlib-21 git clone --depth 1 --branch release/v9.2.1 https://github.com/nodejs/llhttp.git /tmp/llhttp cd /tmp/llhttp CC=clang-21 CXX=clang++-21 cmake -B build -DCMAKE_INSTALL_PREFIX=$HOME/deps-cache -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=MinSizeRel cmake --build build cmake --install build - name: Build libuv if: steps.cache-deps.outputs.cache-hit != 'true' run: | export CFLAGS="-Os -flto" export AR=llvm-ar-21 export RANLIB=llvm-ranlib-21 git clone --depth 1 --branch v1.51.0 https://github.com/libuv/libuv.git /tmp/libuv cd /tmp/libuv CC=clang-21 cmake -B build -DCMAKE_INSTALL_PREFIX=$HOME/deps-cache -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=MinSizeRel cmake --build build cmake --install build - run: npm ci working-directory: src/tools - name: Install Rust run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y echo "$HOME/.cargo/bin" >> $GITHUB_PATH - uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git build/oxc-target key: cargo-linux-amd64-${{ hashFiles('src/strip/Cargo.lock') }} restore-keys: cargo-linux-amd64- - name: Cache meson build uses: actions/cache@v4 with: path: | vendor/*/ build/ !build/oxc-target key: meson-linux-glibc-x64-${{ hashFiles('vendor/*.wrap', 'meson.build', 'src/**/*.c', 'src/**/*.h') }} restore-keys: meson-linux-glibc-x64- - run: | export PKG_CONFIG_PATH="$HOME/deps-cache/lib/pkgconfig:$PKG_CONFIG_PATH" export CMAKE_PREFIX_PATH="$HOME/deps-cache:$CMAKE_PREFIX_PATH" CC=clang-21 CC_LD=lld-21 meson setup build -Db_lto=true --buildtype=release -Dbuild_timestamp=${{ inputs.build_timestamp }} && meson compile -C build - run: llvm-strip-21 build/ant - uses: actions/upload-artifact@v4 with: name: ant-linux-x64 path: build/ant