Skip to content

build: bump minimum Clang version to 19 #59048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/actions/install-clang/action.yml
Original file line number Diff line number Diff line change
@@ -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 }}
13 changes: 11 additions & 2 deletions .github/workflows/build-tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/coverage-linux-without-intl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/coverage-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test-internet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.16',
'v8_embedder_string': '-node.17',

##### V8 defaults for Node.js #####

Expand Down
4 changes: 2 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 7 additions & 0 deletions deps/v8/include/v8-persistent-handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,16 @@ V8_INLINE void PersistentBase<T>::SetWeak(
#if (__GNUC__ >= 8) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
#endif
api_internal::MakeWeak(this->slot(), parameter,
reinterpret_cast<Callback>(callback), type);
#if __clang__
#pragma clang diagnostic pop
#endif
#if (__GNUC__ >= 8) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
Expand Down
Loading