From 5efa725e92e87497287408c8d4d011e63aa214bb Mon Sep 17 00:00:00 2001 From: DioEgizio <83089242+DioEgizio@users.noreply.github.com> Date: Sat, 5 Nov 2022 08:25:10 +0100 Subject: [PATCH 1/6] feat(actions) add arm64 build Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com> --- .github/workflows/build.yml | 53 ++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 792215314..d957f6275 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,6 +71,18 @@ jobs: qt_modules: 'qt5compat qtimageformats' qt_tools: '' + - os: windows-2022 + name: "Windows-MSVC-arm64" + msystem: '' + architecture: 'arm64' + vcvars_arch: 'amd64_arm64' + qt_ver: 6 + qt_host: windows + qt_arch: 'win64_msvc2019_arm64' + qt_version: '6.4.0' + qt_modules: 'qt5compat qtimageformats' + qt_tools: '' + - os: macos-12 name: macOS macosx_deployment_target: 10.15 @@ -139,7 +151,7 @@ jobs: if: (runner.os != 'Windows' || matrix.msystem == '') && inputs.build_type == 'Debug' uses: hendrikmuhs/ccache-action@v1.2.5 with: - key: ${{ matrix.os }}-qt${{ matrix.qt_ver }} + key: ${{ matrix.os }}-qt${{ matrix.qt_ver }}-${{ matrix.architecture }} - name: Setup ccache (Windows MinGW-w64) if: runner.os == 'Windows' && matrix.msystem != '' && inputs.build_type == 'Debug' @@ -188,8 +200,23 @@ jobs: if: runner.os == 'Linux' && matrix.qt_ver != 6 run: | sudo apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5 - - - name: Install Qt (macOS, AppImage & Windows MSVC) + + - name: Install host Qt (Windows MSVC arm64) + if: runner.os == 'Windows' && matrix.architecture == 'arm64' + uses: jurplel/install-qt-action@v3 + with: + version: ${{ matrix.qt_version }} + host: 'windows' + target: 'desktop' + arch: '' + modules: ${{ matrix.qt_modules }} + tools: ${{ matrix.qt_tools }} + cache: ${{ inputs.is_qt_cached }} + cache-key-prefix: host-qt-arm64-windows + dir: ${{ github.workspace }}\HostQt + set-env: false + + - name: Install Qt (macOS, Linux, Qt 6 & Windows MSVC) if: runner.os == 'Linux' && matrix.qt_ver == 6 || runner.os == 'macOS' || (runner.os == 'Windows' && matrix.msystem == '') uses: jurplel/install-qt-action@v3 with: @@ -201,6 +228,13 @@ jobs: tools: ${{ matrix.qt_tools }} cache: ${{ inputs.is_qt_cached }} + - name: Install MSVC (Windows MSVC) + if: runner.os == 'Windows' && matrix.msystem == '' + uses: ilammy/msvc-dev-cmd@v1 + with: + vsversion: 2022 + arch: ${{ matrix.vcvars_arch }} + - name: Prepare AppImage (Linux) if: runner.os == 'Linux' && matrix.qt_ver != 5 run: | @@ -210,6 +244,11 @@ jobs: ${{ github.workspace }}/.github/scripts/prepare_JREs.sh + - name: Add QT_HOST_PATH var (Windows MSVC arm64) + if: runner.os == 'Windows' && matrix.architecture == 'arm64' + run: | + echo "QT_HOST_PATH=${{ github.workspace }}\HostQt\Qt\${{ matrix.qt_version }}\msvc2019_64" >> $env:GITHUB_ENV + ## # CONFIGURE ## @@ -286,7 +325,7 @@ jobs: ctest -E "^example64|example$" --test-dir build --output-on-failure - name: Test (Windows MSVC) - if: runner.os == 'Windows' && matrix.msystem == '' + if: runner.os == 'Windows' && matrix.msystem == '' && matrix.architecture != 'arm64' run: | ctest -E "^example64|example$" --test-dir build --output-on-failure -C ${{ inputs.build_type }} @@ -324,12 +363,6 @@ jobs: EOF fi - - name: Add VC Enviroment Variables - if: runner.os == 'Windows' && matrix.msystem == '' - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{ matrix.vcvars_arch }} - - name: Package (Windows MinGW-w64) if: runner.os == 'Windows' && matrix.msystem != '' shell: msys2 {0} From efef2e95ab63fa06d0d46506aa3af3e096fb1589 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Thu, 24 Nov 2022 11:53:29 +0000 Subject: [PATCH 2/6] Use ECMQueryQt Only with Qt5 Qt6 provides CMake variables for the paths we need Signed-off-by: TheLastRar --- CMakeLists.txt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f04b733be..4a80e87bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,11 +235,18 @@ else() message(FATAL_ERROR "Qt version ${Launcher_QT_VERSION_MAJOR} is not supported") endif() -include(ECMQueryQt) -ecm_query_qt(QT_PLUGINS_DIR QT_INSTALL_PLUGINS) -ecm_query_qt(QT_LIBS_DIR QT_INSTALL_LIBS) -ecm_query_qt(QT_LIBEXECS_DIR QT_INSTALL_LIBEXECS) -ecm_query_qt(QT_DATA_DIR QT_HOST_DATA) +if(Launcher_QT_VERSION_MAJOR EQUAL 5) + include(ECMQueryQt) + ecm_query_qt(QT_PLUGINS_DIR QT_INSTALL_PLUGINS) + ecm_query_qt(QT_LIBS_DIR QT_INSTALL_LIBS) + ecm_query_qt(QT_LIBEXECS_DIR QT_INSTALL_LIBEXECS) + ecm_query_qt(QT_DATA_DIR QT_HOST_DATA) +else() + set(QT_PLUGINS_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_PLUGINS}) + set(QT_LIBS_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_LIBS}) + set(QT_LIBEXECS_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_LIBEXECS}) + set(QT_DATA_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_DATA}) +endif() set(QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs) # NOTE: Qt 6 already sets this by default From 94d164c0f2a2ab80515351d422cefffbdbf6c910 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Thu, 24 Nov 2022 13:09:17 +0000 Subject: [PATCH 3/6] Remove unused QT_DATA_DIR/QT_MKSPECS_DIR Signed-off-by: TheLastRar --- CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a80e87bc..5c326cfa4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,14 +240,11 @@ if(Launcher_QT_VERSION_MAJOR EQUAL 5) ecm_query_qt(QT_PLUGINS_DIR QT_INSTALL_PLUGINS) ecm_query_qt(QT_LIBS_DIR QT_INSTALL_LIBS) ecm_query_qt(QT_LIBEXECS_DIR QT_INSTALL_LIBEXECS) - ecm_query_qt(QT_DATA_DIR QT_HOST_DATA) else() set(QT_PLUGINS_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_PLUGINS}) set(QT_LIBS_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_LIBS}) set(QT_LIBEXECS_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_LIBEXECS}) - set(QT_DATA_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_DATA}) endif() -set(QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs) # NOTE: Qt 6 already sets this by default if (Qt5_POSITION_INDEPENDENT_CODE) From 24193163e102c7421261497b42bb44d22bbf09ef Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Fri, 25 Nov 2022 03:54:15 +0000 Subject: [PATCH 4/6] Maybe fix ResourceFolderModel Clang64 test failure Previously this test would fail sometimes without including ECMQueryQt Signed-off-by: TheLastRar --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c326cfa4..2bdd4811d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,7 +221,7 @@ if(Launcher_QT_VERSION_MAJOR EQUAL 5) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUNICODE -D_UNICODE") elseif(Launcher_QT_VERSION_MAJOR EQUAL 6) set(QT_VERSION_MAJOR 6) - find_package(Qt6 REQUIRED COMPONENTS Core Widgets Concurrent Network Test Xml Core5Compat) + find_package(Qt6 REQUIRED COMPONENTS Core CoreTools Widgets Concurrent Network Test Xml Core5Compat) list(APPEND Launcher_QT_LIBS Qt6::Core5Compat) if(NOT Launcher_FORCE_BUNDLED_LIBS) From 99dd9874df18fc7bea6114466c3c36597cf7d849 Mon Sep 17 00:00:00 2001 From: DioEgizio <83089242+DioEgizio@users.noreply.github.com> Date: Sat, 26 Nov 2022 08:41:41 +0100 Subject: [PATCH 5/6] refactor+fix: refactor the windows part of the release workflow and add arm to it Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com> --- .github/workflows/build.yml | 6 ++--- .github/workflows/trigger_release.yml | 36 +++++++++++++++++++-------- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d957f6275..b18ef30ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,17 +38,17 @@ jobs: qt_tools: '' - os: windows-2022 - name: "Windows-Legacy" + name: "Windows-MinGW-w64-Legacy" msystem: clang32 qt_ver: 5 - os: windows-2022 - name: "Windows" + name: "Windows-MinGW-w64" msystem: clang64 qt_ver: 6 - os: windows-2022 - name: "Windows-Legacy-MSVC" + name: "Windows-MSVC-Legacy" msystem: '' architecture: 'win32' vcvars_arch: 'amd64_x86' diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml index 8baa9693a..ac20c943f 100644 --- a/.github/workflows/trigger_release.yml +++ b/.github/workflows/trigger_release.yml @@ -46,14 +46,27 @@ jobs: tar -czf PrismLauncher-${{ env.VERSION }}.tar.gz PrismLauncher-${{ env.VERSION }} - for d in PrismLauncher-Windows-*; do + for d in PrismLauncher-Windows-MSVC*; do + cd "${d}" || continue + LEGACY="$(echo -n ${d} | grep -o Legacy || true)" + ARM64="$(echo -n ${d} | grep -o arm64 || true)" + INST="$(echo -n ${d} | grep -o Setup || true)" + PORT="$(echo -n ${d} | grep -o Portable || true)" + NAME="PrismLauncher-Windows-MSVC" + test -z "${LEGACY}" || NAME="${NAME}-Legacy" + test -z "${ARM64}" || NAME="${NAME}-arm64" + test -z "${PORT}" || NAME="${NAME}-Portable" + test -z "${INST}" || mv PrismLauncher-*.exe ../${NAME}-Setup-${{ env.VERSION }}.exe + test -n "${INST}" || zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" * + cd .. + done + + for d in PrismLauncher-Windows-MinGW-w64*; do cd "${d}" || continue - MSVC="$(echo -n ${d} | grep -o MSVC || true)" LEGACY="$(echo -n ${d} | grep -o Legacy || true)" INST="$(echo -n ${d} | grep -o Setup || true)" PORT="$(echo -n ${d} | grep -o Portable || true)" - NAME="PrismLauncher-Windows" - test -z "${MSVC}" && NAME="${NAME}-MinGW" || NAME="${NAME}-MSVC" + NAME="PrismLauncher-Windows-MinGW-w64" test -z "${LEGACY}" || NAME="${NAME}-Legacy" test -z "${PORT}" || NAME="${NAME}-Portable" test -z "${INST}" || mv PrismLauncher-*.exe ../${NAME}-Setup-${{ env.VERSION }}.exe @@ -77,15 +90,18 @@ jobs: PrismLauncher-Linux-${{ env.VERSION }}-x86_64.AppImage PrismLauncher-Linux-Qt6-${{ env.VERSION }}.tar.gz PrismLauncher-Linux-Qt6-Portable-${{ env.VERSION }}.tar.gz - PrismLauncher-Windows-MinGW-Legacy-${{ env.VERSION }}.zip - PrismLauncher-Windows-MinGW-Legacy-Portable-${{ env.VERSION }}.zip - PrismLauncher-Windows-MinGW-Legacy-Setup-${{ env.VERSION }}.exe - PrismLauncher-Windows-MinGW-${{ env.VERSION }}.zip - PrismLauncher-Windows-MinGW-Portable-${{ env.VERSION }}.zip - PrismLauncher-Windows-MinGW-Setup-${{ env.VERSION }}.exe + PrismLauncher-Windows-MinGW-w64-Legacy-${{ env.VERSION }}.zip + PrismLauncher-Windows-MinGW-w64-Legacy-Portable-${{ env.VERSION }}.zip + PrismLauncher-Windows-MinGW-w64-Legacy-Setup-${{ env.VERSION }}.exe + PrismLauncher-Windows-MinGW-w64-${{ env.VERSION }}.zip + PrismLauncher-Windows-MinGW-w64-Portable-${{ env.VERSION }}.zip + PrismLauncher-Windows-MinGW-w64-Setup-${{ env.VERSION }}.exe PrismLauncher-Windows-MSVC-Legacy-${{ env.VERSION }}.zip PrismLauncher-Windows-MSVC-Legacy-Portable-${{ env.VERSION }}.zip PrismLauncher-Windows-MSVC-Legacy-Setup-${{ env.VERSION }}.exe + PrismLauncher-Windows-MSVC-arm64-${{ env.VERSION }}.zip + PrismLauncher-Windows-MSVC-arm64-Portable-${{ env.VERSION }}.zip + PrismLauncher-Windows-MSVC-arm64-Setup-${{ env.VERSION }}.exe PrismLauncher-Windows-MSVC-${{ env.VERSION }}.zip PrismLauncher-Windows-MSVC-Portable-${{ env.VERSION }}.zip PrismLauncher-Windows-MSVC-Setup-${{ env.VERSION }}.exe From 4c1c26a0e61fa492abb3715fe294fa25ca129649 Mon Sep 17 00:00:00 2001 From: DioEgizio <83089242+DioEgizio@users.noreply.github.com> Date: Wed, 30 Nov 2022 13:52:02 +0100 Subject: [PATCH 6/6] chore: drop Windows-MinGW-w64-Legacy this brings back the number of builds as the same as before the pr this is one of the slowest builds + windows 7/8.1 users can just use Windows-MSVC-Legacy Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com> --- .github/workflows/build.yml | 27 ++++++++------------------- .github/workflows/trigger_release.yml | 5 ----- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b18ef30ff..1ba5d0e48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,15 +37,9 @@ jobs: qt_modules: 'qt5compat qtimageformats' qt_tools: '' - - os: windows-2022 - name: "Windows-MinGW-w64-Legacy" - msystem: clang32 - qt_ver: 5 - - os: windows-2022 name: "Windows-MinGW-w64" msystem: clang64 - qt_ver: 6 - os: windows-2022 name: "Windows-MSVC-Legacy" @@ -135,12 +129,12 @@ jobs: cmake:p extra-cmake-modules:p ninja:p - qt${{ matrix.qt_ver }}-base:p - qt${{ matrix.qt_ver }}-svg:p - qt${{ matrix.qt_ver }}-imageformats:p - quazip-qt${{ matrix.qt_ver }}:p + qt6-base:p + qt6-svg:p + qt6-imageformats:p + quazip-qt6:p ccache:p - ${{ matrix.qt_ver == 6 && 'qt6-5compat:p' || '' }} + qt6-5compat:p - name: Force newer ccache if: runner.os == 'Windows' && matrix.msystem == '' && inputs.build_type == 'Debug' @@ -174,9 +168,9 @@ jobs: uses: actions/cache@v3.0.11 with: path: '${{ github.workspace }}\.ccache' - key: ${{ matrix.os }}-qt${{ matrix.qt_ver }} + key: ${{ matrix.os }}-mingw-w64 restore-keys: | - ${{ matrix.os }}-qt${{ matrix.qt_ver }} + ${{ matrix.os }}-mingw-w64 - name: Set short version shell: bash @@ -267,7 +261,7 @@ jobs: if: runner.os == 'Windows' && matrix.msystem != '' shell: msys2 {0} run: | - cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_OBJDUMP=/mingw64/bin/objdump.exe -G Ninja + cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=6 -DCMAKE_OBJDUMP=/mingw64/bin/objdump.exe -G Ninja - name: Configure CMake (Windows MSVC) if: runner.os == 'Windows' && matrix.msystem == '' @@ -369,11 +363,6 @@ jobs: run: | cmake --install ${{ env.BUILD_DIR }} - cd ${{ env.INSTALL_DIR }} - if [ "${{ matrix.qt_ver }}" == "5" ]; then - cp /clang32/bin/libcrypto-1_1.dll /clang32/bin/libssl-1_1.dll ./ - fi - - name: Package (Windows MSVC) if: runner.os == 'Windows' && matrix.msystem == '' run: | diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml index ac20c943f..a2f89819c 100644 --- a/.github/workflows/trigger_release.yml +++ b/.github/workflows/trigger_release.yml @@ -63,11 +63,9 @@ jobs: for d in PrismLauncher-Windows-MinGW-w64*; do cd "${d}" || continue - LEGACY="$(echo -n ${d} | grep -o Legacy || true)" INST="$(echo -n ${d} | grep -o Setup || true)" PORT="$(echo -n ${d} | grep -o Portable || true)" NAME="PrismLauncher-Windows-MinGW-w64" - test -z "${LEGACY}" || NAME="${NAME}-Legacy" test -z "${PORT}" || NAME="${NAME}-Portable" test -z "${INST}" || mv PrismLauncher-*.exe ../${NAME}-Setup-${{ env.VERSION }}.exe test -n "${INST}" || zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" * @@ -90,9 +88,6 @@ jobs: PrismLauncher-Linux-${{ env.VERSION }}-x86_64.AppImage PrismLauncher-Linux-Qt6-${{ env.VERSION }}.tar.gz PrismLauncher-Linux-Qt6-Portable-${{ env.VERSION }}.tar.gz - PrismLauncher-Windows-MinGW-w64-Legacy-${{ env.VERSION }}.zip - PrismLauncher-Windows-MinGW-w64-Legacy-Portable-${{ env.VERSION }}.zip - PrismLauncher-Windows-MinGW-w64-Legacy-Setup-${{ env.VERSION }}.exe PrismLauncher-Windows-MinGW-w64-${{ env.VERSION }}.zip PrismLauncher-Windows-MinGW-w64-Portable-${{ env.VERSION }}.zip PrismLauncher-Windows-MinGW-w64-Setup-${{ env.VERSION }}.exe