From c8644f8ff181761fa7d481ef72c068c617244445 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Thu, 27 Jan 2022 00:30:01 +0100 Subject: [PATCH 1/7] Build: Document dmgbuild as reason for staying on macOS 10.15 --- .github/workflows/autobuild.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index d173c02975..2474efad44 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -118,6 +118,7 @@ jobs: - config_name: MacOS (artifacts) target_os: macos + # Stay on 10.15 as long as we use dmgbuild which does not work with 11's hdiutil (?) building_on_os: macos-10.15 cmd1_prebuild: "./autobuild/mac/artifacts/autobuild_mac_1_prepare.sh 5.15.2" cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh sign_if_possible" From 550510f218b513acd4564a2d02a971f8809b6f57 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Thu, 27 Jan 2022 00:36:56 +0100 Subject: [PATCH 2/7] Build: Allow different Xcode versions per target This updates the Github Autobuild workflow to make the Xcode version configurable through the build matrix. This helps when different macOS targets should be built by different Xcode versions. --- .github/workflows/autobuild.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 2474efad44..197faea7e1 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -124,6 +124,7 @@ jobs: cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh sign_if_possible" cmd3_postbuild: "./autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh" uses_codeql: false + xcode_version: 11.7 - config_name: MacOS Legacy (artifacts) target_os: macos @@ -132,6 +133,9 @@ jobs: cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh do_not_sign" cmd3_postbuild: "./autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh legacy" uses_codeql: false + # For Qt5 on Mac, we need to ensure SDK 10.15 is used, and not SDK 11.x + # This is done by selecting Xcode 11.7 instead of the latest default of 12.x + xcode_version: 11.7 - config_name: Windows (artifact+codeQL) target_os: windows @@ -152,13 +156,11 @@ jobs: runs-on: ${{ matrix.config.building_on_os }} steps: - # For Qt5 on Mac, we need to ensure SDK 10.15 is used, and not SDK 11.x - # This is done by selecting Xcode 11.7 instead of the latest default of 12.x - name: Select Xcode version for Mac if: ${{ matrix.config.target_os == 'macos' }} uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '11.7' + xcode-version: ${{ matrix.config.xcode_version }} # Checkout code - name: Checkout code From 30f638a4bdccdaa080c02e2392d4692abe371639 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Thu, 27 Jan 2022 01:15:25 +0100 Subject: [PATCH 3/7] Build: Permit different Qt versions for 32/64bit Windows --- .../autobuild_windowsinstaller_2_build.ps1 | 4 +-- windows/deploy_windows.ps1 | 27 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/autobuild/windows/autobuild_windowsinstaller_2_build.ps1 b/autobuild/windows/autobuild_windowsinstaller_2_build.ps1 index b18394de1e..960aed3ecf 100644 --- a/autobuild/windows/autobuild_windowsinstaller_2_build.ps1 +++ b/autobuild/windows/autobuild_windowsinstaller_2_build.ps1 @@ -33,11 +33,11 @@ echo "Build installer..." # Build the installer if ($BuildOption -ne "") { - powershell "$jamulus_project_path\windows\deploy_windows.ps1" "C:\Qt\5.15.2" -BuildOption $BuildOption + powershell "$jamulus_project_path\windows\deploy_windows.ps1" "C:\Qt\5.15.2" "C:\Qt\5.15.2" -BuildOption $BuildOption } else { - powershell "$jamulus_project_path\windows\deploy_windows.ps1" "C:\Qt\5.15.2" + powershell "$jamulus_project_path\windows\deploy_windows.ps1" "C:\Qt\5.15.2" "C:\Qt\5.15.2" } if ( !$? ) { diff --git a/windows/deploy_windows.ps1 b/windows/deploy_windows.ps1 index 77190118e2..629c41ab10 100644 --- a/windows/deploy_windows.ps1 +++ b/windows/deploy_windows.ps1 @@ -1,6 +1,7 @@ param ( # Replace default path with system Qt installation folder if necessary - [string] $QtInstallPath = "C:\Qt\5.15.2", + [string] $QtInstallPath32 = "C:\Qt\5.15.2", + [string] $QtInstallPath64 = "C:\Qt\5.15.2", [string] $QtCompile32 = "msvc2019", [string] $QtCompile64 = "msvc2019_64", [string] $AsioSDKName = "asiosdk_2.3.3_2019-06-14", @@ -236,15 +237,17 @@ Function Build-App # Build and deploy Jamulus 64bit and 32bit variants function Build-App-Variants { - param( - [Parameter(Mandatory=$true)] - [string] $QtInstallPath - ) - foreach ($_ in ("x86_64", "x86")) { $OriginalEnv = Get-ChildItem Env: - Initialize-Build-Environment -QtInstallPath $QtInstallPath -BuildArch $_ + if ($_ -eq "x86") + { + Initialize-Build-Environment -QtInstallPath $QtInstallPath32 -BuildArch $_ + } + else + { + Initialize-Build-Environment -QtInstallPath $QtInstallPath64 -BuildArch $_ + } Build-App -BuildConfig "release" -BuildArch $_ $OriginalEnv | % { Set-Item "Env:$($_.Name)" $_.Value } } @@ -286,16 +289,12 @@ Function Build-Installer # Build and copy NS-Process dll Function Build-NSProcess { - param( - [Parameter(Mandatory=$true)] - [string] $QtInstallPath - ) if (!(Test-Path -path "$WindowsPath\nsProcess.dll")) { echo "Building nsProcess..." $OriginalEnv = Get-ChildItem Env: - Initialize-Build-Environment -QtInstallPath $QtInstallPath -BuildArch "x86" + Initialize-Build-Environment -QtInstallPath $QtInstallPath32 -BuildArch "x86" Invoke-Native-Command -Command "msbuild" ` -Arguments ("$WindowsPath\nsProcess\nsProcess.sln", '/p:Configuration="Release UNICODE"', ` @@ -309,6 +308,6 @@ Function Build-NSProcess Clean-Build-Environment Install-Dependencies -Build-App-Variants -QtInstallPath $QtInstallPath -Build-NSProcess -QtInstallPath $QtInstallPath +Build-App-Variants +Build-NSProcess Build-Installer -BuildOption $BuildOption From 12a46621b63e0dc21954915ed1fefa2607e2d2eb Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Thu, 27 Jan 2022 01:17:46 +0100 Subject: [PATCH 4/7] Build: Split Qt/Non-Qt build env setup on Windows --- windows/deploy_windows.ps1 | 59 +++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/windows/deploy_windows.ps1 b/windows/deploy_windows.ps1 index 629c41ab10..1389a3f2d2 100644 --- a/windows/deploy_windows.ps1 +++ b/windows/deploy_windows.ps1 @@ -140,8 +140,6 @@ Function Install-Dependencies Function Initialize-Build-Environment { param( - [Parameter(Mandatory=$true)] - [string] $QtInstallPath, [Parameter(Mandatory=$true)] [string] $BuildArch ) @@ -156,29 +154,18 @@ Function Initialize-Build-Environment if ($BuildArch -Eq "x86_64") { $VcVarsBin = "$VsInstallPath\VC\Auxiliary\build\vcvars64.bat" - $QtMsvcSpecPath = "$QtInstallPath\$QtCompile64\bin" } else { $VcVarsBin = "$VsInstallPath\VC\Auxiliary\build\vcvars32.bat" - $QtMsvcSpecPath = "$QtInstallPath\$QtCompile32\bin" } - # Setup Qt executables paths for later calls - Set-Item Env:QtQmakePath "$QtMsvcSpecPath\qmake.exe" - Set-Item Env:QtWinDeployPath "$QtMsvcSpecPath\windeployqt.exe" - "" "**********************************************************************" "Using Visual Studio/Build Tools environment settings located at" $VcVarsBin "**********************************************************************" "" - "**********************************************************************" - "Using Qt binaries for Visual C++ located at" - $QtMsvcSpecPath - "**********************************************************************" - "" if (-Not (Test-Path -Path $VcVarsBin)) { @@ -186,13 +173,6 @@ Function Initialize-Build-Environment "Please install Visual Studio 2017 or above it before running this script." } - if (-Not (Test-Path -Path $Env:QtQmakePath)) - { - Throw "The Qt binaries for Microsoft Visual C++ 2017 or above could not be located at $QtMsvcSpecPath. " + ` - "Please install Qt with support for MSVC 2017 or above before running this script," + ` - "then call this script with the Qt install location, for example C:\Qt\5.15.2" - } - # Import environment variables set by vcvarsXX.bat into current scope $EnvDump = [System.IO.Path]::GetTempFileName() Invoke-Native-Command -Command "cmd" ` @@ -209,6 +189,36 @@ Function Initialize-Build-Environment Remove-Item -Path $EnvDump -Force } +# Setup Qt environment variables and build tool paths +Function Initialize-Qt-Build-Environment +{ + param( + [Parameter(Mandatory=$true)] + [string] $QtInstallPath, + [Parameter(Mandatory=$true)] + [string] $QtCompile + ) + + $QtMsvcSpecPath = "$QtInstallPath\$QtCompile\bin" + + # Setup Qt executables paths for later calls + Set-Item Env:QtQmakePath "$QtMsvcSpecPath\qmake.exe" + Set-Item Env:QtWinDeployPath "$QtMsvcSpecPath\windeployqt.exe" + + "**********************************************************************" + "Using Qt binaries for Visual C++ located at" + $QtMsvcSpecPath + "**********************************************************************" + "" + + if (-Not (Test-Path -Path $Env:QtQmakePath)) + { + Throw "The Qt binaries for Microsoft Visual C++ 2017 or above could not be located at $QtMsvcSpecPath. " + ` + "Please install Qt with support for MSVC 2017 or above before running this script," + ` + "then call this script with the Qt install location, for example C:\Qt\5.15.2" + } +} + # Build Jamulus x86_64 and x86 Function Build-App { @@ -242,11 +252,13 @@ function Build-App-Variants $OriginalEnv = Get-ChildItem Env: if ($_ -eq "x86") { - Initialize-Build-Environment -QtInstallPath $QtInstallPath32 -BuildArch $_ + Initialize-Build-Environment -BuildArch $_ + Initialize-Qt-Build-Environment -QtInstallPath $QtInstallPath32 -QtCompile $QtCompile32 } else { - Initialize-Build-Environment -QtInstallPath $QtInstallPath64 -BuildArch $_ + Initialize-Build-Environment -BuildArch $_ + Initialize-Qt-Build-Environment -QtInstallPath $QtInstallPath64 -QtCompile $QtCompile64 } Build-App -BuildConfig "release" -BuildArch $_ $OriginalEnv | % { Set-Item "Env:$($_.Name)" $_.Value } @@ -294,7 +306,8 @@ Function Build-NSProcess echo "Building nsProcess..." $OriginalEnv = Get-ChildItem Env: - Initialize-Build-Environment -QtInstallPath $QtInstallPath32 -BuildArch "x86" + Initialize-Build-Environment -BuildArch "x86" + Initialize-Qt-Build-Environment -QtInstallPath $QtInstallPath32 -QtCompile $QtCompile32 Invoke-Native-Command -Command "msbuild" ` -Arguments ("$WindowsPath\nsProcess\nsProcess.sln", '/p:Configuration="Release UNICODE"', ` From fa7d79eea00b3b78ea2540b2a9250d206312bcfa Mon Sep 17 00:00:00 2001 From: Tony Mountifield Date: Thu, 27 Jan 2022 01:18:08 +0100 Subject: [PATCH 5/7] Build: Build nsProcess as 32-bit without Qt Co-authored-by: Christian Hoffmann --- windows/deploy_windows.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/windows/deploy_windows.ps1 b/windows/deploy_windows.ps1 index 1389a3f2d2..d82cdeb108 100644 --- a/windows/deploy_windows.ps1 +++ b/windows/deploy_windows.ps1 @@ -307,7 +307,6 @@ Function Build-NSProcess $OriginalEnv = Get-ChildItem Env: Initialize-Build-Environment -BuildArch "x86" - Initialize-Qt-Build-Environment -QtInstallPath $QtInstallPath32 -QtCompile $QtCompile32 Invoke-Native-Command -Command "msbuild" ` -Arguments ("$WindowsPath\nsProcess\nsProcess.sln", '/p:Configuration="Release UNICODE"', ` From 875fd925109eb5d0c3fc1026136cff072452a639 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Thu, 27 Jan 2022 01:23:15 +0100 Subject: [PATCH 6/7] Autobuild: Mac: Add >=Qt6.2 bin path support With Qt 6.2 the binary location path changed from `clang_64` to `macos`. Therefore, check both places now to support the full range of relevant Qt releases. --- autobuild/mac/artifacts/autobuild_mac_1_prepare.sh | 8 +++++++- autobuild/mac/codeQL/autobuild_mac_1_prepare.sh | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/autobuild/mac/artifacts/autobuild_mac_1_prepare.sh b/autobuild/mac/artifacts/autobuild_mac_1_prepare.sh index cf5d399621..c9206b5cb2 100755 --- a/autobuild/mac/artifacts/autobuild_mac_1_prepare.sh +++ b/autobuild/mac/artifacts/autobuild_mac_1_prepare.sh @@ -18,7 +18,13 @@ python3 -m pip install aqtinstall python3 -m aqt install-qt --outputdir /usr/local/opt/qt mac desktop ${QT_VER} # add the qt binaries to the path -export -p PATH=/usr/local/opt/qt/${QT_VER}/clang_64/bin:"${PATH}" +# The clang_64 entry can be dropped when Qt <6.2 compatibility is no longer needed. +for qt_path in /usr/local/opt/qt/${QT_VER}/macos/bin /usr/local/opt/qt/${QT_VER}/clang_64/bin; do + if [[ -d $qt_path ]]; then + export -p PATH="${qt_path}:${PATH}" + break + fi +done echo "::set-env name=PATH::${PATH}" echo "the path is ${PATH}" diff --git a/autobuild/mac/codeQL/autobuild_mac_1_prepare.sh b/autobuild/mac/codeQL/autobuild_mac_1_prepare.sh index 14b77b6ac3..51d7f25c6e 100755 --- a/autobuild/mac/codeQL/autobuild_mac_1_prepare.sh +++ b/autobuild/mac/codeQL/autobuild_mac_1_prepare.sh @@ -18,7 +18,13 @@ python3 -m pip install aqtinstall python3 -m aqt install-qt --outputdir /usr/local/opt/qt mac desktop ${QT_VER} # add the qt binaries to the path -export -p PATH=/usr/local/opt/qt/${QT_VER}/clang_64/bin:"${PATH}" +# The clang_64 entry can be dropped when Qt <6.2 compatibility is no longer needed. +for qt_path in /usr/local/opt/qt/${QT_VER}/macos/bin /usr/local/opt/qt/${QT_VER}/clang_64/bin; do + if [[ -d $qt_path ]]; then + export -p PATH="${qt_path}:${PATH}" + break + fi +done echo "::set-env name=PATH::${PATH}" echo "the path is ${PATH}" From f454dab765b32647c562b393326975edca413bbd Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 2 Feb 2022 14:09:41 +0100 Subject: [PATCH 7/7] ChangeLog: Add #2328 (Qt6 build logic compatibility) --- ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index bae7f840fc..db8ab4a9b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -109,6 +109,9 @@ - Internal: Improved powershell redirect handling when building for Windows in Github (#2225). (contributed by @henkdegroot) +- Internal: Prepared autobuild logic for upcoming Qt6 compatibility (#2328). + (contributed by @hoffie, @softins) + ### 3.8.1 (2021-10-23) ###