diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index d173c02975..197faea7e1 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -118,11 +118,13 @@ 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" 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 @@ -131,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 @@ -151,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 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) ### 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}" 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..d82cdeb108 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", @@ -139,8 +140,6 @@ Function Install-Dependencies Function Initialize-Build-Environment { param( - [Parameter(Mandatory=$true)] - [string] $QtInstallPath, [Parameter(Mandatory=$true)] [string] $BuildArch ) @@ -155,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)) { @@ -185,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" ` @@ -208,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 { @@ -236,15 +247,19 @@ 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 -BuildArch $_ + Initialize-Qt-Build-Environment -QtInstallPath $QtInstallPath32 -QtCompile $QtCompile32 + } + else + { + Initialize-Build-Environment -BuildArch $_ + Initialize-Qt-Build-Environment -QtInstallPath $QtInstallPath64 -QtCompile $QtCompile64 + } Build-App -BuildConfig "release" -BuildArch $_ $OriginalEnv | % { Set-Item "Env:$($_.Name)" $_.Value } } @@ -286,16 +301,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 -BuildArch "x86" Invoke-Native-Command -Command "msbuild" ` -Arguments ("$WindowsPath\nsProcess\nsProcess.sln", '/p:Configuration="Release UNICODE"', ` @@ -309,6 +320,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