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

/usr/portage/dev-lang/rust/rust-1.96.1.ebuild 2026-08-14 20:03:04.329778988 +0300
5 5

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

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

  
11 11
# Patches are kept in rust-patches.git, see its README.rst for the versioning
12 12
# scheme.
......
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"
......
90 89
LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
91 90
SLOT="${PV%%_*}" # Beta releases get to share the same SLOT as the eventual stable
92 91

  
93
IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind lto"
94
IUSE+=" rustfmt rust-analyzer rust-src +system-llvm test"
92
IUSE="big-endian +clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind lto"
93
IUSE+=" +rustfmt rust-analyzer rust-src +system-llvm test"
95 94
IUSE+=" ${ALL_LLVM_TARGETS[*]} ${ALL_RUST_SYSROOTS[*]}"
96 95

  
97 96
if [[ ${PV} = *9999* ]]; then
......
136 135

  
137 136
DEPEND="
138 137
	>=app-arch/xz-utils-5.2
139
	net-misc/curl:=[http2,ssl]
138
	dev-db/sqlite:3
139
	net-misc/curl[http2,ssl]
140 140
	virtual/zlib:=
141 141
	dev-libs/openssl:0=
142 142
	system-llvm? (
......
186 186

  
187 187
QA_PRESTRIPPED="
188 188
	usr/lib/${PN}/${SLOT}/lib/rustlib/.*/bin/rust-llvm-dwp
189
	usr/lib/${PN}/${SLOT}/lib/rustlib/.*/bin/rust-objcopy
189 190
	usr/lib/${PN}/${SLOT}/lib/rustlib/.*/lib/self-contained/crtn.o
190 191
"
191 192

  
......
324 325
		# to ensure that all dependencies are present and up-to-date
325 326
		mkdir "${S}/vendor" || die
326 327
		# This also compiles the 'build helper', there's no way to avoid this.
327
		${EPYTHON} "${S}"/x.py vendor -v --config="${T}"/vendor-bootstrap.toml -j$(makeopts_jobs) ||
328
			die "Failed to vendor dependencies"
328
		${EPYTHON} "${S}"/x.py vendor -v --config="${T}"/vendor-bootstrap.toml \
329
			-j$(get_makeopts_jobs) ||
330
				die "Failed to vendor dependencies"
329 331
		# TODO: This has to be generated somehow, this is from a 1.84.x tarball I had lying around.
330 332
		cat <<- _EOF_ > "${S}/.cargo/config.toml"
331 333
			[source.crates-io]
......
364 366
src_configure() {
365 367
	if tc-is-cross-compiler; then
366 368
		export PKG_CONFIG_ALLOW_CROSS=1
367
		export PKG_CONFIG_PATH="${ESYSROOT}/usr/$(get_libdir)/pkgconfig"
368
		export OPENSSL_INCLUDE_DIR="${ESYSROOT}/usr/include"
369
		export OPENSSL_LIB_DIR="${ESYSROOT}/usr/$(get_libdir)"
369

  
370
		local rust_host_triple="$(rust_abi "${CHOST}")"
371

  
372
		# https://docs.rs/pkg-config/latest/pkg_config/#cross-compilation
373
		local pcvar
374
		for pcvar in PKG_CONFIG_{PATH,LIBDIR} ; do
375
			pcvar="${pcvar}_${rust_host_triple//-/_}"
376

  
377
			[[ -n ${!pcvar} ]] && continue
378

  
379
			case ${pcvar} in
380
				*PKG_CONFIG_PATH*)
381
					printf -v "${pcvar}" "${ESYSROOT}/usr/$(get_libdir)/pkgconfig"
382
					;;
383
				*PKG_CONFIG_LIBDIR*)
384
					printf -v "${pcvar}" "${ESYSROOT}/usr/$(get_libdir)"
385
					;;
386
				*)
387
					continue
388
					;;
389
			esac
390

  
391
			export "${pcvar}"
392
		done
393

  
394
		# https://docs.rs/openssl/latest/openssl/#manual
395
		local osslvar
396
		for osslvar in OPENSSL_{INCLUDE_,LIB_,}DIR ; do
397
			osslvar="${rust_host_triple}_${osslvar}"
398
			osslvar="${osslvar^^}"
399
			osslvar="${osslvar//-/_}"
400

  
401
			[[ -n ${!osslvar} ]] && continue
402

  
403
			case ${osslvar} in
404
				*OPENSSL_DIR*)
405
					printf -v "${osslvar}" "${ESYSROOT}/usr"
406
					;;
407
				*OPENSSL_INCLUDE_DIR*)
408
					printf -v "${osslvar}" "${ESYSROOT}/usr/include"
409
					;;
410
				*OPENSSL_LIB_DIR*)
411
					printf -v "${osslvar}" "${ESYSROOT}/usr/$(get_libdir)"
412
					;;
413
				*)
414
					continue
415
					;;
416
			esac
417

  
418
			export "${osslvar}"
419
		done
420

  
421
		# https://issues.chromium.org/issues/357917328
422
		# https://github.com/rust-lang/libz-sys/blob/1.1.18/build.rs#L25
423
		export LIBZ_SYS_STATIC=1
370 424
	fi
371 425

  
372 426
	# Avoid bundled copies of libraries
373 427
	export RUSTONIG_SYSTEM_LIBONIG=1
374
	# Need to check if these can be optional
375
	#export LIBSQLITE3_SYS_USE_PKG_CONFIG=1
376
	#export LIBSSH2_SYS_USE_PKG_CONFIG=1
428
	export LIBSQLITE3_SYS_USE_PKG_CONFIG=1
377 429

  
378 430
	filter-lto # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231
379 431

  
......
716 768

  
717 769
src_compile() {
718 770
	# -v will show invocations, -vv "very verbose" is overkill, -vvv "very very verbose" is insane
719
	RUST_BACKTRACE=1 "${EPYTHON}" ./x.py build -v --config="${S}"/bootstrap.toml -j$(makeopts_jobs) || die
771
	RUST_BACKTRACE=1 "${EPYTHON}" ./x.py build -v \
772
		--config="${S}"/bootstrap.toml -j$(get_makeopts_jobs) || die
720 773
}
721 774

  
722 775
src_test() {
......
724 777

  
725 778
	# those are basic and codegen tests.
726 779
	local tests=(
727
		codegen
728 780
		codegen-units
729
		compile-fail
781
		crashes
782
		codegen-llvm
730 783
		incremental
731 784
		mir-opt
732 785
		pretty
733 786
		run-make
787
		run-make-cargo
788
	)
789

  
790
	# tests for standard and core library
791
	local std_tests=(
792
		std
793
		core
734 794
	)
735 795

  
736 796
	# fails if llvm is not built with ALL targets.
737 797
	# and known to fail with system llvm sometimes.
738
	use system-llvm || tests+=( assembly )
798
	use system-llvm || tests+=( assembly-llvm )
739 799

  
740 800
	# fragile/expensive/less important tests
741 801
	# or tests that require extra builds
......
746 806
			rustdoc-js
747 807
			rustdoc-js-std
748 808
			rustdoc-ui
749
			run-make-fulldeps
750 809
			ui
751 810
			ui-fulldeps
752 811
		)
753 812
	fi
754 813

  
755 814
	local i failed=()
756
	einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}"
757
	for i in "${tests[@]}"; do
758
		local t="src/test/${i}"
815
	einfo "rust_src_test: enabled tests ${tests[@]} ${std_tests[@]}"
816
	for i in "tests/${tests[@]}" "library/${std_tests[@]}"; do
817
		local t="${i}"
759 818
		einfo "rust_src_test: running ${t}"
760 819
		if ! RUST_BACKTRACE=1 "${EPYTHON}" ./x.py test -vv --config="${S}"/bootstrap.toml \
761
				-j$(makeopts_jobs) --no-doc --no-fail-fast "${t}"
820
				-j$(get_makeopts_jobs) --no-doc --no-fail-fast "${t}"
762 821
		then
763 822
				failed+=( "${t}" )
764 823
				eerror "rust_src_test: ${t} failed"
......
772 831
}
773 832

  
774 833
src_install() {
775
	DESTDIR="${D}" "${EPYTHON}" ./x.py install -v --config="${S}"/bootstrap.toml -j$(makeopts_jobs) || die
834
	DESTDIR="${D}" "${EPYTHON}" ./x.py install -v \
835
		--config="${S}"/bootstrap.toml -j$(get_makeopts_jobs) || die
776 836

  
777 837
	docompress /usr/lib/${PN}/${SLOT}/share/man/
778 838

  
......
863 923
	doins "${T}/provider-${PN}-${SLOT}"
864 924

  
865 925
	if use dist; then
866
		"${EPYTHON}" ./x.py dist -v --config="${S}"/bootstrap.toml -j$(makeopts_jobs) || die
926
		"${EPYTHON}" ./x.py dist -v --config="${S}"/bootstrap.toml \
927
			-j$(get_makeopts_jobs) || die
867 928
		insinto "/usr/lib/${PN}/${SLOT}/dist"
868 929
		doins -r "${S}/build/dist/."
869 930
	fi
Thank you!