diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf8ffeafd8..878865305a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,55 +43,6 @@ jobs: # There's ways to deduplicate these includes, but any mistake causes # utterly confounding errors, so just explicitly specify each target. include: - - os: ubuntu-20.04 - cross_os: '' - component: '' - qt: 5.15.14 - arch: x86_64 - sccache_triplet: x86_64-unknown-linux-musl - build_flags: -DINITSYS=systemd -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja - build_type: Release - collect_symbols: false - # This causes the AppImage to be generated, instead of just creating - # the portable tree, because there seems to be no way to separate - # these steps with linuxdeploy - # Even though the svg component is linked explicitly, - # linuxdeploy-plugin-qt does not seem to notice and so does not - # export the iconengine if it is not told that we really, really - # want svg plugins please - packager: >- - EXTRA_QT_PLUGINS="svg;" - VERSION="${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '$(git describe)' }}" - cmake --install build --config Release - # The runner has multiple clang versions installed and CMake/Qt gets - # confused about which one to pick for some reason, so this also - # sets Clang_ROOT during the Qt build - qt_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - libatspi2.0-dev libmtdev-dev libts-dev libgtk-3-dev - libgl1-mesa-dev libglu1-mesa-dev libxi-dev libdrm-dev - libgbm-dev libgl-dev libgles-dev libegl-dev libegl1-mesa-dev - libxext-dev libxfixes-dev libxrender-dev libx11-dev - libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev - libxkbcommon-dev libxkbcommon-x11-dev libxcb-keysyms1-dev - libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev - libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev - libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev - libxcb-util-dev libinput-dev libvulkan-dev - libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libclang-12-dev - libasound2-dev libpulse-dev libcups2-dev libssl-dev - libfontconfig1-dev && - echo "Clang_ROOT=/usr/lib/llvm-12" >> $GITHUB_ENV - ffmpeg_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - nasm yasm - other_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - libsecret-1-dev - - os: ubuntu-20.04 cross_os: Android component: '' @@ -104,91 +55,26 @@ jobs: cross_qt_args: >- "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - "-DANDROID_HOST_PATH=$GITHUB_WORKSPACE/.github/deps/qt" + "-DANDROID_PLATFORM=$ANDROID_PLATFORM" -DANDROID_ABI=arm64-v8a cross_ffmpeg_args: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" + "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - -DANDROID_PLATFORM=android-23 + "-DANDROID_PLATFORM=$ANDROID_PLATFORM" -DANDROID_ABI=arm64-v8a cross_other_args: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" + "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - -DANDROID_PLATFORM=android-23 + "-DANDROID_PLATFORM=$ANDROID_PLATFORM" -DANDROID_ABI=arm64-v8a build_flags: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" - -DANDROID_PLATFORM=android-23 + "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" + "-DANDROID_PLATFORM=$ANDROID_PLATFORM" + "-DANDROID_TARGET_SDK_VERSION=$ANDROID_TARGET_SDK_VERSION" + "-DANDROID_SDK_BUILD_TOOLS_REVISION=$ANDROID_BUILD_TOOLS_VERSION" -DANDROID_ABI=arm64-v8a - -DANDROID_SDK_PLATFORM=android-31 - -DANDROID_SDK_BUILD_TOOLS_REVISION=34.0.0 - -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=on - -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH - -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH - -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH - # The runner has multiple clang versions installed and CMake/Qt gets - # confused about which one to pick for some reason, so this also - # sets Clang_ROOT during the Qt build - qt_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - libatspi2.0-dev libmtdev-dev libts-dev libgtk-3-dev - libgl1-mesa-dev libglu1-mesa-dev libxi-dev libdrm-dev - libgbm-dev libgl-dev libgles-dev libegl-dev libegl1-mesa-dev - libxext-dev libxfixes-dev libxrender-dev libx11-dev - libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev - libxkbcommon-dev libxkbcommon-x11-dev libxcb-keysyms1-dev - libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev - libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev - libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev - libxcb-util-dev libinput-dev libvulkan-dev - libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libclang-12-dev - libasound2-dev libpulse-dev libcups2-dev libssl-dev - libfontconfig1-dev && - echo "Clang_ROOT=/usr/lib/llvm-12" >> $GITHUB_ENV - ffmpeg_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - yasm - other_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - libsecret-1-dev - - - os: ubuntu-20.04 - cross_os: Android - component: '' - qt: 5.15.14 - arch: arm32 - sccache_triplet: x86_64-unknown-linux-musl - build_type: Release - collect_symbols: false - packager: cmake --install build --config Release --prefix . - cross_qt_args: >- - "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - "-DANDROID_HOST_PATH=$GITHUB_WORKSPACE/.github/deps/qt" - -DANDROID_ABI=armeabi-v7a - cross_ffmpeg_args: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" - "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - -DANDROID_PLATFORM=android-23 - -DANDROID_ABI=armeabi-v7a - cross_other_args: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" - "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - -DANDROID_PLATFORM=android-23 - -DANDROID_ABI=armeabi-v7a - build_flags: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" - -DANDROID_PLATFORM=android-23 - -DANDROID_ABI=armeabi-v7a - -DANDROID_SDK_PLATFORM=android-31 - -DANDROID_SDK_BUILD_TOOLS_REVISION=34.0.0 -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=on -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH @@ -222,99 +108,6 @@ jobs: sudo apt-get install --no-install-recommends libsecret-1-dev - - os: macos-13 - cross_os: '' - component: '' - qt: 6.7.2 - arch: x86_64 - build_flags: -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja - build_type: Release - collect_symbols: false - sccache_triplet: x86_64-apple-darwin - packager: cpack --verbose --config build/CPackConfig.cmake -C Release - - - os: macos-14 - cross_os: '' - component: '' - qt: 6.7.2 - arch: arm64 - build_flags: -DBUILD_PACKAGE_SUFFIX=arm64 -G Ninja - build_type: Release - collect_symbols: false - sccache_triplet: aarch64-apple-darwin - packager: cpack --verbose --config build/CPackConfig.cmake -C Release - - - os: windows-latest - cross_os: '' - component: '' - qt: 5.15.14 - arch: x86_64 - sccache_triplet: x86_64-pc-windows-msvc - build_flags: -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja - build_type: RelWithDebInfo - collect_symbols: true - qt_pre_build: > - choco install gperf jom winflexbison3 && - New-Item -Path C:\ProgramData\Chocolatey\bin\flex.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_flex.exe && - New-Item -Path C:\ProgramData\Chocolatey\bin\bison.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_bison.exe - ffmpeg_pre_build: > - choco install yasm - # Copying files is a disgusting hack because windeployqt does not - # search PATH to find DLLs and it gets confused by QtKeychain having - # a Qt prefix and thinks it is part of Qt and tries to process it - # and fails if it is not in the Qt bin directory with the rest of - # them - packager: > - cp .github/deps/other/bin/qt*.dll .github/deps/qt/bin && - cpack --verbose --config build/CPackConfig.cmake -C RelWithDebInfo - - - os: windows-latest - cross_os: '' - component: 'Tools' - qt: 5.15.14 - arch: x86_64 - sccache_triplet: x86_64-pc-windows-msvc - build_flags: -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja - build_type: RelWithDebInfo - collect_symbols: false - qt_pre_build: > - choco install gperf jom winflexbison3 && - New-Item -Path C:\ProgramData\Chocolatey\bin\flex.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_flex.exe && - New-Item -Path C:\ProgramData\Chocolatey\bin\bison.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_bison.exe - ffmpeg_pre_build: > - choco install yasm - # Copying files is a disgusting hack because windeployqt does not - # search PATH to find DLLs and it gets confused by QtKeychain having - # a Qt prefix and thinks it is part of Qt and tries to process it - # and fails if it is not in the Qt bin directory with the rest of - # them - packager: > - cp .github/deps/other/bin/qt*.dll .github/deps/qt/bin && - cpack --verbose --config build/CPackConfig.cmake -C RelWithDebInfo - - - os: windows-latest - qt: 5.15.14 - arch: x86 - sccache_triplet: x86_64-pc-windows-msvc - build_flags: -DCARGO_TRIPLE=i686-pc-windows-msvc -DBUILD_PACKAGE_SUFFIX=x86 -G Ninja - build_type: RelWithDebInfo - collect_symbols: false - qt_pre_build: > - choco install gperf jom winflexbison3 && - New-Item -Path C:\ProgramData\Chocolatey\bin\flex.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_flex.exe && - New-Item -Path C:\ProgramData\Chocolatey\bin\bison.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_bison.exe - ffmpeg_pre_build: > - choco install yasm - # Copying files is a disgusting hack because windeployqt does not - # search PATH to find DLLs and it gets confused by QtKeychain having - # a Qt prefix and thinks it is part of Qt and tries to process it - # and fails if it is not in the Qt bin directory with the rest of - # them - packager: > - cp .github/deps/other/bin/qt*.dll .github/deps/qt/bin && - cpack --verbose --config build/CPackConfig.cmake -C RelWithDebInfo - - steps: - name: Check out code uses: actions/checkout@v4 @@ -360,12 +153,55 @@ jobs: msbuild-architecture: x${{ matrix.arch == 'x86_64' && '64' || '32' }} if: runner.os == 'Windows' - - name: Work around QTBUG-112465 + - name: Set Android environment variables + run: | + build_tools_version=34.0.0-rc3 + ndk_version=27.0.12077973 + target_sdk_version=34 + ndk_root="$ANDROID_SDK_ROOT/ndk/$ndk_version" + ndk_toolchain_file="$ndk_root/build/cmake/android.toolchain.cmake" + platform="android-$target_sdk_version" + echo "ANDROID_BUILD_TOOLS_VERSION=$build_tools_version" >> "$GITHUB_ENV" + echo "ANDROID_NDK_VERSION=$ndk_version" >> "$GITHUB_ENV" + echo "ANDROID_NDK_ROOT=$ndk_root" >> "$GITHUB_ENV" + echo "ANDROID_NDK_TOOLCHAIN_FILE=$ndk_toolchain_file" >> "$GITHUB_ENV" + echo "ANDROID_PLATFORM=$platform" >> "$GITHUB_ENV" + echo "ANDROID_TARGET_SDK_VERSION=$target_sdk_version" >> "$GITHUB_ENV" + if: matrix.cross_os == 'Android' + + # Qt's build toolage really likes to auto-detect Android package + # versions, despite all attempts to specify them explicitly. So we + # uninstall all the packages we don't need to avoid that happening. + - name: Install correct Android SDK packages, remove wrong ones run: | - # Moving directories is faster than deleting everything inside them - mv ${ANDROID_SDK_ROOT}/platforms/{android-*-*,..} - ls "${ANDROID_SDK_ROOT}/platforms" - shell: bash + sdkmanager="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" + packages_to_uninstall="$("$sdkmanager" --list_installed 2>&1 | perl -nae 'print "$F[0]\n" if $F[0] =~ /^(build-tools|ndk|platforms);/ && $F[0] ne "build-tools;$ENV{ANDROID_BUILD_TOOLS_VERSION}" && $F[0] ne "ndk;$ENV{ANDROID_NDK_VERSION}" && $F[0] ne "platforms;$ENV{ANDROID_PLATFORM}"')" + echo + echo "Packages to uninstall:" + echo "$packages_to_uninstall" | perl -pe 's/^/ * /' + echo + if [ -n "$packages_to_uninstall" ]; then + echo "$packages_to_uninstall" | xargs "$sdkmanager" --uninstall + fi + set -x + yes | "$sdkmanager" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" "ndk;$ANDROID_NDK_VERSION" "platforms;$ANDROID_PLATFORM" + if: matrix.cross_os == 'Android' + + # This check is here to make sure the Java version doesn't change from + # under us. Both 11 and 17 should be okay for android-34. Lower and + # higher versions are known broken. Anything in-between is not LTS. + - name: Check Java version + run: | + java_version_output="$(java -version 2>&1)" + echo "$java_version_output" + java_version="$(echo "$java_version_output" | perl -0777 -ne '/version\s+"([0-9]+)\./ && print $1')" + expected_java_version='11' + if [ "$java_version" = "$expected_java_version" ]; then + echo "Java version $java_version matches expected version $expected_java_version" + else + echo "Java version $java_version does NOT match expected version $expected_java_version" 1>&2 + exit 1 + fi if: matrix.cross_os == 'Android' - name: Configure Linux system dependencies