Meta+CI+Documentation: Bump host gcc requirement up to gcc 11

Bump macOS CI version to macOS 11 while we're here.
This commit is contained in:
Andrew Kaster 2022-01-06 23:27:53 -07:00 committed by Linus Groh
parent d70aba6a11
commit c62c10caf0
Notes: sideshowbarker 2024-07-17 21:29:59 +09:00
13 changed files with 51 additions and 45 deletions

View file

@ -39,15 +39,17 @@ jobs:
# sudo apt-get update -qq # sudo apt-get update -qq
- name: "Install Ubuntu dependencies" - name: "Install Ubuntu dependencies"
# These packages are already part of the ubuntu-20.04 image: # These packages are already part of the ubuntu-20.04 image:
# cmake clang-format-11 gcc-10 g++-10 libstdc++-10-dev libgmp-dev npm shellcheck # cmake clang-format-11 libgmp-dev npm shellcheck
# Packages below aren't. # Packages below aren't.
# #
# We add the canonical-server/server-backports PPA to get updated QEMU releases without having to manage # We add the canonical-server/server-backports PPA to get updated QEMU releases without having to manage
# yet another cache in github actions # yet another cache in github actions
# We add the ubuntu-toolchain-r/test PPA to get gcc-11 on 20.04
run: | run: |
sudo add-apt-repository ppa:canonical-server/server-backports sudo add-apt-repository ppa:canonical-server/server-backports
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update sudo apt-get update
sudo apt-get install libmpfr-dev libmpc-dev ninja-build e2fsprogs qemu-utils qemu-system-i386 ccache unzip sudo apt-get install ccache e2fsprogs gcc-11 g++-11 libstdc++-11-dev libmpfr-dev libmpc-dev ninja-build qemu-utils qemu-system-i386 unzip
- name: Install JS dependencies - name: Install JS dependencies
run: sudo npm install -g prettier@2.4.1 run: sudo npm install -g prettier@2.4.1
- name: Install Python dependencies - name: Install Python dependencies
@ -56,7 +58,7 @@ jobs:
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install flake8 requests pip install flake8 requests
- name: Check versions - name: Check versions
run: set +e; g++ --version; g++-10 --version; clang-format --version; clang-format-11 --version; prettier --version; python --version; python3 --version; ninja --version; flake8 --version; ccache --version; qemu-system-i386 --version run: set +e; g++ --version; g++-11 --version; clang-format --version; clang-format-11 --version; prettier --version; python --version; python3 --version; ninja --version; flake8 --version; ccache --version; qemu-system-i386 --version
# === PREPARE FOR BUILDING === # === PREPARE FOR BUILDING ===
@ -140,8 +142,8 @@ jobs:
-DSERENITY_ARCH=${{ matrix.arch }} \ -DSERENITY_ARCH=${{ matrix.arch }} \
-DSERENITY_TOOLCHAIN=GNU \ -DSERENITY_TOOLCHAIN=GNU \
-DBUILD_LAGOM=ON \ -DBUILD_LAGOM=ON \
-DCMAKE_C_COMPILER=gcc-10 \ -DCMAKE_C_COMPILER=gcc-11 \
-DCMAKE_CXX_COMPILER=g++-10 \ -DCMAKE_CXX_COMPILER=g++-11 \
-DENABLE_ALL_DEBUG_FACILITIES=ON \ -DENABLE_ALL_DEBUG_FACILITIES=ON \
-DENABLE_PCI_IDS_DOWNLOAD=OFF \ -DENABLE_PCI_IDS_DOWNLOAD=OFF \
-DENABLE_USB_IDS_DOWNLOAD=OFF -DENABLE_USB_IDS_DOWNLOAD=OFF
@ -155,8 +157,8 @@ jobs:
-DENABLE_COMPILETIME_HEADER_CHECK=ON \ -DENABLE_COMPILETIME_HEADER_CHECK=ON \
-DSERENITY_ARCH=${{ matrix.arch }} \ -DSERENITY_ARCH=${{ matrix.arch }} \
-DSERENITY_TOOLCHAIN=GNU \ -DSERENITY_TOOLCHAIN=GNU \
-DCMAKE_C_COMPILER=gcc-10 \ -DCMAKE_C_COMPILER=gcc-11 \
-DCMAKE_CXX_COMPILER=g++-10 \ -DCMAKE_CXX_COMPILER=g++-11 \
-DENABLE_UNDEFINED_SANITIZER=ON \ -DENABLE_UNDEFINED_SANITIZER=ON \
-DENABLE_PCI_IDS_DOWNLOAD=OFF \ -DENABLE_PCI_IDS_DOWNLOAD=OFF \
-DENABLE_USB_IDS_DOWNLOAD=OFF -DENABLE_USB_IDS_DOWNLOAD=OFF

View file

@ -47,8 +47,9 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update sudo apt-get update
sudo apt-get install ninja-build unzip sudo apt-get install ninja-build unzip gcc-11 g++-11
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
@ -85,7 +86,7 @@ jobs:
working-directory: libjs-test262 working-directory: libjs-test262
run: | run: |
cd Build cd Build
cmake -GNinja -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DSERENITY_SOURCE_DIR=${{ env.SERENITY_SOURCE_DIR }} .. cmake -GNinja -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DSERENITY_SOURCE_DIR=${{ env.SERENITY_SOURCE_DIR }} ..
ninja libjs-test262-runner test-js ninja libjs-test262-runner test-js
- name: Run test262 and test262-parser-tests - name: Run test262 and test262-parser-tests

View file

@ -21,15 +21,16 @@ jobs:
- name: "Install Ubuntu dependencies" - name: "Install Ubuntu dependencies"
# These packages are already part of the ubuntu-20.04 image: # These packages are already part of the ubuntu-20.04 image:
# cmake clang-format-11 gcc-10 g++-10 libstdc++-10-dev libgmp-dev npm shellcheck # cmake clang-format-11 libgmp-dev npm shellcheck
# Packages below aren't. # Packages below aren't.
# #
run: | run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update sudo apt-get update
sudo apt-get install libmpfr-dev libmpc-dev ninja-build unzip pvs-studio sudo apt-get install gcc-11 g++-11 libstdc++-11-dev libmpfr-dev libmpc-dev ninja-build unzip pvs-studio
- name: Check versions - name: Check versions
run: set +e; g++ --version; g++-10 --version; ninja --version; run: set +e; g++ --version; g++-11 --version; ninja --version;
- name: Prepare useful stamps - name: Prepare useful stamps
id: stamps id: stamps
@ -71,8 +72,8 @@ jobs:
cmake -S Meta/CMake/Superbuild -B Build/superbuild -GNinja \ cmake -S Meta/CMake/Superbuild -B Build/superbuild -GNinja \
-DSERENITY_ARCH=${{ env.PVS_STUDIO_ANALYSIS_ARCH }} \ -DSERENITY_ARCH=${{ env.PVS_STUDIO_ANALYSIS_ARCH }} \
-DSERENITY_TOOLCHAIN=GNU \ -DSERENITY_TOOLCHAIN=GNU \
-DCMAKE_C_COMPILER=gcc-10 \ -DCMAKE_C_COMPILER=gcc-11 \
-DCMAKE_CXX_COMPILER=g++-10 \ -DCMAKE_CXX_COMPILER=g++-11 \
-DENABLE_PCI_IDS_DOWNLOAD=OFF \ -DENABLE_PCI_IDS_DOWNLOAD=OFF \
-DENABLE_USB_IDS_DOWNLOAD=OFF -DENABLE_USB_IDS_DOWNLOAD=OFF

View file

@ -55,18 +55,15 @@ jobs:
- name: "Install Ubuntu dependencies" - name: "Install Ubuntu dependencies"
# These packages are already part of the ubuntu-20.04 image: # These packages are already part of the ubuntu-20.04 image:
# cmake clang-format-11 gcc-10 g++-10 libstdc++-10-dev libgmp-dev npm shellcheck # cmake clang-format-11 libgmp-dev npm shellcheck
# Packages below aren't. # Packages below aren't.
#
# We add the canonical-server/server-backports PPA to get updated QEMU releases without having to manage
# yet another cache in github actions
run: | run: |
sudo add-apt-repository ppa:canonical-server/server-backports sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update sudo apt-get update
sudo apt-get install libmpfr-dev libmpc-dev ninja-build unzip sudo apt-get install gcc-11 g++-11 libstdc++-11-dev libmpfr-dev libmpc-dev ninja-build unzip
- name: Check versions - name: Check versions
run: set +e; g++ --version; g++-10 --version; ninja --version; run: set +e; g++ --version; g++-11 --version; ninja --version;
- name: Prepare useful stamps - name: Prepare useful stamps
id: stamps id: stamps
@ -108,8 +105,8 @@ jobs:
cmake -S Meta/CMake/Superbuild -B Build/superbuild -GNinja \ cmake -S Meta/CMake/Superbuild -B Build/superbuild -GNinja \
-DSERENITY_ARCH=${{ env.SONAR_ANALYSIS_ARCH }} \ -DSERENITY_ARCH=${{ env.SONAR_ANALYSIS_ARCH }} \
-DSERENITY_TOOLCHAIN=GNU \ -DSERENITY_TOOLCHAIN=GNU \
-DCMAKE_C_COMPILER=gcc-10 \ -DCMAKE_C_COMPILER=gcc-11 \
-DCMAKE_CXX_COMPILER=g++-10 \ -DCMAKE_CXX_COMPILER=g++-11 \
-DENABLE_PCI_IDS_DOWNLOAD=OFF \ -DENABLE_PCI_IDS_DOWNLOAD=OFF \
-DENABLE_USB_IDS_DOWNLOAD=OFF -DENABLE_USB_IDS_DOWNLOAD=OFF

View file

@ -10,18 +10,18 @@ Make sure you have all the dependencies installed:
sudo apt install build-essential cmake curl libmpfr-dev libmpc-dev libgmp-dev e2fsprogs ninja-build qemu-system-gui qemu-system-x86 qemu-utils ccache rsync unzip texinfo sudo apt install build-essential cmake curl libmpfr-dev libmpc-dev libgmp-dev e2fsprogs ninja-build qemu-system-gui qemu-system-x86 qemu-utils ccache rsync unzip texinfo
``` ```
#### GCC 10 #### GCC 11
On Ubuntu gcc-10 is available in the repositories of 20.04 (Focal) and later - add the `ubuntu-toolchain-r/test` PPA if you're running an older version: On Ubuntu gcc-11 is available in the repositories of 21.04 (Hirsuite) and later - add the `ubuntu-toolchain-r/test` PPA if you're running an older version:
```console ```console
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo add-apt-repository ppa:ubuntu-toolchain-r/test
``` ```
Now on Ubuntu or Debian you can install gcc-10 with apt like this: Now on Ubuntu or Debian you can install gcc-11 with apt like this:
```console ```console
sudo apt install gcc-10 g++-10 sudo apt install gcc-11 g++-11
``` ```
#### QEMU 5 or later #### QEMU 5 or later

View file

@ -36,7 +36,7 @@ with import <nixpkgs> {};
stdenv.mkDerivation { stdenv.mkDerivation {
name = "cpp-env"; name = "cpp-env";
nativeBuildInputs = [ nativeBuildInputs = [
gcc10 gcc11
curl curl
cmake cmake
mpfr mpfr

View file

@ -19,12 +19,13 @@ These instructions assume the OS installed is Ubuntu 20.04 (Focal), so they migh
### Install base dependencies ### Install base dependencies
```shell ```shell
add-apt-repository ppa:canonical-server/server-backports add-apt-repository ppa:canonical-server/server-backports
add-apt-repository ppa:ubuntu-toolchain-r/test
apt update apt update
apt install git build-essential make cmake clang-format-11 gcc-10 g++-10 libstdc++-10-dev libgmp-dev ccache libmpfr-dev libmpc-dev ninja-build e2fsprogs qemu-utils qemu-system-i386 wabt apt install git build-essential make cmake clang-format-11 gcc-11 g++-11 libstdc++-11-dev libgmp-dev ccache libmpfr-dev libmpc-dev ninja-build e2fsprogs qemu-utils qemu-system-i386 wabt
``` ```
### Force usage of GCC 10 ### Force usage of GCC 11
```shell ```shell
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11
``` ```
### Create a new user account named 'runner' ### Create a new user account named 'runner'
```shell ```shell

View file

@ -16,7 +16,7 @@ install it. You can also build it using the `Toolchain/BuildQemu.sh` script.
### GCC is missing or is outdated ### GCC is missing or is outdated
Ensure your gcc version is >= 10 with `gcc --version`. Otherwise, install it. If your gcc binary is not Ensure your gcc version is >= 11 with `gcc --version`. Otherwise, install it. If your gcc binary is not
called `gcc` you have to specify the names of your C and C++ compiler when you run cmake, e.g. called `gcc` you have to specify the names of your C and C++ compiler when you run cmake, e.g.
`cmake ../.. -GNinja -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11`. `cmake ../.. -GNinja -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11`.

View file

@ -15,7 +15,7 @@ jobs:
${{ if eq(parameters.os, 'Linux') }}: ${{ if eq(parameters.os, 'Linux') }}:
value: ubuntu-20.04 value: ubuntu-20.04
${{ if eq(parameters.os, 'macOS') }}: ${{ if eq(parameters.os, 'macOS') }}:
value: macos-10.15 value: macos-11
- name: toolchain - name: toolchain
${{ if eq(parameters.fuzzer, 'Fuzz') }}: ${{ if eq(parameters.fuzzer, 'Fuzz') }}:
@ -74,8 +74,8 @@ jobs:
-DENABLE_ADDRESS_SANITIZER=ON \ -DENABLE_ADDRESS_SANITIZER=ON \
-DENABLE_PCI_IDS_DOWNLOAD=OFF \ -DENABLE_PCI_IDS_DOWNLOAD=OFF \
-DENABLE_USB_IDS_DOWNLOAD=OFF \ -DENABLE_USB_IDS_DOWNLOAD=OFF \
-DCMAKE_C_COMPILER=gcc-10 \ -DCMAKE_C_COMPILER=gcc-11 \
-DCMAKE_CXX_COMPILER=g++-10 \ -DCMAKE_CXX_COMPILER=g++-11 \
.. ..
displayName: 'Create Build Environment' displayName: 'Create Build Environment'
workingDirectory: $(Build.SourcesDirectory)/Meta/Lagom/Build workingDirectory: $(Build.SourcesDirectory)/Meta/Lagom/Build

View file

@ -40,8 +40,8 @@ jobs:
-DENABLE_UNDEFINED_SANITIZER=ON \ -DENABLE_UNDEFINED_SANITIZER=ON \
-DENABLE_PCI_IDS_DOWNLOAD=OFF \ -DENABLE_PCI_IDS_DOWNLOAD=OFF \
-DENABLE_USB_IDS_DOWNLOAD=OFF \ -DENABLE_USB_IDS_DOWNLOAD=OFF \
-DCMAKE_C_COMPILER=gcc-10 \ -DCMAKE_C_COMPILER=gcc-11 \
-DCMAKE_CXX_COMPILER=g++-10 -DCMAKE_CXX_COMPILER=g++-11
displayName: 'Create Build Environment' displayName: 'Create Build Environment'
workingDirectory: $(Build.SourcesDirectory) workingDirectory: $(Build.SourcesDirectory)
env: env:

View file

@ -8,18 +8,22 @@ steps:
- ${{ if eq(parameters.os, 'Serenity') }}: - ${{ if eq(parameters.os, 'Serenity') }}:
- script: | - script: |
sudo add-apt-repository ppa:canonical-server/server-backports sudo add-apt-repository ppa:canonical-server/server-backports
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update sudo apt-get update
sudo apt-get install libmpfr-dev libmpc-dev ninja-build e2fsprogs qemu-utils qemu-system-i386 ccache unzip sudo apt-get install ccache e2fsprogs gcc-11 g++-11 libstdc++-11-dev libmpfr-dev libmpc-dev ninja-build qemu-utils qemu-system-i386 unzip
displayName: 'Install Dependencies' displayName: 'Install Dependencies'
- ${{ if eq(parameters.os, 'Linux') }}: - ${{ if eq(parameters.os, 'Linux') }}:
- script: | - script: |
sudo apt-get purge -y clang-11 sudo apt-get purge -y clang-11 gcc-10
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update sudo apt-get update
sudo apt-get install ninja-build ccache unzip sudo apt-get install ccache gcc-11 g++-11 libstdc++-11-dev ninja-build unzip
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 100 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 100 sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
wget https://github.com/WebAssembly/wabt/releases/download/1.0.23/wabt-1.0.23-ubuntu.tar.gz wget https://github.com/WebAssembly/wabt/releases/download/1.0.23/wabt-1.0.23-ubuntu.tar.gz
tar -xzf ./wabt-1.0.23-ubuntu.tar.gz tar -xzf ./wabt-1.0.23-ubuntu.tar.gz

View file

@ -8,9 +8,9 @@ project(
LANGUAGES C CXX LANGUAGES C CXX
) )
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.2") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11")
message(FATAL_ERROR message(FATAL_ERROR
"A GCC version less than 10.2 was detected (${CMAKE_CXX_COMPILER_VERSION}), this is unsupported.\n" "A GCC version less than 11 was detected (${CMAKE_CXX_COMPILER_VERSION}), this is unsupported.\n"
"Please re-read the build instructions documentation, and upgrade your host compiler.\n") "Please re-read the build instructions documentation, and upgrade your host compiler.\n")
endif() endif()

View file

@ -144,7 +144,7 @@ create_build_dir() {
pick_gcc() { pick_gcc() {
local BEST_VERSION=0 local BEST_VERSION=0
local BEST_GCC_CANDIDATE="" local BEST_GCC_CANDIDATE=""
for GCC_CANDIDATE in egcc gcc gcc-10 gcc-11 gcc-12 /usr/local/bin/gcc-11 /opt/homebrew/bin/gcc-11; do for GCC_CANDIDATE in egcc gcc gcc-11 gcc-12 /usr/local/bin/gcc-11 /opt/homebrew/bin/gcc-11; do
if ! command -v $GCC_CANDIDATE >/dev/null 2>&1; then if ! command -v $GCC_CANDIDATE >/dev/null 2>&1; then
continue continue
fi fi
@ -164,8 +164,8 @@ pick_gcc() {
done done
CMAKE_ARGS+=("-DCMAKE_C_COMPILER=$BEST_GCC_CANDIDATE") CMAKE_ARGS+=("-DCMAKE_C_COMPILER=$BEST_GCC_CANDIDATE")
CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER=${BEST_GCC_CANDIDATE/gcc/g++}") CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER=${BEST_GCC_CANDIDATE/gcc/g++}")
if [ "$BEST_VERSION" -lt 10 ]; then if [ "$BEST_VERSION" -lt 11 ]; then
die "Please make sure that GCC version 10.2 or higher is installed." die "Please make sure that GCC version 11 or higher is installed."
fi fi
} }