diff --git a/.github/actions/setup-httpbin-server/action.yml b/.github/actions/setup-httpbin-server/action.yml index 88657b9c6..f2210ce39 100644 --- a/.github/actions/setup-httpbin-server/action.yml +++ b/.github/actions/setup-httpbin-server/action.yml @@ -51,7 +51,7 @@ runs: fi - name: Login to GitHub Container Registry if: ${{ steps.setup.outputs.push == 'true' }} - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ inputs.ghcr_username }} diff --git a/.github/workflows/job-clang-analyzer.yml b/.github/workflows/job-clang-analyzer.yml index 08d77fa64..49c28e9fe 100644 --- a/.github/workflows/job-clang-analyzer.yml +++ b/.github/workflows/job-clang-analyzer.yml @@ -67,7 +67,7 @@ jobs: - run: make setup - run: make - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} + # if: ${{ failure() && !env.ACT }} with: - name: ${{ github.workflow }}-${{ github.job }}-sha-${{ github.sha }}-run-${{ github.run_number }} + name: ${{ github.job }}-sha-${{ github.sha }}-run-${{ github.run_number }}-${{ inputs.ngx != '' && format('nginx-{0}', inputs.ngx) || format('openresty-{0}', inputs.openresty) }}-${{ inputs.runtime }}-${{ inputs.ssl }}-${{ inputs.hup }}-${{ inputs.debug }} path: work/scans/* diff --git a/.github/workflows/job-unit-tests.yml b/.github/workflows/job-unit-tests.yml index 20aa42d49..6353da005 100644 --- a/.github/workflows/job-unit-tests.yml +++ b/.github/workflows/job-unit-tests.yml @@ -157,11 +157,11 @@ jobs: files: './lcov.info' flags: unit - run: rm -f t/servroot/html/nginx.sock - if: ${{ failure() && !env.ACT }} + # if: ${{ failure() && !env.ACT }} - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} + # if: ${{ failure() && !env.ACT }} with: - name: ${{ github.workflow }}-${{ github.job }}-sha-${{ github.sha }}-run-${{ github.run_number }}-${{ inputs.runtime }} + name: ${{ github.job }}-sha-${{ github.sha }}-run-${{ github.run_number }}-${{ inputs.ngx != '' && format('nginx-{0}', inputs.ngx) || format('openresty-{0}', inputs.openresty) }}-${{ inputs.runtime }}-${{ inputs.module_type == 'dynamic' && 'dynamic' || 'static'}}-${{ inputs.ssl }}-${{ inputs.hup }}-${{ inputs.debug }} path: | work/buildroot/ t/servroot* diff --git a/.github/workflows/job-valgrind-tests.yml b/.github/workflows/job-valgrind-tests.yml index 231efc1d0..1f619e5cc 100644 --- a/.github/workflows/job-valgrind-tests.yml +++ b/.github/workflows/job-valgrind-tests.yml @@ -139,11 +139,11 @@ jobs: files: './lcov.info' flags: valgrind - run: rm -f t/servroot/html/nginx.sock - if: ${{ failure() && !env.ACT }} + # if: ${{ failure() && !env.ACT }} - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} + # if: ${{ failure() && !env.ACT }} with: - name: ${{ github.workflow }}-${{ github.job }}-sha-${{ github.sha }}-run-${{ github.run_number }}-${{ inputs.runtime }} + name: ${{ github.job }}-sha-${{ github.sha }}-run-${{ github.run_number }}-${{ inputs.ngx != '' && format('nginx-{0}', inputs.ngx) || format('openresty-{0}', inputs.openresty) }}-${{ inputs.runtime }}-${{ inputs.hup }} path: | work/buildroot/ t/servroot* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5343de32..2c40858c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,8 @@ name: Release on: schedule: - cron: "0 6 * * mon" # 6am UTC, 11pm PST - #pull_request: - # branches: '**' + pull_request: + branches: '**' workflow_dispatch: inputs: release_version: @@ -107,7 +107,7 @@ jobs: - name: Upload archive uses: actions/upload-artifact@v4 with: - name: release-artifacts + name: release-artifacts-${{ github.job }} path: dist retention-days: ${{ env.RETENTION_DAYS }} @@ -140,13 +140,13 @@ jobs: steps: - uses: actions/checkout@v4 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.TOKEN_GITHUB }} - name: Setup QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - name: ${{ matrix.name }} @@ -174,18 +174,18 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.TOKEN_GITHUB }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: Build binary run: ./util/release.sh ${{ needs.setup.outputs.release_name }} --bin env: GITHUB_OAUTH_TOKEN: ${{ secrets.GH_BOT_TOKEN }} - name: Upload binary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: - name: release-artifacts + name: release-artifacts-${{ github.job }} path: dist retention-days: ${{ env.RETENTION_DAYS }} - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 if: failure() with: name: ${{ github.workflow }}-${{ github.job }}-sha-${{ github.sha }}-run-${{ github.run_number }} @@ -214,7 +214,7 @@ jobs: - name: Upload binary uses: actions/upload-artifact@v4 with: - name: release-artifacts + name: release-artifacts-${{ github.job }} path: dist retention-days: ${{ env.RETENTION_DAYS }} - uses: actions/upload-artifact@v4 @@ -246,7 +246,7 @@ jobs: - name: Upload binary uses: actions/upload-artifact@v4 with: - name: release-artifacts + name: release-artifacts-${{ github.job }} path: dist retention-days: ${{ env.RETENTION_DAYS }} - uses: actions/upload-artifact@v4 @@ -263,9 +263,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -286,7 +286,7 @@ jobs: - name: Upload binary uses: actions/upload-artifact@v4 with: - name: release-artifacts + name: release-artifacts-${{ github.job }} path: dist retention-days: ${{ env.RETENTION_DAYS }} - uses: actions/upload-artifact@v4 @@ -310,18 +310,18 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.TOKEN_GITHUB }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: Build binary run: ./util/release.sh ${{ needs.setup.outputs.release_name }} --bin env: GITHUB_OAUTH_TOKEN: ${{ secrets.GH_BOT_TOKEN }} - name: Upload binary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: - name: release-artifacts + name: release-artifacts-${{ github.job }} path: dist retention-days: ${{ env.RETENTION_DAYS }} - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 if: failure() with: name: ${{ github.workflow }}-${{ github.job }}-sha-${{ github.sha }}-run-${{ github.run_number }} @@ -336,6 +336,7 @@ jobs: WASMTIME_VER: ${{ needs.setup.outputs.wasmtime_ver }} WASMER_VER: ${{ needs.setup.outputs.wasmer_ver }} V8_VER: ${{ needs.setup.outputs.v8_ver }} + CC: gcc container: image: ghcr.io/kong/wasmx-build-centos:8 credentials: @@ -350,7 +351,7 @@ jobs: - name: Upload binary uses: actions/upload-artifact@v4 with: - name: release-artifacts + name: release-artifacts-${{ github.job }} path: dist retention-days: ${{ env.RETENTION_DAYS }} - uses: actions/upload-artifact@v4 @@ -382,7 +383,7 @@ jobs: - name: Upload binary uses: actions/upload-artifact@v4 with: - name: release-artifacts + name: release-artifacts-${{ github.job }} path: dist retention-days: ${{ env.RETENTION_DAYS }} - uses: actions/upload-artifact@v3 @@ -411,12 +412,12 @@ jobs: env: GITHUB_OAUTH_TOKEN: ${{ secrets.GH_BOT_TOKEN }} - name: Upload binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: release-artifacts + name: release-artifacts-${{ github.job }} path: dist retention-days: ${{ env.RETENTION_DAYS }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: ${{ github.workflow }}-${{ github.job }}-sha-${{ github.sha }}-run-${{ github.run_number }} @@ -428,12 +429,17 @@ jobs: runs-on: ubuntu-latest timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT) }} steps: - - name: Retrieve sibling release artifacts + - name: Retrieve sibling release artifacts (legacy upload-artifact) uses: actions/download-artifact@v3 + - name: Retrieve sibling release artifacts + uses: actions/download-artifact@v4 with: - name: release-artifacts + pattern: release-artifacts-* + merge-multiple: true - name: Drop Wasmer binaries run: find . -name '*wasmer*' | xargs rm -f + - name: List all collected assets + run: find . -name '*.tar.gz' # Channel: nightly - name: Nightly release uses: marvinpinto/action-automatic-releases@latest diff --git a/assets/release/Dockerfiles/Dockerfile.amd64.centos8 b/assets/release/Dockerfiles/Dockerfile.amd64.centos8 index 9f374b4dc..606c5c248 100644 --- a/assets/release/Dockerfiles/Dockerfile.amd64.centos8 +++ b/assets/release/Dockerfiles/Dockerfile.amd64.centos8 @@ -5,12 +5,14 @@ RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* && \ sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-* && \ dnf update -y && \ dnf --enablerepo=powertools install -y \ + scl-utils \ + gcc-toolset-11 \ + gcc-toolset-11-gcc-c++ \ + gcc-toolset-11-libatomic-devel \ ninja-build \ clang \ cmake \ make \ - gcc \ - libstdc++-devel \ libatomic \ perl \ python39 \ diff --git a/assets/release/Dockerfiles/Dockerfile.amd64.ubuntu-18.04 b/assets/release/Dockerfiles/Dockerfile.amd64.ubuntu-18.04 index cc51dc32c..b1cb3e741 100644 --- a/assets/release/Dockerfiles/Dockerfile.amd64.ubuntu-18.04 +++ b/assets/release/Dockerfiles/Dockerfile.amd64.ubuntu-18.04 @@ -7,6 +7,7 @@ ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y software-properties-common && \ add-apt-repository -y ppa:deadsnakes/ppa && \ + add-apt-repository -y ppa:ubuntu-toolchain-r/test && \ apt-get update && \ apt-get install -y python3.8 && \ ln -nfs $(which python3.8) /usr/bin/python3 @@ -16,8 +17,8 @@ RUN apt-get update && \ ca-certificates \ build-essential \ ninja-build \ - gcc-8 \ - libstdc++-8-dev \ + gcc-11 \ + libstdc++-11-dev \ git \ pkg-config \ libglib2.0-dev \ diff --git a/config b/config index dd13bc15d..c7b6822e3 100644 --- a/config +++ b/config @@ -31,7 +31,11 @@ case $ngx_wasm_runtime_name in ngx_wasm_runtime_srcs="$ngx_addon_dir/src/wasm/wrt/ngx_wrt_v8.c" ngx_wasm_runtime_lib_name="wee8" ngx_wasm_runtime_pre_libs="-lv8bridge" - ngx_wasm_runtime_post_libs="-ldl -lm -lpthread -lstdc++" + ngx_wasm_runtime_post_libs="-ldl -lm -lpthread -lstdc++ -latomic" + + if [ "$NGX_SYSTEM" = "Darwin" ]; then + ngx_wasm_runtime_post_libs="-ldl -lm -lpthread -lstdc++" + fi ngx_wasm_cargo_lib_name=ngx_wasm_rs ngx_wasm_cargo_lib_dir=$ngx_addon_dir/lib/ngx-wasm-rs diff --git a/util/release.sh b/util/release.sh index 3c31b76c2..ff131537d 100755 --- a/util/release.sh +++ b/util/release.sh @@ -376,12 +376,21 @@ release_bin() { notice "Building $arch binary..." - if [ "$(get_distro)" = "centos7" ]; then - notice "Enabling devtoolset-11 for CentOS..." - source /opt/rh/devtoolset-11/enable - gcc --version - export CC=gcc - fi + case "$(get_distro)" in + centos7) + notice "Enabling devtoolset-11 for CentOS 7..." + source /opt/rh/devtoolset-11/enable + gcc --version + export CC=gcc + ;; + + centos8) + notice "Enabling gcc-toolset-11 for CentOS 8..." + source scl_source enable gcc-toolset-11 + gcc --version + export CC=gcc + ;; + esac if [ -n "$WASMTIME_VER" ]; then build_with_runtime wasmtime $WASMTIME_VER $arch "libwasmtime.a" diff --git a/util/runtimes/v8.sh b/util/runtimes/v8.sh index f8c4adea5..5196d5443 100755 --- a/util/runtimes/v8.sh +++ b/util/runtimes/v8.sh @@ -218,16 +218,20 @@ build_v8bridge() { make -C "$NGX_WASM_DIR/lib/v8bridge" clean fi - # Use the same V8 clang toolchain to build v8bridge - C++ ABI compatibility - local v8_cxx="$DIR_LIBWEE8/repos/v8/third_party/llvm-build/Release+Asserts/bin/clang" + local v8_cxx="$CC" - if [[ "$(uname -s)" = "Darwin" ]]; then - # On macOS builds, use the system-provided clang to avoid header issues - v8_cxx="clang" + if [ "$v8_cxx" = "clang" ]; then + # Use the same V8 clang toolchain to build v8bridge - C++ ABI compatibility + v8_cxx="$DIR_LIBWEE8/repos/v8/third_party/llvm-build/Release+Asserts/bin/clang" - elif [[ "$(uname -m)" = "aarch64" ]]; then - # V8 clang is built for x86_64; if running on arm64 defaults to gcc - v8_cxx="gcc" + if [[ "$(uname -s)" = "Darwin" ]]; then + # On macOS builds, use the system-provided clang to avoid header issues + v8_cxx="clang" + + elif [[ "$(uname -m)" = "aarch64" ]]; then + # V8 clang is built for x86_64; if running on arm64 defaults to gcc + v8_cxx="gcc" + fi fi make -C "$NGX_WASM_DIR/lib/v8bridge" \