Diff rust-1.92.0_p1-r1 with a rust-1.96.1

/usr/portage/dev-lang/rust/rust-1.96.1.ebuild 2026-11-16 17:41:27.932399752 +0300
5 5

  
6 6
# Bump notes: https://wiki.gentoo.org/wiki/Project:Rust/Rust_bump
7 7

  
8
LLVM_COMPAT=( 21 )
8
LLVM_COMPAT=( 22 )
9 9
PYTHON_COMPAT=( python3_{12..14} )
10 10

  
11 11
# Patches are kept in rust-patches.git, see its README.rst for the versioning
......
15 15
# in the ebuild for changes that don't require a revbump.
16 16
#
17 17
# Uncomment this line when the ebuild needs a patchset update but no revbump.
18
#RUST_PATCH_VER=${PV}-1
18
# RUST_PATCH_VER=${PV}-1
19 19

  
20 20
RUST_MAX_VER=${PV%%_*}
21 21
RUST_PV=${PV%%_p*}
......
24 24

  
25 25
if [[ ${PV} == *9999* ]]; then
26 26
	# Update this as new `beta` releases come out.
27
	RUST_MIN_VER="1.88.0"
27
	RUST_MIN_VER="1.93.0"
28 28
elif [[ ${PV} == *beta* ]]; then
29
	RUST_MAX_VER="$(ver_cut 1).$(ver_cut 2).0"
30 29
	RUST_MIN_VER="$(ver_cut 1).$(($(ver_cut 2) - 1)).0"
31 30
else
32 31
	RUST_MIN_VER="$(ver_cut 1).$(($(ver_cut 2) - 1)).0"
......
102 101
LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
103 102
SLOT="${PV%%_*}" # Beta releases get to share the same SLOT as the eventual stable
104 103

  
105
IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind lto"
106
IUSE+=" rustfmt rust-analyzer rust-src +system-llvm test"
104
IUSE="big-endian +clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind lto"
105
IUSE+=" +rustfmt rust-analyzer rust-src +system-llvm test"
107 106
IUSE+=" ${ALL_LLVM_TARGETS[*]} ${ALL_RUST_SYSROOTS[*]}"
108 107

  
109 108
if [[ ${PV} = *9999* ]]; then
......
148 147

  
149 148
DEPEND="
150 149
	>=app-arch/xz-utils-5.2
151
	net-misc/curl:=[http2,ssl]
150
	dev-db/sqlite:3
151
	net-misc/curl[http2,ssl]
152 152
	virtual/zlib:=
153 153
	dev-libs/openssl:0=
154 154
	system-llvm? (
......
198 198

  
199 199
QA_PRESTRIPPED="
200 200
	usr/lib/${PN}/${SLOT}/lib/rustlib/.*/bin/rust-llvm-dwp
201
	usr/lib/${PN}/${SLOT}/lib/rustlib/.*/bin/rust-objcopy
201 202
	usr/lib/${PN}/${SLOT}/lib/rustlib/.*/lib/self-contained/crtn.o
202 203
"
203 204

  
......
336 337
		# to ensure that all dependencies are present and up-to-date
337 338
		mkdir "${S}/vendor" || die
338 339
		# This also compiles the 'build helper', there's no way to avoid this.
339
		${EPYTHON} "${S}"/x.py vendor -v --config="${T}"/vendor-bootstrap.toml -j$(makeopts_jobs) ||
340
			die "Failed to vendor dependencies"
340
		${EPYTHON} "${S}"/x.py vendor -v --config="${T}"/vendor-bootstrap.toml \
341
			-j$(get_makeopts_jobs) ||
342
				die "Failed to vendor dependencies"
341 343
		# TODO: This has to be generated somehow, this is from a 1.84.x tarball I had lying around.
342 344
		cat <<- _EOF_ > "${S}/.cargo/config.toml"
343 345
			[source.crates-io]
......
378 380
src_configure() {
379 381
	if tc-is-cross-compiler; then
380 382
		export PKG_CONFIG_ALLOW_CROSS=1
381
		export PKG_CONFIG_PATH="${ESYSROOT}/usr/$(get_libdir)/pkgconfig"
382
		export OPENSSL_INCLUDE_DIR="${ESYSROOT}/usr/include"
383
		export OPENSSL_LIB_DIR="${ESYSROOT}/usr/$(get_libdir)"
383

  
384
		local rust_host_triple="$(rust_abi "${CHOST}")"
385

  
386
		# https://docs.rs/pkg-config/latest/pkg_config/#cross-compilation
387
		local pcvar
388
		for pcvar in PKG_CONFIG_{PATH,LIBDIR} ; do
389
			pcvar="${pcvar}_${rust_host_triple//-/_}"
390

  
391
			[[ -n ${!pcvar} ]] && continue
392

  
393
			case ${pcvar} in
394
				*PKG_CONFIG_PATH*)
395
					printf -v "${pcvar}" "${ESYSROOT}/usr/$(get_libdir)/pkgconfig"
396
					;;
397
				*PKG_CONFIG_LIBDIR*)
398
					printf -v "${pcvar}" "${ESYSROOT}/usr/$(get_libdir)"
399
					;;
400
				*)
401
					continue
402
					;;
403
			esac
404

  
405
			export "${pcvar}"
406
		done
407

  
408
		# https://docs.rs/openssl/latest/openssl/#manual
409
		local osslvar
410
		for osslvar in OPENSSL_{INCLUDE_,LIB_,}DIR ; do
411
			osslvar="${rust_host_triple}_${osslvar}"
412
			osslvar="${osslvar^^}"
413
			osslvar="${osslvar//-/_}"
414

  
415
			[[ -n ${!osslvar} ]] && continue
416

  
417
			case ${osslvar} in
418
				*OPENSSL_DIR*)
419
					printf -v "${osslvar}" "${ESYSROOT}/usr"
420
					;;
421
				*OPENSSL_INCLUDE_DIR*)
422
					printf -v "${osslvar}" "${ESYSROOT}/usr/include"
423
					;;
424
				*OPENSSL_LIB_DIR*)
425
					printf -v "${osslvar}" "${ESYSROOT}/usr/$(get_libdir)"
426
					;;
427
				*)
428
					continue
429
					;;
430
			esac
431

  
432
			export "${osslvar}"
433
		done
434

  
435
		# https://issues.chromium.org/issues/357917328
436
		# https://github.com/rust-lang/libz-sys/blob/1.1.18/build.rs#L25
437
		export LIBZ_SYS_STATIC=1
384 438
	fi
385 439

  
386 440
	# Avoid bundled copies of libraries
387 441
	export RUSTONIG_SYSTEM_LIBONIG=1
388
	# Need to check if these can be optional
389
	#export LIBSQLITE3_SYS_USE_PKG_CONFIG=1
390
	#export LIBSSH2_SYS_USE_PKG_CONFIG=1
442
	export LIBSQLITE3_SYS_USE_PKG_CONFIG=1
391 443

  
392 444
	filter-lto # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231
393 445

  
......
730 782

  
731 783
src_compile() {
732 784
	# -v will show invocations, -vv "very verbose" is overkill, -vvv "very very verbose" is insane
733
	RUST_BACKTRACE=1 "${EPYTHON}" ./x.py build -v --config="${S}"/bootstrap.toml -j$(makeopts_jobs) || die
785
	RUST_BACKTRACE=1 "${EPYTHON}" ./x.py build -v \
786
		--config="${S}"/bootstrap.toml -j$(get_makeopts_jobs) || die
734 787
}
735 788

  
736 789
src_test() {
......
738 791

  
739 792
	# those are basic and codegen tests.
740 793
	local tests=(
741
		codegen
742 794
		codegen-units
743
		compile-fail
795
		crashes
796
		codegen-llvm
744 797
		incremental
745 798
		mir-opt
746 799
		pretty
747 800
		run-make
801
		run-make-cargo
802
	)
803

  
804
	# tests for standard and core library
805
	local std_tests=(
806
		std
807
		core
748 808
	)
749 809

  
750 810
	# fails if llvm is not built with ALL targets.
751 811
	# and known to fail with system llvm sometimes.
752
	use system-llvm || tests+=( assembly )
812
	use system-llvm || tests+=( assembly-llvm )
753 813

  
754 814
	# fragile/expensive/less important tests
755 815
	# or tests that require extra builds
......
760 820
			rustdoc-js
761 821
			rustdoc-js-std
762 822
			rustdoc-ui
763
			run-make-fulldeps
764 823
			ui
765 824
			ui-fulldeps
766 825
		)
767 826
	fi
768 827

  
769 828
	local i failed=()
770
	einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}"
771
	for i in "${tests[@]}"; do
772
		local t="src/test/${i}"
829
	einfo "rust_src_test: enabled tests ${tests[@]} ${std_tests[@]}"
830
	for i in "tests/${tests[@]}" "library/${std_tests[@]}"; do
831
		local t="${i}"
773 832
		einfo "rust_src_test: running ${t}"
774 833
		if ! RUST_BACKTRACE=1 "${EPYTHON}" ./x.py test -vv --config="${S}"/bootstrap.toml \
775
				-j$(makeopts_jobs) --no-doc --no-fail-fast "${t}"
834
				-j$(get_makeopts_jobs) --no-doc --no-fail-fast "${t}"
776 835
		then
777 836
				failed+=( "${t}" )
778 837
				eerror "rust_src_test: ${t} failed"
......
786 845
}
787 846

  
788 847
src_install() {
789
	DESTDIR="${D}" "${EPYTHON}" ./x.py install -v --config="${S}"/bootstrap.toml -j$(makeopts_jobs) || die
848
	DESTDIR="${D}" "${EPYTHON}" ./x.py install -v \
849
		--config="${S}"/bootstrap.toml -j$(get_makeopts_jobs) || die
790 850

  
791 851
	docompress /usr/lib/${PN}/${SLOT}/share/man/
792 852

  
......
877 937
	doins "${T}/provider-${PN}-${SLOT}"
878 938

  
879 939
	if use dist; then
880
		"${EPYTHON}" ./x.py dist -v --config="${S}"/bootstrap.toml -j$(makeopts_jobs) || die
940
		"${EPYTHON}" ./x.py dist -v --config="${S}"/bootstrap.toml \
941
			-j$(get_makeopts_jobs) || die
881 942
		insinto "/usr/lib/${PN}/${SLOT}/dist"
882 943
		doins -r "${S}/build/dist/."
883 944
	fi
Thank you!