summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Halmet <heikki.halmet@qt.io>2022-11-25 07:56:45 +0000
committerHeikki Halmet <heikki.halmet@qt.io>2023-02-26 14:59:07 +0000
commitec2dd3438cc2c7c7893dc269804863003bb0e6f0 (patch)
tree3c227e0c2bfb77bc4be5fe83c80be9f7172acae9
parentf080b88d85973a3ed562ba842c412de66a574723 (diff)
downloadqt5-ec2dd3438cc2c7c7893dc269804863003bb0e6f0.tar.gz
Enable MySQL for Windows
Pick-to: 6.2 Task-number: QTQAINFRA-4999 Change-Id: Id967473858673253f536cb91f9a95d9d6a3d7f27 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
-rw-r--r--coin/platform_configs/cmake_platforms.yaml2
-rw-r--r--coin/provisioning/common/windows/mysql.ps165
2 files changed, 28 insertions, 39 deletions
diff --git a/coin/platform_configs/cmake_platforms.yaml b/coin/platform_configs/cmake_platforms.yaml
index 298289f7..3537b6a2 100644
--- a/coin/platform_configs/cmake_platforms.yaml
+++ b/coin/platform_configs/cmake_platforms.yaml
@@ -80,7 +80,7 @@ Configurations:
Features: ['Sccache', "DebugAndRelease", 'UseConfigure']
Configure arguments: '-debug-and-release -force-debug-info -headersclean -nomake examples -qt-zlib'
Environment variables: [
- 'CMAKE_ARGS=-DFEATURE_msvc_obj_debug_info=ON -DOPENSSL_ROOT_DIR={{.Env.OPENSSL_INCLUDE_x64}}\.. -DPostgreSQL_ROOT={{.Env.POSTGRESQL_LIB_x64}}\..',
+ 'CMAKE_ARGS=-DFEATURE_msvc_obj_debug_info=ON -DOPENSSL_ROOT_DIR={{.Env.OPENSSL_INCLUDE_x64}}\.. -DPostgreSQL_ROOT={{.Env.POSTGRESQL_LIB_x64}}\.. -DMySQL_ROOT={{.Env.ENV_MySQL_ROOT}} -DMySQL_LIBRARY_DIR={{.Env.ENV_MySQL_LIBRARY_DIR}}',
'NON_QTBASE_CMAKE_ARGS=-DFFMPEG_DIR={{.Env.FFMPEG_DIR_MSVC}}',
'LLVM_INSTALL_DIR={{.Env.LLVM_INSTALL_DIR_msvc}}',
'Protobuf_ROOT={{.Env.Protobuf_ROOT_msvc}}',
diff --git a/coin/provisioning/common/windows/mysql.ps1 b/coin/provisioning/common/windows/mysql.ps1
index 18a9ce88..9135a4e9 100644
--- a/coin/provisioning/common/windows/mysql.ps1
+++ b/coin/provisioning/common/windows/mysql.ps1
@@ -1,6 +1,6 @@
#############################################################################
##
-## Copyright (C) 2019 The Qt Company Ltd.
+## Copyright (C) 2023 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the provisioning scripts of the Qt Toolkit.
@@ -42,48 +42,37 @@
# This script installs MySQL $version.
# Both x86 and x64 versions needed when x86 integrations are done on x64 machine
-$version = "5.7.25"
-$baseNameX64 = "mysql-$version-winx64"
-$packagex64 = "C:\Windows\temp\$baseNameX64.zip"
-$baseNameX86 = "mysql-$version-win32"
-$packagex86 = "C:\Windows\temp\$baseNameX86.zip"
-$installFolder = "C:\Utils\my_sql"
+$version = "6.1.11"
+$installFolder = "C:\Utils"
+$officialUrl = "https://downloads.mysql.com/archives/get/p/19/file/mysql-connector-c-${version}-winx64.zip"
+$officialUrlDebug = "https://downloads.mysql.com/archives/get/p/19/file/mysql-connector-${version}-winx64-debug.zip"
+$cacheURl = "http://ci-files01-hki.ci.qt.io/input/windows/mysql-connector-c-${version}-winx64.zip"
+$cacheURlDebug = "http://ci-files01-hki.ci.qt.io/input/windows/mysql-connector-c-${version}-winx64-debug.zip"
+$sha = "93e22a1ba3944a6c8e01d3ea04c1bfb005b238f9"
+$shaDebug = "d54088a9182e2f03b4d6f44c327e341eeab16367"
+$zip = Get-DownloadLocation ("mysql-connector-c-" + $version + "-winx64.zip")
+$zipDebug = Get-DownloadLocation ("mysql-connector-c-" + $version + "-winx64-debug.zip")
-function DownloadAndInstall
-{
- Param (
- [string]$internalUrl,
- [string]$package,
- [string]$installPath
+function Install {
+ param(
+ [string]$officialUrl,
+ [string]$cacheUrl,
+ [string]$zip,
+ [string]$sha
)
- Write-Host "Fetching from URL ..."
- Copy-Item $internalUrl $package
-
- $zipDir = [io.path]::GetFileNameWithoutExtension($package)
- Extract-7Zip $package $installPath "$zipDir\lib $zipDir\bin $zipDir\share $zipDir\include"
-
- Remove "$package"
-}
-
-if (Is64BitWinHost) {
- # Install x64 bit version
- $architecture = "x64"
- $internalUrl = "\\ci-files01-hki.intra.qt.io\provisioning\windows\mysql-$version-winx64.zip"
-
- DownloadAndInstall $internalUrl $packagex64 $installFolder
-
- Set-EnvironmentVariable "MYSQL_INCLUDE_x64" "$installFolder\$baseNameX64\include"
- Set-EnvironmentVariable "MYSQL_LIB_x64" "$installFolder\$baseNameX64\lib"
+ Download $officialUrl $cacheURl $zip
+ Verify-Checksum $zip $sha
+ Extract-7Zip $zip $installFolder
+ Remove $zip
}
-# Install x86 bit version
-$architecture = "x86"
-$internalUrl = "\\ci-files01-hki.intra.qt.io\provisioning\windows\mysql-$version-win32.zip"
-DownloadAndInstall $internalUrl $packagex86 $installFolder
+Install $officialUrl $cacheURl $zip $sha
+Install $officialUrlDebug $cacheURlDebug $zipDebug $shaDebug
-Set-EnvironmentVariable "MYSQL_INCLUDE_x86" "$installFolder\$baseNameX86\include"
-Set-EnvironmentVariable "MYSQL_LIB_x86" "$installFolder\$baseNameX86\lib"
+# Can't set MySQL_ROOT & MySQL_LIBRARY_DIR variables. Those will enable mysql in every windows target.
+# Let's use ENV_MySQL_* and use it in platform_configs
+Set-EnvironmentVariable "ENV_MySQL_ROOT" "${installFolder}\mysql-connector-c-${version}-winx64"
+Set-EnvironmentVariable "ENV_MySQL_LIBRARY_DIR" "${installFolder}\mysql-connector-c-${version}-winx64\lib\vs14"
-# Store version information to ~/versions.txt, which is used to print version information to provision log.
Write-Output "MySQL = $version" >> ~/versions.txt