From 8a87ba031b56bb115043240a740246a88c881195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 2 Aug 2025 16:10:07 +0200 Subject: [PATCH] build: bump minimum Clang version to 19 This is now required by V8. Refs: https://github.com/nodejs/node-v8/issues/302 PR-URL: https://github.com/nodejs/node/pull/59048 Reviewed-By: Yagiz Nizipli Reviewed-By: Rafael Gonzaga Reviewed-By: Matteo Collina Reviewed-By: Luigi Pinca Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Marco Ippolito --- .github/actions/install-clang/action.yml | 15 +++++++++++++++ .github/workflows/build-tarball.yml | 13 +++++++++++-- .github/workflows/coverage-linux-without-intl.yml | 9 +++++++-- .github/workflows/coverage-linux.yml | 9 +++++++-- .github/workflows/test-internet.yml | 9 +++++++-- .github/workflows/test-linux.yml | 9 +++++++-- configure.py | 4 ++-- 7 files changed, 56 insertions(+), 12 deletions(-) create mode 100644 .github/actions/install-clang/action.yml diff --git a/.github/actions/install-clang/action.yml b/.github/actions/install-clang/action.yml new file mode 100644 index 00000000000..765ad07ef3c --- /dev/null +++ b/.github/actions/install-clang/action.yml @@ -0,0 +1,15 @@ +name: Install Clang +description: Installs a specific Clang version. Useful if the GitHub runner does not have it by default. +inputs: + clang-version: + description: The Clang major version to install + required: true + +runs: + using: composite + steps: + - name: Install Clang + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y clang-${{ inputs.clang-version }} diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index c5911684070..21dbb3ec801 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -30,8 +30,9 @@ concurrency: env: PYTHON_VERSION: '3.12' FLAKY_TESTS: keep_retrying - CC: sccache clang - CXX: sccache clang++ + CLANG_VERSION: '19' + CC: sccache clang-19 + CXX: sccache clang++-19 SCCACHE_GHA_ENABLED: 'true' permissions: @@ -45,6 +46,10 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false + - name: Install Clang ${{ env.CLANG_VERSION }} + uses: ./.github/actions/install-clang + with: + clang-version: ${{ env.CLANG_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: @@ -75,6 +80,10 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false + - name: Install Clang ${{ env.CLANG_VERSION }} + uses: ./.github/actions/install-clang + with: + clang-version: ${{ env.CLANG_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: diff --git a/.github/workflows/coverage-linux-without-intl.yml b/.github/workflows/coverage-linux-without-intl.yml index c30ae78e303..a6512568d8b 100644 --- a/.github/workflows/coverage-linux-without-intl.yml +++ b/.github/workflows/coverage-linux-without-intl.yml @@ -36,8 +36,9 @@ concurrency: env: PYTHON_VERSION: '3.12' FLAKY_TESTS: keep_retrying - CC: sccache clang - CXX: sccache clang++ + CLANG_VERSION: '19' + CC: sccache clang-19 + CXX: sccache clang++-19 SCCACHE_GHA_ENABLED: 'true' permissions: @@ -51,6 +52,10 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false + - name: Install Clang ${{ env.CLANG_VERSION }} + uses: ./.github/actions/install-clang + with: + clang-version: ${{ env.CLANG_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: diff --git a/.github/workflows/coverage-linux.yml b/.github/workflows/coverage-linux.yml index 6d5afb48976..9a01f3716bd 100644 --- a/.github/workflows/coverage-linux.yml +++ b/.github/workflows/coverage-linux.yml @@ -36,8 +36,9 @@ concurrency: env: PYTHON_VERSION: '3.12' FLAKY_TESTS: keep_retrying - CC: sccache clang - CXX: sccache clang++ + CLANG_VERSION: '19' + CC: sccache clang-19 + CXX: sccache clang++-19 SCCACHE_GHA_ENABLED: 'true' permissions: @@ -51,6 +52,10 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false + - name: Install Clang ${{ env.CLANG_VERSION }} + uses: ./.github/actions/install-clang + with: + clang-version: ${{ env.CLANG_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: diff --git a/.github/workflows/test-internet.yml b/.github/workflows/test-internet.yml index 7d25113c024..9943ad3352d 100644 --- a/.github/workflows/test-internet.yml +++ b/.github/workflows/test-internet.yml @@ -33,8 +33,9 @@ concurrency: env: PYTHON_VERSION: '3.12' FLAKY_TESTS: keep_retrying - CC: clang - CXX: clang++ + CLANG_VERSION: '19' + CC: clang-19 + CXX: clang++-19 permissions: contents: read @@ -47,6 +48,10 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false + - name: Install Clang ${{ env.CLANG_VERSION }} + uses: ./.github/actions/install-clang + with: + clang-version: ${{ env.CLANG_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 789689c25cd..8cf2495ab7c 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -27,8 +27,9 @@ concurrency: env: PYTHON_VERSION: '3.12' FLAKY_TESTS: keep_retrying - CC: sccache clang - CXX: sccache clang++ + CLANG_VERSION: '19' + CC: sccache clang-19 + CXX: sccache clang++-19 SCCACHE_GHA_ENABLED: 'true' permissions: @@ -47,6 +48,10 @@ jobs: with: persist-credentials: false path: node + - name: Install Clang ${{ env.CLANG_VERSION }} + uses: ./node/.github/actions/install-clang + with: + clang-version: ${{ env.CLANG_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: diff --git a/configure.py b/configure.py index 0191f75d064..79d2e6709c9 100755 --- a/configure.py +++ b/configure.py @@ -1236,8 +1236,8 @@ def check_compiler(o): print_verbose(f"Detected {'clang ' if is_clang else ''}C++ compiler (CXX={CXX}) version: {version_str}") if not ok: warn(f'failed to autodetect C++ compiler version (CXX={CXX})') - elif clang_version < (8, 0, 0) if is_clang else gcc_version < (12, 2, 0): - warn(f'C++ compiler (CXX={CXX}, {version_str}) too old, need g++ 12.2.0 or clang++ 8.0.0') + elif clang_version < (19, 1, 0) if is_clang else gcc_version < (12, 2, 0): + warn(f'C++ compiler (CXX={CXX}, {version_str}) too old, need g++ 12.2.0 or clang++ 19.1.0') ok, is_clang, clang_version, gcc_version = try_check_compiler(CC, 'c') version_str = ".".join(map(str, clang_version if is_clang else gcc_version))