Diff mysql-8.0.31-r2 with a mysql-8.0.32-r2

/usr/portage/dev-db/mysql/mysql-8.0.32-r2.ebuild 2024-12-25 14:59:47.791270057 +0300
4 4
EAPI=8
5 5

  
6 6
CMAKE_MAKEFILE_GENERATOR=emake
7
inherit check-reqs cmake flag-o-matic linux-info multiprocessing prefix toolchain-funcs
7
inherit check-reqs cmake edo flag-o-matic linux-info multiprocessing prefix toolchain-funcs
8 8

  
9 9
MY_PV="${PV//_pre*}"
10 10
MY_P="${PN}-${MY_PV}"
11 11

  
12 12
# Patch version
13
PATCH_SET=( https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-patches-01.tar.xz )
13
PATCH_SET=( https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-8.0.31-patches-01.tar.xz )
14 14

  
15 15
HOMEPAGE="https://www.mysql.com/"
16 16
DESCRIPTION="A fast, multi-threaded, multi-user SQL database server"
......
39 39
# Be warned, *DEPEND are version-dependent
40 40
# These are used for both runtime and compiletime
41 41
COMMON_DEPEND="
42
	>=app-arch/lz4-0_p131:=
42
	>=app-arch/lz4-1.9.4:=
43 43
	app-arch/zstd:=
44
	sys-libs/ncurses:0=
45
	>=sys-libs/zlib-1.2.3:0=
46
	>=dev-libs/openssl-1.0.0:0=
44
	>=dev-libs/openssl-1.0.0:=
45
	sys-libs/ncurses:=
46
	>=sys-libs/zlib-1.2.13:=
47 47
	server? (
48 48
		dev-libs/icu:=
49 49
		dev-libs/libevent:=[ssl,threads(+)]
50 50
		>=dev-libs/protobuf-3.8:=
51 51
		net-libs/libtirpc:=
52 52
		cjk? ( app-text/mecab:= )
53
		jemalloc? ( dev-libs/jemalloc:0= )
53
		jemalloc? ( dev-libs/jemalloc:= )
54 54
		kernel_linux? (
55
			dev-libs/libaio:0=
56
			sys-process/procps:0=
55
			dev-libs/libaio:=
56
			sys-process/procps:=
57 57
		)
58 58
		numa? ( sys-process/numactl )
59
		tcmalloc? ( dev-util/google-perftools:0= )
59
		tcmalloc? ( dev-util/google-perftools:= )
60 60
	)
61 61
"
62

  
63 62
DEPEND="
64 63
	${COMMON_DEPEND}
65
	|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
66 64
	app-alternatives/yacc
67 65
	server? ( net-libs/rpcsvc-proto )
68 66
	test? (
......
70 68
		dev-perl/JSON
71 69
	)
72 70
"
73

  
74 71
RDEPEND="
75 72
	${COMMON_DEPEND}
76
	!dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster
73
	!dev-db/mariadb
74
	!dev-db/mariadb-galera
75
	!dev-db/percona-server
76
	!dev-db/mysql-cluster
77 77
	!dev-db/mysql:0
78 78
	!dev-db/mysql:5.7
79 79
	selinux? ( sec-policy/selinux-mysql )
......
82 82
		dev-db/mysql-init-scripts
83 83
	)
84 84
"
85

  
86 85
# For other stuff to bring us in
87 86
# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
88 87
PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
89 88

  
90 89
PATCHES=(
91 90
	"${WORKDIR}"/mysql-patches
92
	"${FILESDIR}"/mysql-8.0.31-build-tmpdir-nodefault.patch
91
	"${FILESDIR}"/${PN}-8.0.32-gcc13.patch
93 92
)
94 93

  
95 94
mysql_init_vars() {
......
109 108
		if use server ; then
110 109
			CHECKREQS_DISK_BUILD="3G"
111 110

  
112
			if has test $FEATURES ; then
111
			if has test ${FEATURES} ; then
113 112
				CHECKREQS_DISK_BUILD="9G"
114 113
			fi
115 114

  
......
134 133
			fi
135 134

  
136 135
			local aio_max_nr=$(sysctl -n fs.aio-max-nr 2>/dev/null)
137
			[[ -z "${aio_max_nr}" || ${aio_max_nr} -lt 250000 ]] \
138
				&& die "FEATURES=test will require fs.aio-max-nr=250000 at minimum!"
136
			if [[ -z "${aio_max_nr}" || ${aio_max_nr} -lt 250000 ]] ; then
137
				die "FEATURES=test will require fs.aio-max-nr=250000 at minimum!"
138
			fi
139 139

  
140 140
			if use latin1 ; then
141 141
				# Upstream only supports tests with default charset
......
143 143
			fi
144 144
		fi
145 145

  
146
		if use kernel_linux ; then
147
			if use numa ; then
148
				linux-info_get_any_version
146
		if use kernel_linux && use numa ; then
147
			linux-info_get_any_version
149 148

  
150
				local CONFIG_CHECK="~NUMA"
149
			local CONFIG_CHECK="~NUMA"
151 150

  
152
				local WARNING_NUMA="This package expects NUMA support in kernel which this system does not have at the moment;"
153
				WARNING_NUMA+=" Either expect runtime errors, enable NUMA support in kernel or rebuild the package without NUMA support"
151
			local WARNING_NUMA="This package expects NUMA support in kernel which this system does not have at the moment;"
152
			WARNING_NUMA+=" Either expect runtime errors, enable NUMA support in kernel or rebuild the package without NUMA support"
154 153

  
155
				check_extra_config
156
			fi
154
			check_extra_config
157 155
		fi
158 156

  
159 157
		use server && check-reqs_pkg_setup
......
194 192
	# Code is now requiring C++17 due to https://github.com/mysql/mysql-server/commit/236ab55bedd8c9eacd80766d85edde2a8afacd08
195 193
	append-cxxflags -std=c++17
196 194

  
197
	CMAKE_BUILD_TYPE="RelWithDebInfo"
195
	# Broken with FORTIFY_SOURCE=3
196
	# Our toolchain sets F_S=2 by default w/ >= -O2, so we need
197
	# to unset F_S first, then explicitly set 2, to negate any default
198
	# and anything set by the user if they're choosing 3 (or if they've
199
	# modified GCC to set 3).
200
	#
201
	# bug #891259
202
	if tc-enables-fortify-source ; then
203
		filter-flags -D_FORTIFY_SOURCE=3
204
		append-cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
205
	fi
198 206

  
199 207
	# debug hack wrt #497532
200 208
	local mycmakeargs=(
......
329 337
}
330 338

  
331 339
# Official test instructions:
332
# ulimit -n 16500 && \
333
# USE='perl server' \
334
# FEATURES='test userpriv' \
335
# ebuild mysql-X.X.XX.ebuild \
336
# digest clean package
340
# ulimit -n 16500 && USE='perl server' FEATURES='test userpriv' \
341
# ebuild mysql-X.X.XX.ebuild digest clean test install
337 342
src_test() {
338 343
	_disable_test() {
339 344
		local rawtestname bug reason
340 345
		rawtestname="${1}" ; shift
341 346
		bug="${1}" ; shift
342 347
		reason="${@}"
348

  
343 349
		ewarn "test '${rawtestname}' disabled: '${reason}' (BUG#${bug})"
344
		echo ${rawtestname} : BUG#${bug} ${reason} >> "${T}/disabled.def"
350
		echo "${rawtestname} : BUG#${bug} ${reason}" >> "${T}/disabled.def"
345 351
	}
346 352

  
347 353
	local TESTDIR="${BUILD_DIR}/mysql-test"
348 354
	local retstatus_tests
349 355

  
356
	einfo "Official test instructions:"
357
	einfo "ulimit -n 16500 && USE='perl server' FEATURES='test userpriv' ebuild ..."
358

  
350 359
	if ! use server ; then
351
		einfo "Skipping server tests due to minimal build."
360
		ewarn "Skipping server tests due to minimal build!"
352 361
		return 0
353 362
	fi
354 363

  
......
360 369

  
361 370
		if [[ ${MTR_PARALLEL} -gt 4 ]] ; then
362 371
			# Running multiple tests in parallel usually require higher ulimit
363
			# and fs.aio-max-nr setting. In addition, tests like main.multi_update
364
			# are known to hit timeout when system is busy.
372
			# and fs.aio-max-nr settings. In addition, tests like main.multi_update
373
			# are known to hit timeouts when the system is busy.
374
			#
365 375
			# To avoid test failure we will limit MTR_PARALLEL to 4 instead of
366 376
			# using "auto".
367
			local info_msg="Parallel MySQL test suite jobs limited to 4 (MAKEOPTS=${MTR_PARALLEL})"
368
			info_msg+=" to avoid test failures. Set MTR_PARALLEL if you know what you are doing!"
369
			einfo "${info_msg}"
370
			unset info_msg
377
			einfo "Parallel MySQL test suite jobs limited to 4 (MAKEOPTS=${MTR_PARALLEL})"
378
			einfo "to avoid test failures. Set MTR_PARALLEL if you know what you are doing!"
371 379
			MTR_PARALLEL=4
372 380
		fi
373 381
	else
374 382
		einfo "MTR_PARALLEL is set to '${MTR_PARALLEL}'"
375 383
	fi
376 384

  
377
	# create directories because mysqladmin might run out of order
385
	# Create directories because mysqladmin might run out of order
378 386
	mkdir -p "${T}"/var-tests{,/log} || die
379 387

  
380 388
	# Run mysql tests
381 389
	pushd "${TESTDIR}" &>/dev/null || die
382 390

  
383
	touch "${T}/disabled.def"
391
	touch "${T}/disabled.def" || die
384 392

  
385
	local -a disabled_tests
386
	disabled_tests+=( "auth_sec.atomic_rename_user;103512;Depends on user running test" )
387
	disabled_tests+=( "auth_sec.keyring_file_data_qa;0;Won't work with user privileges" )
388
	disabled_tests+=( "auth_sec.openssl_without_fips;94718;Known test failure" )
389
	disabled_tests+=( "gis.geometry_class_attri_prop;5452;Known rounding error with latest AMD processors (PS)" )
390
	disabled_tests+=( "gis.geometry_property_function_issimple;5452;Known rounding error with latest AMD processors (PS)" )
391
	disabled_tests+=( "gis.gis_bugs_crashes;5452;Known rounding error with latest AMD processors (PS)" )
392
	disabled_tests+=( "gis.spatial_analysis_functions_buffer;5452;Known rounding error with latest AMD processors (PS)" )
393
	disabled_tests+=( "gis.spatial_analysis_functions_centroid;5452;Known rounding error with latest AMD processors (PS)" )
394
	disabled_tests+=( "gis.spatial_analysis_functions_distance;5452;Known rounding error with latest AMD processors (PS)" )
395
	disabled_tests+=( "gis.spatial_op_testingfunc_mix;5452;Known rounding error with latest AMD processors (PS)" )
396
	disabled_tests+=( "gis.spatial_operators_intersection;5452;Known rounding error with latest AMD processors (PS)" )
397
	disabled_tests+=( "gis.spatial_utility_function_distance_sphere;5452;Known rounding error with latest AMD processors (PS)" )
398
	disabled_tests+=( "gis.spatial_utility_function_simplify;5452;Known rounding error with latest AMD processors (PS)" )
399
	disabled_tests+=( "gis.st_symdifference;5452;Known rounding error with latest AMD processors (PS)" )
400
	disabled_tests+=( "innodb.alter_kill;0;Known test failure -- no upstream bug yet" )
401
	disabled_tests+=( "main.derived_limit;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
402
	disabled_tests+=( "main.explain_tree;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
403
	disabled_tests+=( "main.gis-precise;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
404
	disabled_tests+=( "main.mysql_load_data_local_dir;0;Known test failure -- no upstream bug yet" )
405
	disabled_tests+=( "main.select_icp_mrr;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
406
	disabled_tests+=( "main.subquery_bugs;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
407
	disabled_tests+=( "main.subquery_sj_dupsweed;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
408
	disabled_tests+=( "main.subquery_sj_dupsweed_bka;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
409
	disabled_tests+=( "main.subquery_sj_dupsweed_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
410
	disabled_tests+=( "main.subquery_sj_firstmatch;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
411
	disabled_tests+=( "main.subquery_sj_firstmatch_bka;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
412
	disabled_tests+=( "main.subquery_sj_firstmatch_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
413
	disabled_tests+=( "main.subquery_sj_mat_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
414
	disabled_tests+=( "main.window_std_var;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
415
	disabled_tests+=( "main.window_std_var_optimized;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
416
	disabled_tests+=( "main.with_recursive;0;Known rounding error with latest AMD processors -- no upstream bug yet" )
417
	disabled_tests+=( "perfschema.statement_digest_query_sample;0;Test will fail on slow hardware")
418
	disabled_tests+=( "rpl.rpl_innodb_info_tbl_slave_tmp_tbl_mismatch;0;Unstable test" )
419
	disabled_tests+=( "rpl_gtid.rpl_gtid_stm_drop_table;90612;Known test failure" )
420
	disabled_tests+=( "rpl_gtid.rpl_multi_source_mtr_includes;0;Known failure - no upstream bug yet" )
421
	disabled_tests+=( "sys_vars.myisam_data_pointer_size_func;87935;Test will fail on slow hardware")
422
	disabled_tests+=( "x.connection;0;Known failure - no upstream bug yet" )
423
	disabled_tests+=( "x.message_compressed_payload;0;False positive caused by protobuff-3.11+" )
424
	disabled_tests+=( "x.message_protobuf_nested;0;False positive caused by protobuff-3.11+" )
393
	local -a disabled_tests=(
394
		"auth_sec.atomic_rename_user;103512;Depends on user running test"
395
		"auth_sec.keyring_file_data_qa;0;Won't work with user privileges"
396
		"auth_sec.openssl_without_fips;94718;Known test failure"
397

  
398
		"gis.geometry_class_attri_prop;5452;Known rounding error with latest AMD processors (PS)"
399
		"gis.geometry_property_function_issimple;5452;Known rounding error with latest AMD processors (PS)"
400
		"gis.gis_bugs_crashes;5452;Known rounding error with latest AMD processors (PS)"
401
		"gis.spatial_analysis_functions_buffer;5452;Known rounding error with latest AMD processors (PS)"
402
		"gis.spatial_analysis_functions_centroid;5452;Known rounding error with latest AMD processors (PS)"
403
		"gis.spatial_analysis_functions_distance;5452;Known rounding error with latest AMD processors (PS)"
404
		"gis.spatial_op_testingfunc_mix;5452;Known rounding error with latest AMD processors (PS)"
405
		"gis.spatial_operators_intersection;5452;Known rounding error with latest AMD processors (PS)"
406
		"gis.spatial_utility_function_distance_sphere;5452;Known rounding error with latest AMD processors (PS)"
407
		"gis.spatial_utility_function_simplify;5452;Known rounding error with latest AMD processors (PS)"
408
		"gis.st_symdifference;5452;Known rounding error with latest AMD processors (PS)"
409

  
410
		"innodb.alter_kill;0;Known test failure -- no upstream bug yet"
411

  
412
		"main.derived_limit;0;Known rounding error with latest AMD processors -- no upstream bug yet"
413
		"main.explain_tree;0;Known rounding error with latest AMD processors -- no upstream bug yet"
414
		"main.gis-precise;0;Known rounding error with latest AMD processors -- no upstream bug yet"
415
		"main.mysql_load_data_local_dir;0;Known test failure -- no upstream bug yet"
416
		"main.select_icp_mrr;0;Known rounding error with latest AMD processors -- no upstream bug yet"
417
		"main.subquery_bugs;0;Known rounding error with latest AMD processors -- no upstream bug yet"
418
		"main.subquery_sj_dupsweed;0;Known rounding error with latest AMD processors -- no upstream bug yet"
419
		"main.subquery_sj_dupsweed_bka;0;Known rounding error with latest AMD processors -- no upstream bug yet"
420
		"main.subquery_sj_dupsweed_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet"
421
		"main.subquery_sj_firstmatch;0;Known rounding error with latest AMD processors -- no upstream bug yet"
422
		"main.subquery_sj_firstmatch_bka;0;Known rounding error with latest AMD processors -- no upstream bug yet"
423
		"main.subquery_sj_firstmatch_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet"
424
		"main.subquery_sj_mat_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet"
425
		"main.window_std_var;0;Known rounding error with latest AMD processors -- no upstream bug yet"
426
		"main.window_std_var_optimized;0;Known rounding error with latest AMD processors -- no upstream bug yet"
427
		"main.with_recursive;0;Known rounding error with latest AMD processors -- no upstream bug yet"
428
		"perfschema.statement_digest_query_sample;0;Test will fail on slow hardware"
429

  
430
		"rpl.rpl_innodb_info_tbl_slave_tmp_tbl_mismatch;0;Unstable test"
431
		"rpl_gtid.rpl_gtid_stm_drop_table;90612;Known test failure"
432
		"rpl_gtid.rpl_multi_source_mtr_includes;0;Known failure - no upstream bug yet"
433

  
434
		"sys_vars.myisam_data_pointer_size_func;87935;Test will fail on slow hardware"
435

  
436
		"x.connection;0;Known failure - no upstream bug yet"
437
		"x.message_compressed_payload;0;False positive caused by protobuff-3.11+"
438
		"x.message_protobuf_nested;0;False positive caused by protobuff-3.11+"
439
	)
425 440

  
426 441
	if ! hash zip 1>/dev/null 2>&1 ; then
427
		# no need to force dep app-arch/zip for one test
428
		disabled_tests+=( "innodb.discarded_partition_create;0;Requires app-arch/zip" )
429
		disabled_tests+=( "innodb.partition_upgrade_create;0;Requires app-arch/zip" )
442
		# No need to force dep app-arch/zip for one test
443
		disabled_tests+=(
444
			"innodb.discarded_partition_create;0;Requires app-arch/zip"
445
			"innodb.partition_upgrade_create;0;Requires app-arch/zip"
446
		)
430 447
	fi
431 448

  
432 449
	if has_version ">=dev-libs/openssl-3" ; then
433 450
		# >=dev-libs/openssl-3 defaults to security level 1 which disallow
434 451
		# TLSv1/1.1 but tests will require TLSv1/1.1.
435 452
		einfo "Set OpenSSL configuration for test suite ..."
453

  
436 454
		cat > "${T}/openssl_tlsv1.cnf" <<- EOF || die
437 455
		openssl_conf = default_conf
438 456

  
......
493 511
	# Try to increase file limits to increase test coverage
494 512
	if ! ulimit -n 16500 1>/dev/null 2>&1 ; then
495 513
		# Upper limit comes from parts.partition_* tests
496
		ewarn "For maximum test coverage please raise open file limit to 16500 (ulimit -n 16500) before calling the package manager."
514
		ewarn "For maximum test coverage, please raise open file limit to 16500 (ulimit -n 16500) before calling the package manager."
497 515

  
498 516
		if ! ulimit -n 4162 1>/dev/null 2>&1 ; then
499 517
			# Medium limit comes from '[Warning] Buffered warning: Could not increase number of max_open_files to more than 3000 (request: 4162)'
500 518
			ewarn "For medium test coverage please raise open file limit to 4162 (ulimit -n 4162) before calling the package manager."
501 519

  
502 520
			if ! ulimit -n 3000 1>/dev/null 2>&1 ; then
503
				ewarn "For minimum test coverage please raise open file limit to 3000 (ulimit -n 3000) before calling the package manager."
521
				ewarn "For minimum test coverage, please raise open file limit to 3000 (ulimit -n 3000) before calling the package manager."
504 522
			else
505 523
				einfo "Will run test suite with open file limit set to 3000 (minimum test coverage)."
506 524
			fi
......
512 530
	fi
513 531

  
514 532
	# run mysql-test tests
515
	perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def"
533
	nonfatal edo perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def"
516 534
	retstatus_tests=$?
517 535

  
518 536
	popd &>/dev/null || die
......
531 549
src_install() {
532 550
	cmake_src_install
533 551

  
552
	# Not a GNU info file, more like a tiny README.
553
	rm "${ED}"/usr/share/info/mysql.info || die
554

  
534 555
	# Make sure the vars are correctly initialized
535 556
	mysql_init_vars
536 557

  
Thank you!