Bump MySQL to 5.7.44 on Windows too (#2232)

* Bump MySQL to 5.7.44 on Windows

* Look for MYSQL57 environment variable instead of MYSQL55
This commit is contained in:
peace-maker 2025-01-07 00:17:49 +01:00 committed by GitHub
parent a44cfe134a
commit 74f1f8f6bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 47 additions and 11 deletions

View File

@ -33,7 +33,7 @@ jobs:
ARCH: x86,x86_64 ARCH: x86,x86_64
DEPENDENCIES_FOLDER: dependencies DEPENDENCIES_FOLDER: dependencies
DEPENDENCIES_ROOT: ${{ github.workspace }}/dependencies DEPENDENCIES_ROOT: ${{ github.workspace }}/dependencies
MYSQL_VERSION: '5.5' MYSQL_VERSION: '5.7'
MMSOURCE_VERSION: '1.12' MMSOURCE_VERSION: '1.12'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -69,7 +69,7 @@ jobs:
# Satisfy checkout-deps requirement for a "sourcemod" folder. # Satisfy checkout-deps requirement for a "sourcemod" folder.
mkdir -p sourcemod mkdir -p sourcemod
../sourcemod/tools/checkout-deps.sh -s ${{ join(fromJSON(env.SDKS)) }} ../sourcemod/tools/checkout-deps.sh -s ${{ join(fromJSON(env.SDKS)) }} -d
- name: Install Linux dependencies - name: Install Linux dependencies
if: startsWith(runner.os, 'Linux') if: startsWith(runner.os, 'Linux')

View File

@ -146,7 +146,7 @@ class SMConfig(object):
self.mysql_root['x86'] = builder.options.mysql_path self.mysql_root['x86'] = builder.options.mysql_path
else: else:
for i in range(10): for i in range(10):
self.mysql_root['x86'] = ResolveEnvPath('MYSQL55', 'mysql-5.' + str(i)) self.mysql_root['x86'] = ResolveEnvPath('MYSQL57', 'mysql-5.' + str(i))
if self.mysql_root['x86']: if self.mysql_root['x86']:
break break
if not self.mysql_root['x86'] or not os.path.isdir(self.mysql_root['x86']): if not self.mysql_root['x86'] or not os.path.isdir(self.mysql_root['x86']):
@ -158,7 +158,7 @@ class SMConfig(object):
self.mysql_root['x86_64'] = builder.options.mysql64_path self.mysql_root['x86_64'] = builder.options.mysql64_path
else: else:
for i in range(10): for i in range(10):
self.mysql_root['x86_64'] = ResolveEnvPath('MYSQL55_64', 'mysql-5.' + str(i) + '-x86_64') self.mysql_root['x86_64'] = ResolveEnvPath('MYSQL57_64', 'mysql-5.' + str(i) + '-x86_64')
if self.mysql_root['x86_64']: if self.mysql_root['x86_64']:
break break
if not self.mysql_root['x86_64'] or not os.path.isdir(self.mysql_root['x86_64']): if not self.mysql_root['x86_64'] or not os.path.isdir(self.mysql_root['x86_64']):

View File

@ -13,6 +13,10 @@ if SM.mysql_root:
binary.compiler.cxxflags += ['-fno-rtti'] binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc': elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-'] binary.compiler.cxxflags += ['/GR-']
if builder.options.debug == '1':
binary.compiler.cflags += ['/MDd']
else:
binary.compiler.cflags += ['/MD']
if binary.compiler.target.platform == 'linux' or binary.compiler.target.platform == 'mac': if binary.compiler.target.platform == 'linux' or binary.compiler.target.platform == 'mac':
binary.compiler.postlink += [ binary.compiler.postlink += [
@ -25,8 +29,17 @@ if SM.mysql_root:
binary.compiler.postlink += ['-lrt'] binary.compiler.postlink += ['-lrt']
elif binary.compiler.target.platform == 'windows': elif binary.compiler.target.platform == 'windows':
binary.compiler.defines += ['WIN32_LEAN_AND_MEAN'] binary.compiler.defines += ['WIN32_LEAN_AND_MEAN']
if builder.options.debug == '1':
binary.compiler.defines += ['_ITERATOR_DEBUG_LEVEL=2']
binary.compiler.postlink += [
os.path.join(SM.mysql_root[arch], 'lib', 'debug', 'mysqlclient.lib'),
]
else:
binary.compiler.postlink += [
os.path.join(SM.mysql_root[arch], 'lib', 'mysqlclient.lib'),
]
binary.compiler.postlink += [ binary.compiler.postlink += [
os.path.join(SM.mysql_root[arch], 'lib', 'mysqlclient.lib'), 'crypt32.lib',
'wsock32.lib' 'wsock32.lib'
] ]

View File

@ -4,17 +4,22 @@
trap "exit" INT trap "exit" INT
download_mysql=1 download_mysql=1
download_mysql_debug=1
# List of HL2SDK branch names to download. # List of HL2SDK branch names to download.
# ./checkout-deps.sh -s tf2,css # ./checkout-deps.sh -s tf2,css
# Disable downloading of mysql libraries. # Disable downloading of mysql libraries.
# ./checkout-deps.sh -m # ./checkout-deps.sh -m
# Disable downloading of mysql debug libraries on Windows.
# ./checkout-deps.sh -d
while getopts ":s:m" opt; do while getopts ":s:m" opt; do
case $opt in case $opt in
s) IFS=', ' read -r -a sdks <<< "$OPTARG" s) IFS=', ' read -r -a sdks <<< "$OPTARG"
;; ;;
m) download_mysql=0 m) download_mysql=0
;; ;;
d) download_mysql_debug=0
;;
\?) echo "Invalid option -$OPTARG" >&2 \?) echo "Invalid option -$OPTARG" >&2
;; ;;
esac esac
@ -59,13 +64,14 @@ getmysql ()
} }
# 32-bit MySQL # 32-bit MySQL
mysqlfolder=mysql-5.5 mysqlfolder=mysql-5.7
if [ $ismac -eq 1 ]; then if [ $ismac -eq 1 ]; then
mysqlfolder=mysql-5.5
mysqlver=mysql-5.5.28-osx10.5-x86 mysqlver=mysql-5.5.28-osx10.5-x86
mysqlurl=https://cdn.mysql.com/archives/mysql-5.5/$mysqlver.$archive_ext mysqlurl=https://cdn.mysql.com/archives/mysql-5.5/$mysqlver.$archive_ext
elif [ $iswin -eq 1 ]; then elif [ $iswin -eq 1 ]; then
mysqlver=mysql-5.5.62-win32 mysqlver=mysql-5.7.44-win32
mysqlurl=https://cdn.mysql.com/archives/mysql-5.5/$mysqlver.$archive_ext mysqlurl=https://cdn.mysql.com/archives/mysql-5.7/$mysqlver.$archive_ext
# The folder in the zip archive does not contain the substring "-noinstall", so strip it # The folder in the zip archive does not contain the substring "-noinstall", so strip it
mysqlver=${mysqlver/-noinstall} mysqlver=${mysqlver/-noinstall}
else else
@ -77,13 +83,14 @@ if [ $download_mysql -eq 1 ]; then
fi fi
# 64-bit MySQL # 64-bit MySQL
mysqlfolder=mysql-5.5-x86_64 mysqlfolder=mysql-5.7-x86_64
if [ $ismac -eq 1 ]; then if [ $ismac -eq 1 ]; then
mysqlfolder=mysql-5.5-x86_64
mysqlver=mysql-5.5.28-osx10.5-x86_64 mysqlver=mysql-5.5.28-osx10.5-x86_64
mysqlurl=https://cdn.mysql.com/archives/mysql-5.5/$mysqlver.$archive_ext mysqlurl=https://cdn.mysql.com/archives/mysql-5.5/$mysqlver.$archive_ext
elif [ $iswin -eq 1 ]; then elif [ $iswin -eq 1 ]; then
mysqlver=mysql-5.5.62-winx64 mysqlver=mysql-5.7.44-winx64
mysqlurl=https://cdn.mysql.com/archives/mysql-5.5/$mysqlver.$archive_ext mysqlurl=https://cdn.mysql.com/archives/mysql-5.7/$mysqlver.$archive_ext
else else
mysqlver=mysql-5.7.44-linux-glibc2.12-x86_64 mysqlver=mysql-5.7.44-linux-glibc2.12-x86_64
mysqlurl=https://cdn.mysql.com/archives/mysql-5.7/$mysqlver.$archive_ext mysqlurl=https://cdn.mysql.com/archives/mysql-5.7/$mysqlver.$archive_ext
@ -92,6 +99,22 @@ if [ $download_mysql -eq 1 ]; then
getmysql getmysql
fi fi
if [ $iswin -eq 1 && $download_mysql_debug -eq 1 ]; then
mysqlfolder=mysql-5.7-debug
mysqlver=mysql-5.7.44-win32
mysqlurl=https://cdn.mysql.com/archives/mysql-5.7/$mysqlver-debug-test.$archive_ext
getmysql
cp -r $mysqlfolder/lib/* mysql-5.7/lib
rm -rf $mysqlfolder
mysqlfolder=mysql-5.7-debug-x86_64
mysqlver=mysql-5.7.44-winx64
mysqlurl=https://cdn.mysql.com/archives/mysql-5.7/$mysqlver-debug-test.$archive_ext
getmysql
cp -r $mysqlfolder/lib/* mysql-5.7-x86_64/lib
rm -rf $mysqlfolder
fi
checkout () checkout ()
{ {
if [ ! -d "$name" ]; then if [ ! -d "$name" ]; then