Skip to content

CI: Update to GCC 14 #147

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

Merged
merged 15 commits into from
May 15, 2024
Merged
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
7 changes: 4 additions & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
android-build:
name: Build android apk for - ${{ matrix.config.arch }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand All @@ -25,14 +25,15 @@ jobs:
with:
fetch-depth: "0"

# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
- name: Setup Meson
run: |
python -m pip install --upgrade pip
pip install meson
pip install meson --break-system-packages

- name: Setup ninja
run: |
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install ninja-build jq

- name: Setup JDK
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/cpp-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ on:

jobs:
cpp-linter:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v4

# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
- name: Setup Meson
run: |
python -m pip install --upgrade pip
pip install meson
pip install meson --break-system-packages

- name: Setup Clang
uses: egor-tensin/setup-clang@v1
Expand All @@ -28,7 +28,9 @@ jobs:
- name: Prepare compile_commands.json
run: |
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* -y

meson setup build -Dbuildtype=release -Dclang_libcpp=disabled -Dtests=true
meson compile -C build git_version.hpp

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
flatpak:
name: "Flatpak build"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08
options: --privileged
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
- name: Setup meson
if: matrix.config.os != 'macos'
run: |
python -m pip install --upgrade pip
pip install meson

- name: Configure
Expand Down
52 changes: 37 additions & 15 deletions .github/workflows/meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,45 @@ jobs:
strategy:
fail-fast: false
matrix:
# Customize the Meson build type here ("plain", "debug", "debugoptimized", "release", "minsize", "custom".)
config:
- name: Windows MSVC Release
os: windows
os-version: 2022
msvc: true
environment: msvc
buildtype: release
library_type: static
shell: pwsh

- name: Windows MingGW Release
os: windows
os-version: 2022
msvc: false
environment: mingw
architecture: x86_64
buildtype: release
library_type: static
shell: "msys2 {0}"

- name: Windows UCRT Release
os: windows
os-version: 2022
environment: ucrt
architecture: ucrt-x86_64
buildtype: release
library_type: static
shell: "msys2 {0}"


- name: Linux Release
os: ubuntu
os-version: 22.04
os-version: 24.04
buildtype: release
use-clang: false
library_type: shared
shell: bash

- name: Linux Clang Release (libstdc++)
os: ubuntu
os-version: 22.04
os-version: 24.04
buildtype: release
use-clang: true
use-clang_stdlib: false
Expand All @@ -51,7 +61,7 @@ jobs:

- name: Linux Clang Release (libc++)
os: ubuntu
os-version: 22.04
os-version: 24.04
buildtype: release
use-clang: true
use-clang_stdlib: true
Expand Down Expand Up @@ -84,21 +94,32 @@ jobs:
fetch-depth: "0"

- name: Setup MSVC (Windows)
if: matrix.config.os == 'windows' && matrix.config.msvc == true
if: matrix.config.os == 'windows' && matrix.config.environment == 'msvc'
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64
toolset: 14.39


- name: Setup MinGW (Windows)
if: matrix.config.os == 'windows' && matrix.config.msvc == false
- name: Setup MYSYS2 (Windows)
if: matrix.config.os == 'windows' && ( matrix.config.environment == 'mingw' || matrix.config.environment == 'ucrt' )
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
msystem: ${{matrix.config.environment == 'mingw' && 'MINGW64' || 'UCRT64'}}
update: true
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja mingw-w64-x86_64-python mingw-w64-x86_64-python-pip mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-SDL2_mixer mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-pkg-config mingw-w64-x86_64-ca-certificates mingw-w64-x86_64-cmake git

install: >-
mingw-w64-${{matrix.config.architecture}}-gcc
mingw-w64-${{matrix.config.architecture}}-ninja
mingw-w64-${{matrix.config.architecture}}-python
mingw-w64-${{matrix.config.architecture}}-python-pip
mingw-w64-${{matrix.config.architecture}}-SDL2
mingw-w64-${{matrix.config.architecture}}-SDL2_ttf
mingw-w64-${{matrix.config.architecture}}-SDL2_mixer
mingw-w64-${{matrix.config.architecture}}-SDL2_image
mingw-w64-${{matrix.config.architecture}}-pkg-config
mingw-w64-${{matrix.config.architecture}}-ca-certificates
mingw-w64-${{matrix.config.architecture}}-cmake
git

- name: Setup Clang (Linux)
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == true
Expand All @@ -116,7 +137,7 @@ jobs:
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == false
uses: egor-tensin/setup-gcc@v1
with:
version: 13
version: 14
platform: x64

- name: Setup Clang (MacOS)
Expand All @@ -140,16 +161,17 @@ jobs:
brew update
brew install meson

# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
- name: Setup meson
if: matrix.config.os != 'macos'
run: |
python -m pip install --upgrade pip
pip install meson
pip install meson --break-system-packages

- name: Install dependencies (Linux)
if: matrix.config.os == 'ubuntu'
run: |
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* -y

- name: Install dependencies (MacOS)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nintendo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build:
name: Nintendo ${{ matrix.config.name }} CI
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: devkitpro/${{ matrix.config.container }} ## base on debian:buster-slim
strategy:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build:
name: Run Tests
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -24,16 +24,16 @@ jobs:
echo "CC=clang-18" >> "$GITHUB_ENV"
echo "CXX=clang++-18" >> "$GITHUB_ENV"

# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
- name: Setup meson
run: |
python -m pip install --upgrade pip
pip install meson
pip install meson --break-system-packages

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* -y
pip install gcovr
sudo apt-get upgrade -y
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* gcovr -y

- name: Configure
run: meson setup build -Dbuildtype=debug -Db_coverage=true -Dtests=true -Dclang_libcpp=enabled
Expand Down
84 changes: 50 additions & 34 deletions platforms/build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ for INDEX in "${ARCH_KEYS_INDEX[@]}"; do
ARM_COMPILER_TRIPLE=$(echo "$RAW_JSON" | jq -M -r -c '."llvm_triple"')
ARM_TOOL_TRIPLE=$(echo "$ARM_NAME_TRIPLE$SDK_VERSION" | sed s/$ARCH/$ARCH_VERSION/)

export SYM_LINK_PATH=sysroot_sym-$ARCH_VERSION
export SYM_LINK_PATH=sym-$ARCH_VERSION

export HOST_ROOT="$BASE_PATH/toolchains/llvm/prebuilt/linux-x86_64"
export SYS_ROOT="${HOST_ROOT}/$SYM_LINK_PATH"
export SYS_ROOT="${HOST_ROOT}/$SYM_LINK_PATH/sysroot"
export BIN_DIR="$HOST_ROOT/bin"
export PATH="$BIN_DIR:$PATH"

Expand Down Expand Up @@ -177,47 +177,41 @@ for INDEX in "${ARCH_KEYS_INDEX[@]}"; do

cd "$BUILD_DIR_MPG123"

wget -q "https://www.mpg123.de/download/mpg123-1.32.6.tar.bz2"
if [ ! -e "mpg123-1.32.6.tar.bz2" ]; then
wget -q "https://www.mpg123.de/download/mpg123-1.32.6.tar.bz2"
fi

tar -xf "mpg123-1.32.6.tar.bz2"
if [ ! -d "mpg123-1.32.6" ]; then
tar -xf "mpg123-1.32.6.tar.bz2"
fi

cd "mpg123-1.32.6"

BUILDYSTEM="cmake"

if [ $BUILDYSTEM = "autotools" ]; then

./configure --prefix="$SYS_ROOT/usr" --oldincludedir="$SYS_ROOT/usr/include" --host="$ARM_NAME_TRIPLE" --with-sysroot="$SYS_ROOT" --with-audio="dummy"

make

make install
cd ports/cmake/

else

cd ports/cmake/

BUILD_DIR_MPG123="build-mpg123"
BUILD_DIR_MPG123="build-mpg123"

mkdir -p "$BUILD_DIR_MPG123"
mkdir -p "$BUILD_DIR_MPG123"

cd "$BUILD_DIR_MPG123"
cd "$BUILD_DIR_MPG123"

if [ "$ARCH_VERSION" = "i686" ]; then
#cmake .. -DCMAKE_TOOLCHAIN_FILE=linux_i686.toolchain.cmake --install-prefix "$SYS_ROOT/usr" "-DCMAKE_SYSROOT=$SYS_ROOT" -DOUTPUT_MODULES=dummy -DCMAKE_POSITION_INDEPENDENT_CODE=ON
# cmake --build .
export MPG123_ANDROID_SSE_ENABLED="ON"

# cmake --install .
: # nop, for bash syntax
if [ "$ARCH_VERSION" = "i686" ]; then
MPG123_ANDROID_SSE_ENABLED="OFF"
fi

else
cmake .. --install-prefix "$SYS_ROOT/usr" "-DCMAKE_SYSROOT=$SYS_ROOT" -DOUTPUT_MODULES=dummy -DCMAKE_POSITION_INDEPENDENT_CODE=ON
cmake --build .
cmake .. --install-prefix "$SYS_ROOT/usr" "-DCMAKE_SYSROOT=$SYS_ROOT" -DOUTPUT_MODULES=dummy -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
"-DCMAKE_SYSTEM_NAME=Android" \
"-DCMAKE_SYSTEM_VERSION=$SDK_VERSION" \
"-DCMAKE_ANDROID_ARCH_ABI=$KEY" \
"-DCMAKE_ANDROID_NDK=$ANDROID_NDK" \
"-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang" \
"-DWITH_SSE=$MPG123_ANDROID_SSE_ENABLED"

cmake --install .
fi
cmake --build .

fi
cmake --install .

touch "$BUILD_MPG123_FILE"

Expand All @@ -241,17 +235,39 @@ for INDEX in "${ARCH_KEYS_INDEX[@]}"; do

cd "$BUILD_DIR_OPENSSL"

wget -q "https://github.com/openssl/openssl/releases/download/openssl-3.3.0/openssl-3.3.0.tar.gz"
if [ ! -e "openssl-3.3.0.tar.gz" ]; then
wget -q "https://github.com/openssl/openssl/releases/download/openssl-3.3.0/openssl-3.3.0.tar.gz"
fi

tar -xzf "openssl-3.3.0.tar.gz"
if [ ! -d "openssl-3.3.0" ]; then
tar -xzf "openssl-3.3.0.tar.gz"
fi

cd "openssl-3.3.0"

OPENSSL_TARGET_ARCH="android-$ARCH"

export ANDROID_NDK_ROOT="$ANDROID_NDK_HOME"

./Configure --prefix="$SYS_ROOT/usr" no-tests no-shared "$OPENSSL_TARGET_ARCH" "-D__ANDROID_API__=$SDK_VERSION"
if [ "$ARCH_VERSION" = "armv7a" ]; then

./Configure --prefix="$SYS_ROOT/usr" no-asm no-tests no-shared "$OPENSSL_TARGET_ARCH" "-D__ANDROID_API__=$SDK_VERSION"
else
./Configure --prefix="$SYS_ROOT/usr" no-tests no-shared "$OPENSSL_TARGET_ARCH" "-D__ANDROID_API__=$SDK_VERSION"
fi

make clean

if [ "$ARCH_VERSION" = "armv7-a" ]; then

# fix an compile time error since openssl 3.1.0 >
# see https://github.com/android/ndk/issues/1992
# Apply patch that fixes the armcap instruction

# sed -e '/[.]hidden.*OPENSSL_armcap_P/d; /[.]extern.*OPENSSL_armcap_P/ {p; s/extern/hidden/ }' -i -- crypto/*arm*pl crypto/*/asm/*arm*pl
sed -E -i '' -e '/[.]hidden.*OPENSSL_armcap_P/d' -e '/[.]extern.*OPENSSL_armcap_P/ {p; s/extern/hidden/; }' crypto/*arm*pl crypto/*/asm/*arm*pl

fi

make -j build_sw

Expand Down
4 changes: 2 additions & 2 deletions src/game/tetrion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ Tetrion::Tetrion(
bool is_top_level
)
: ui::Widget{ layout , ui::WidgetType::Component ,is_top_level},
m_next_gravity_simulation_step_index{ get_gravity_delay_frames() },
m_lock_delay_step_index{ lock_delay },
m_service_provider{ service_provider },
m_recording_writer{ std::move(recording_writer) },
m_random{ random_seed },
m_level{ starting_level },
m_tetrion_index{ tetrion_index },
m_next_gravity_simulation_step_index{ get_gravity_delay_frames() },
main_layout{
utils::size_t_identity<2>(),
0,
Expand Down Expand Up @@ -494,7 +494,7 @@ void Tetrion::refresh_previews() {
auto bag_index = usize{ 0 };
for (std::remove_cvref_t<decltype(num_preview_tetrominos)> i = 0; i < num_preview_tetrominos; ++i) {
m_preview_tetrominos.at(static_cast<usize>(i)) = Tetromino{
grid::preview_tetromino_position + shapes::UPoint{0, static_cast<u32>(grid::preview_padding * i)},
grid::preview_tetromino_position + shapes::UPoint{ 0, static_cast<u32>(grid::preview_padding * i) },
m_sequence_bags.at(bag_index)[sequence_index]
};
++sequence_index;
Expand Down
Loading
Loading