From 093310a9e5c96d364330672689866dd123e947a7 Mon Sep 17 00:00:00 2001 From: Nik Date: Fri, 13 Dec 2024 00:07:46 +0100 Subject: [PATCH] git: Updated CI to latest available compilers and distros (#2003) --- .github/workflows/analysis.yml | 4 +-- .github/workflows/build.yml | 37 ++++++++++++++---------- .github/workflows/build_web.yml | 2 +- .github/workflows/tests.yml | 11 ++++--- cmake/build_helpers.cmake | 1 + dist/AppImageBuilder.yml | 20 ++++++------- dist/Brewfile | 1 - dist/appimage/Dockerfile | 28 +++++++++--------- dist/get_deps_debian.sh | 4 +-- dist/get_deps_tumbleweed.sh | 4 +-- dist/macOS/arm64.Dockerfile | 2 +- dist/macOS/arm64.crosscompile.Dockerfile | 13 --------- plugins/disassembler/CMakeLists.txt | 1 + plugins/script_loader/CMakeLists.txt | 2 +- 14 files changed, 63 insertions(+), 67 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index cf5909604..252cdaad9 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -8,7 +8,7 @@ on: jobs: codeql: name: ๐Ÿ› CodeQL - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: actions: read contents: read @@ -49,7 +49,7 @@ jobs: set -x mkdir -p build cd build - CC=gcc-12 CXX=g++-12 cmake \ + CC=gcc-14 CXX=g++-14 cmake \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DCMAKE_INSTALL_PREFIX="$PWD/install" \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2282d4154..f16f2b710 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -255,14 +255,15 @@ jobs: set -x mkdir -p build cd build - CC=$(brew --prefix gcc@12)/bin/gcc-12 \ - CXX=$(brew --prefix gcc@12)/bin/g++-12 \ + CC=$(brew --prefix llvm)/bin/clang \ + CXX=$(brew --prefix llvm)/bin/clang++ \ OBJC=$(brew --prefix llvm)/bin/clang \ OBJCXX=$(brew --prefix llvm)/bin/clang++ \ PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig":"$(brew --prefix)/lib/pkgconfig" \ cmake -G "Ninja" \ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DIMHEX_GENERATE_PACKAGE=ON \ + -DIMHEX_SYSTEM_LIBRARY_PATH="$(brew --prefix llvm)/lib;$(brew --prefix llvm)/lib/unwind;$(brew --prefix llvm)/lib/c++;$(brew --prefix)/lib" \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_OBJC_COMPILER_LAUNCHER=ccache \ @@ -314,7 +315,7 @@ jobs: path: ./*.dmg macos-arm64-build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 name: ๐ŸŽ macOS 13 arm64 outputs: IMHEX_VERSION: ${{ steps.build.outputs.IMHEX_VERSION }} @@ -403,7 +404,13 @@ jobs: cd bundle ln -s /Applications Applications cd .. - hdiutil create -volname "ImHex" -srcfolder bundle -ov -format UDZO imhex-${{ env.IMHEX_VERSION }}-macOS-arm64.dmg + for i in $(seq 1 10); do + if hdiutil create -volname "ImHex" -srcfolder bundle -ov -format UDZO imhex-${{ env.IMHEX_VERSION }}-macOS-arm64.dmg; then + echo "Created dmg after ${i} attempts" + break + fi + sleep 10 + done - name: โฌ†๏ธ Upload DMG uses: actions/upload-artifact@v4 @@ -418,11 +425,11 @@ jobs: fail-fast: false matrix: include: - - release_num: 22.04 - - release_num: 24.04 + - release_num: "24.04" + - release_num: "24.10" name: ๐Ÿง Ubuntu ${{ matrix.release_num }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 container: image: "ubuntu:${{ matrix.release_num }}" @@ -462,7 +469,7 @@ jobs: git config --global --add safe.directory '*' mkdir -p build cd build - CC=gcc-12 CXX=g++-12 cmake -G "Ninja" \ + CC=gcc-14 CXX=g++-14 cmake -G "Ninja" \ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ @@ -497,7 +504,7 @@ jobs: # AppImage build appimage: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 name: โฌ‡๏ธ AppImage steps: - name: ๐Ÿงฐ Checkout @@ -541,7 +548,7 @@ jobs: # ArchLinux build archlinux-build: name: ๐Ÿง ArchLinux - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 container: image: archlinux:base-devel @@ -647,21 +654,21 @@ jobs: mock_release: rawhide release_num: rawhide mock_config: fedora-rawhide + - name: Fedora + mock_release: f41 + release_num: 41 + mock_config: fedora-41 - name: Fedora mock_release: f40 release_num: 40 mock_config: fedora-40 - - name: Fedora - mock_release: f39 - release_num: 39 - mock_config: fedora-39 - name: RHEL-AlmaLinux mock_release: epel9 release_num: 9 mock_config: "alma+epel-9" name: ๐Ÿง ${{ matrix.name }} ${{ matrix.release_num }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 container: image: "almalinux:9" diff --git a/.github/workflows/build_web.yml b/.github/workflows/build_web.yml index 569221aa6..139c68d29 100644 --- a/.github/workflows/build_web.yml +++ b/.github/workflows/build_web.yml @@ -20,7 +20,7 @@ permissions: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 name: ๐ŸŒ WebAssembly steps: - name: ๐Ÿงฐ Checkout diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6c2329a3f..b70c0fa1c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ on: jobs: tests: name: ๐Ÿงช Unit Tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: actions: read contents: read @@ -38,14 +38,13 @@ jobs: run: | sudo apt update sudo bash dist/get_deps_debian.sh - sudo apt install gcovr -y - name: ๐Ÿ› ๏ธ Build run: | set -x mkdir -p build cd build - CC=gcc-12 CXX=g++-12 cmake \ + CC=gcc-14 CXX=g++-14 cmake \ -DCMAKE_BUILD_TYPE=Debug \ -DIMHEX_ENABLE_UNIT_TESTS=ON \ -DIMHEX_ENABLE_PLUGIN_TESTS=ON \ @@ -70,7 +69,11 @@ jobs: # Generate report from all gcov .gcda files - name: ๐Ÿงช Generate coverage report run: | - gcovr --gcov-executable /usr/bin/gcov-12 -r . build --xml coverage_report.xml --verbose + sudo apt install python3-pip python3-venv + python3 -m venv venv + . venv/bin/activate + pip3 install gcovr + gcovr --gcov-executable /usr/bin/gcov-14 -e ".+yara_rules.+" -r . build --xml coverage_report.xml --verbose - name: Upload coverage reports to Codecov env: diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 0136c120e..7bbc9651b 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -240,6 +240,7 @@ macro(createPackage) if (APPLE) if (IMHEX_GENERATE_PACKAGE) + set(EXTRA_BUNDLE_LIBRARY_PATHS ${EXTRA_BUNDLE_LIBRARY_PATHS} "${IMHEX_SYSTEM_LIBRARY_PATH}") include(PostprocessBundle) set_target_properties(libimhex PROPERTIES SOVERSION ${IMHEX_VERSION}) diff --git a/dist/AppImageBuilder.yml b/dist/AppImageBuilder.yml index 2497e0d4c..dcb80905f 100644 --- a/dist/AppImageBuilder.yml +++ b/dist/AppImageBuilder.yml @@ -14,17 +14,17 @@ AppDir: - amd64 allow_unauthenticated: true sources: - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy main restricted - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy universe - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates universe - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy multiverse - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates multiverse - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy-backports main restricted + - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular main restricted + - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular-updates main restricted + - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular universe + - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular-updates universe + - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular multiverse + - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular-updates multiverse + - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular-backports main restricted universe multiverse - - sourceline: deb http://security.ubuntu.com/ubuntu jammy-security main restricted - - sourceline: deb http://security.ubuntu.com/ubuntu jammy-security universe - - sourceline: deb http://security.ubuntu.com/ubuntu jammy-security multiverse + - sourceline: deb http://security.ubuntu.com/ubuntu oracular-security main restricted + - sourceline: deb http://security.ubuntu.com/ubuntu oracular-security universe + - sourceline: deb http://security.ubuntu.com/ubuntu oracular-security multiverse include: - librsvg2-common - libbz2-1.0:amd64 diff --git a/dist/Brewfile b/dist/Brewfile index 3930be2b6..27966426e 100644 --- a/dist/Brewfile +++ b/dist/Brewfile @@ -6,7 +6,6 @@ brew "freetype2" brew "libmagic" brew "pkg-config" brew "curl" -brew "gcc@12" brew "llvm" brew "glfw" brew "ninja" diff --git a/dist/appimage/Dockerfile b/dist/appimage/Dockerfile index 38eb86ea2..25d18c5a7 100644 --- a/dist/appimage/Dockerfile +++ b/dist/appimage/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 as build +FROM ubuntu:24.10 as build # Used to invalidate layer cache but not mount cache # See https://github.com/moby/moby/issues/41715#issuecomment-733976493 @@ -14,24 +14,13 @@ apt update # general deps apt install -y ccache git wget # appimage tools deps -apt install -y python3-pip python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fuse ninja-build +apt install -y python3-pip python3-venv python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fuse ninja-build apt install -y squashfs-tools zsync # imhex deps /tmp/get_deps_debian.sh EOF -RUN --mount=type=cache,target=/cache <