Skip to content

Commit a230be7

Browse files
committed
build: downgrade GCC support to experimental
Update the configure script to select Clang by default. V8 no longer officially supports GCC and we often have problems because of it. Also bump the expected version to 13.2 because version 12 can't compile newer V8. Signed-Off-By: Michaël Zasso <targos@protonmail.com>
1 parent 7b8934d commit a230be7

File tree

5 files changed

+25
-17
lines changed

5 files changed

+25
-17
lines changed

.github/workflows/build-tarball.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ jobs:
7777
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7878
with:
7979
persist-credentials: false
80+
- name: Install Clang ${{ env.CLANG_VERSION }}
81+
uses: ./.github/actions/install-clang
82+
with:
83+
clang-version: ${{ env.CLANG_VERSION }}
8084
- name: Set up Python ${{ env.PYTHON_VERSION }}
8185
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
8286
with:

.github/workflows/test-macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ jobs:
7878
fail-fast: false
7979
runs-on: macos-15
8080
env:
81-
CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} gcc
82-
CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} g++
81+
CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang
82+
CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++
8383
SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
8484
SCCACHE_IDLE_TIMEOUT: '0'
8585
steps:

.github/workflows/test-shared.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ concurrency:
104104

105105
env:
106106
FLAKY_TESTS: keep_retrying
107+
CLANG_VERSION: '19'
107108

108109
permissions:
109110
contents: read
@@ -119,6 +120,11 @@ jobs:
119120
with:
120121
persist-credentials: false
121122

123+
- name: Install Clang ${{ env.CLANG_VERSION }}
124+
uses: ./.github/actions/install-clang
125+
with:
126+
clang-version: ${{ env.CLANG_VERSION }}
127+
122128
- name: Make tarball
123129
if: ${{ github.event_name != 'workflow_dispatch' }}
124130
run: |

BUILDING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Depending on the host platform, the selection of toolchains may vary.
156156

157157
| Operating System | Compiler Versions |
158158
| ---------------- | ------------------------------------------------------------------- |
159-
| Linux | GCC >= 12.2 or Clang >= 19.1 |
159+
| Linux | Clang >= 19.1 or GCC >= 13.2 (experimental) |
160160
| Windows | Visual Studio 2022 or 2026 with the Windows 11 SDK on a 64-bit host |
161161
| macOS | Xcode >= 16.4 (Apple LLVM >= 19) |
162162

@@ -238,19 +238,19 @@ Consult previous versions of this document for older versions of Node.js:
238238

239239
#### Unix prerequisites
240240

241-
* `gcc` and `g++` >= 12.2 or `clang` and `clang++` >= 19.1
241+
* `clang` and `clang++` >= 19.1 or `gcc` and `g++` >= 13.2 (experimental)
242242
* GNU Make 3.81 or newer
243243
* [A supported version of Python][Python versions]
244244
* For test coverage, your Python installation must include pip.
245245

246246
Installation via Linux package manager can be achieved with:
247247

248248
* Nix, NixOS: `nix-shell`
249-
* Ubuntu, Debian: `sudo apt-get install python3 g++-12 gcc-12 make python3-pip`
250-
* Fedora: `sudo dnf install python3 gcc-c++ make python3-pip`
251-
* CentOS and RHEL: `sudo yum install python3 gcc-c++ make python3-pip`
252-
* OpenSUSE: `sudo zypper install python3 gcc-c++ make python3-pip`
253-
* Arch Linux, Manjaro: `sudo pacman -S python gcc make python-pip`
249+
* Ubuntu, Debian: `sudo apt-get install python3 clang-19 make python3-pip`
250+
* Fedora: `sudo dnf install python3 clang make python3-pip`
251+
* CentOS and RHEL: `sudo yum install python3 clang make python3-pip`
252+
* OpenSUSE: `sudo zypper install python3 clang make python3-pip`
253+
* Arch Linux, Manjaro: `sudo pacman -S python clang make python-pip`
254254

255255
FreeBSD and OpenBSD users may also need to install `libexecinfo`.
256256

@@ -660,8 +660,8 @@ need to install the latest version but not the apt version.
660660

661661
```bash
662662
sudo apt install ccache mold # for Debian/Ubuntu, included in most Linux distros
663-
export CC="ccache gcc" # add to your .profile
664-
export CXX="ccache g++" # add to your .profile
663+
export CC="ccache clang" # add to your .profile
664+
export CXX="ccache clang++" # add to your .profile
665665
export LDFLAGS="-fuse-ld=mold" # add to your .profile
666666
```
667667

configure.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919

2020
original_argv = sys.argv[1:]
2121

22-
# gcc and g++ as defaults matches what GYP's Makefile generator does,
23-
# except on macOS and Windows.
24-
CC = os.environ.get('CC', 'cc' if sys.platform == 'darwin' else 'clang' if sys.platform == 'win32' else 'gcc')
25-
CXX = os.environ.get('CXX', 'c++' if sys.platform == 'darwin' else 'clang' if sys.platform == 'win32' else 'g++')
22+
CC = os.environ.get('CC', 'clang')
23+
CXX = os.environ.get('CXX', 'clang' if sys.platform == 'win32' else 'clang++')
2624

2725
tools_path = Path('tools')
2826

@@ -1521,8 +1519,8 @@ def check_compiler(o):
15211519
print_verbose(f"Detected {'Apple ' if is_apple else ''}{'clang ' if is_clang else ''}C++ compiler (CXX={CXX}) version: {version_str}")
15221520
if not ok:
15231521
warn(f'failed to autodetect C++ compiler version (CXX={CXX})')
1524-
elif ((is_apple and clang_version < (17, 0, 0)) or (not is_apple and clang_version < (19, 1, 0))) if is_clang else gcc_version < (12, 2, 0):
1525-
warn(f"C++ compiler (CXX={CXX}, {version_str}) too old, need g++ 12.2.0 or clang++ 19.1.0{' or Apple clang++ 17.0.0' if is_apple else ''}")
1522+
elif ((is_apple and clang_version < (17, 0, 0)) or (not is_apple and clang_version < (19, 1, 0))) if is_clang else gcc_version < (13, 2, 0):
1523+
warn(f"C++ compiler (CXX={CXX}, {version_str}) too old, need g++ 13.2.0 or clang++ 19.1.0{' or Apple clang++ 17.0.0' if is_apple else ''}")
15261524

15271525
ok, is_clang, clang_version, gcc_version, is_apple = try_check_compiler(CC, 'c')
15281526
version_str = ".".join(map(str, clang_version if is_clang else gcc_version))

0 commit comments

Comments
 (0)