dev-lang/rust: Sync with Gentoo

It's from Gentoo commit 3697cf96012982634868d7e845bbc844c77c9a9b.
This commit is contained in:
Flatcar Buildbot 2025-02-10 07:05:50 +00:00
parent b6e4a49148
commit fe30764bdd
15 changed files with 83 additions and 140 deletions

View File

@ -22,3 +22,5 @@ DIST rustc-1.83.0-src.tar.xz 353808388 BLAKE2B 217c85f7351a7c57a2684da2c7c81a320
DIST rustc-1.83.0-src.tar.xz.asc 801 BLAKE2B 3bacb43d50ebba579dc2d4f1726298a7887e303e15f039ef72b840e30d90bc2cf9cdbe4617a9ee113a2b1a48f1982e72cf30323d72cdfb9a65b5b4d734ca0024 SHA512 84b252ccaddc06cb05858ff64f582dd25823818c81b1e3a00362deeda06f09e6c36948fd316d5f0ca5e24949e6f99bb14a14dbd2af1cfbb85e679e27ab0a813c
DIST rustc-1.84.0-src.tar.xz 354993944 BLAKE2B e4697d8a9f42484556ed490390aef535b2214ccb3715ade57936211c1c637737da5f2b9a6c53a30df0fba1744fbd80d4d1382c0b74f6b36b36098bf187557201 SHA512 9e964c1b964e74083a9002fa04b072fa8fe7a520b24ad55e88a89bb2a2a2cd5727c5438d6db425b824ae7502ab215c2dd3f49777efd65f76bae09965df2e070a
DIST rustc-1.84.0-src.tar.xz.asc 801 BLAKE2B b1846702f36b92c479499f5eb704ce1e272131fc1b6b625c8d64c873a82ed79b1de8cceb1f21ae4b9dccf81e258547debf367b7b769ac94ed10a59dee18f79f1 SHA512 5ada0e0fed9901044eaa0d7cb657f685c7e183e91245714abe4a0a8bf3062a7de281932c7de7587220df0542511f6011d057bd8bed19d98c755eab74091cdfdb
DIST rustc-1.84.1-src.tar.xz 355078168 BLAKE2B 849e8c909493bf76ce9749b9dcb1967180223b91a41d690bc477e78557d4e24949c9a8d8276d824af8c54ad62bc4a998e7a8efbc0bbd2008a4f64f51a7690d48 SHA512 f1cc4765736551508408126e44086988e8ddc30c1a929bf7b61c6be85ad0d65928dd5fb1041cfaeee8eb37d2208f2c1917e276aef2bc9a8e40e34f6713b349e1
DIST rustc-1.84.1-src.tar.xz.asc 801 BLAKE2B f3decd3470fd1eff33adbb376490a30eb8db28dd4176bde0fefe4f60acf79c3dd0e1a330d519b5319360136ea7d0a124f6720dea08617202d9e9298da992ccf6 SHA512 a241fe3efba293f3e872b74f09dd0d184e0239afd1416326d57bf1134d92721c65b187f5c99962b51671877a539f18e82d2d797c76af42615c11a8bb3905f796

View File

@ -0,0 +1,30 @@
https://github.com/rust-lang/rust/issues/133629
https://github.com/rust-lang/rust/commit/a24d859f19bbefe5371694f318568b0ab5a13299
From: onur-ozkan <work@onurozkan.dev>
Date: Thu, 30 Jan 2025 16:51:08 +0000
Subject: [PATCH] set rustc dylib on manually constructed rustc command
Signed-off-by: onur-ozkan <work@onurozkan.dev>
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -653,7 +653,10 @@ impl Builder<'_> {
// Build proc macros both for the host and the target unless proc-macros are not
// supported by the target.
if target != compiler.host && cmd_kind != Kind::Check {
- let error = command(self.rustc(compiler))
+ let mut rustc_cmd = command(self.rustc(compiler));
+ self.add_rustc_lib_path(compiler, &mut rustc_cmd);
+
+ let error = rustc_cmd
.arg("--target")
.arg(target.rustc_target_arg())
.arg("--print=file-names")
@@ -661,6 +664,7 @@ impl Builder<'_> {
.arg("-")
.run_capture(self)
.stderr();
+
let not_supported = error
.lines()
.any(|line| line.contains("unsupported crate type `proc-macro`"));

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -43,7 +43,7 @@ ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY DirectX M68k SPIRV Xtensa )
LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4 UoI-NCSA"
SLOT="${PV}"
IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind +lto miri nightly parallel-compiler rustfmt rust-analyzer rust-src system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind lto miri nightly parallel-compiler rustfmt rust-analyzer rust-src system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
LLVM_DEPEND=()
# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation
@ -329,7 +329,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -586,7 +586,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_

View File

@ -49,7 +49,7 @@ ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY DirectX M68k SPIRV Xtensa )
LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
SLOT="${PV}"
IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind +lto miri mrustc-bootstrap nightly parallel-compiler rustfmt rust-analyzer rust-src system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind lto miri mrustc-bootstrap nightly parallel-compiler rustfmt rust-analyzer rust-src system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
LLVM_DEPEND=()
# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation
@ -396,7 +396,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -899,7 +899,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -44,7 +44,7 @@ ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY DirectX M68k SPIRV Xtensa )
LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
SLOT="${PV}"
IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind +lto miri nightly parallel-compiler rustfmt rust-analyzer rust-src system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind lto miri nightly parallel-compiler rustfmt rust-analyzer rust-src system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
LLVM_DEPEND=()
# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation
@ -362,7 +362,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -619,7 +619,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -361,7 +361,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -536,7 +536,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -360,7 +360,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -618,7 +618,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -359,7 +359,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -620,7 +620,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -359,7 +359,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -620,7 +620,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -358,7 +358,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -618,7 +618,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -362,7 +362,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -622,7 +622,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -370,7 +370,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -632,7 +632,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_

View File

@ -370,7 +370,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -632,7 +632,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_

View File

@ -39,6 +39,9 @@ ALL_LLVM_TARGETS=( AArch64 AMDGPU ARC ARM AVR BPF CSKY DirectX Hexagon Lanai
ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
# https://github.com/rust-lang/llvm-project/blob/rustc-1.84.0/llvm/CMakeLists.txt
ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY DirectX M68k SPIRV Xtensa )
LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
SLOT="${PV}"
@ -269,6 +272,14 @@ src_configure() {
rust_build="$(rust_abi "${CBUILD}")"
rust_host="$(rust_abi "${CHOST}")"
LLVM_EXPERIMENTAL_TARGETS=()
for _x in "${ALL_LLVM_EXPERIMENTAL_TARGETS[@]}"; do
if use llvm_targets_${_x} ; then
LLVM_EXPERIMENTAL_TARGETS+=( ${_x} )
fi
done
LLVM_EXPERIMENTAL_TARGETS=${LLVM_EXPERIMENTAL_TARGETS[@]}
local cm_btype="$(usex debug DEBUG RELEASE)"
cat <<- _EOF_ > "${S}"/config.toml
# https://github.com/rust-lang/rust/issues/135358 (bug #947897)
@ -280,7 +291,7 @@ src_configure() {
assertions = $(toml_usex debug)
ninja = true
targets = "${LLVM_TARGETS// /;}"
experimental-targets = ""
experimental-targets = "${LLVM_EXPERIMENTAL_TARGETS// /;}"
link-shared = $(toml_usex system-llvm)
$(if is_libcxx_linked; then
# https://bugs.gentoo.org/732632
@ -361,7 +372,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -623,7 +634,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_
@ -671,44 +681,8 @@ src_install() {
fi
}
pkg_preinst() {
# 943308 and friends; basically --keep-going can forget to unmerge old rust
# but the soft blocker allows us to install conflicting files.
# This results in duplicated .{rlib,so} files which confuses rustc and results in
# the need for manual intervention.
if has_version -b "dev-lang/rust:stable/$(ver_cut 1-2)"; then
# we need to find all .{rlib,so} files in the old rust lib directory
# and store them in an array for later use
readarray -d '' old_rust_libs < <(
find "${EROOT}/usr/lib/rust/${PV}/lib/rustlib" \
-type f \( -name '*.rlib' -o -name '*.so' \) -print0)
export old_rust_libs
if [[ ${#old_rust_libs[@]} -gt 0 ]]; then
einfo "Found old .rlib and .so files in the old rust lib directory"
else
die "Found no old .rlib and .so files but old rust version is installed. Bailing!"
fi
fi
}
pkg_postinst() {
if has_version -b "dev-lang/rust:stable/$(ver_cut 1-2)"; then
# Be _extra_ careful here as we're removing files from the live filesystem
local f
for f in "${old_rust_libs[@]}"; do
[[ -f ${f} ]] || die "old_rust_libs array contains non-existent file"
local base_name="${f%-*}"
local ext="${f##*.}"
local matching_files=("${base_name}"-*.${ext})
if [[ ${#matching_files[@]} -ne 2 ]]; then
die "Expected exactly two files matching ${base_name}-\*.rlib, but found ${#matching_files[@]}"
fi
einfo "Removing old .rlib file ${f}"
rm "${f}" || die
done
fi
eselect rust update
if has_version dev-debug/gdb || has_version llvm-core/lldb; then

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -20,7 +20,7 @@ if [[ ${PV} = *beta* ]]; then
else
MY_P="rustc-${PV}"
SRC="${MY_P}-src.tar.xz"
KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi
DESCRIPTION="Systems programming language from Mozilla"
@ -39,6 +39,7 @@ ALL_LLVM_TARGETS=( AArch64 AMDGPU ARC ARM AVR BPF CSKY DirectX Hexagon Lanai
ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
# https://github.com/rust-lang/llvm-project/blob/rustc-1.84.0/llvm/CMakeLists.txt
ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY DirectX M68k SPIRV Xtensa )
LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
@ -134,9 +135,9 @@ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/rust.asc
PATCHES=(
"${FILESDIR}"/1.78.0-musl-dynamic-linking.patch
"${FILESDIR}"/1.74.1-cross-compile-libz.patch
#"${FILESDIR}"/1.72.0-bump-libc-deps-to-0.2.146.patch # pending refresh
"${FILESDIR}"/1.83.0-cross-compile-libz.patch
"${FILESDIR}"/1.67.0-doc-wasm.patch
"${FILESDIR}"/1.84.1-fix-cross.patch # already upstreamed
)
clear_vendor_checksums() {
@ -281,6 +282,8 @@ src_configure() {
local cm_btype="$(usex debug DEBUG RELEASE)"
cat <<- _EOF_ > "${S}"/config.toml
# https://github.com/rust-lang/rust/issues/135358 (bug #947897)
profile = "dist"
[llvm]
download-ci-llvm = false
optimize = $(toml_usex !debug)
@ -369,7 +372,7 @@ src_configure() {
parallel-compiler = $(toml_usex parallel-compiler)
channel = "$(usex nightly nightly stable)"
description = "gentoo"
rpath = false
rpath = true
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
@ -631,7 +634,6 @@ src_install() {
dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/lib/rust/lib-${PV}"
MANPATH="${EPREFIX}/usr/lib/rust/man-${PV}"
_EOF_
@ -679,67 +681,8 @@ src_install() {
fi
}
pkg_preinst() {
# 943308 and friends; basically --keep-going can forget to unmerge old rust
# but the soft blocker allows us to install conflicting files.
# This results in duplicated .{rlib,so} files which confuses rustc and results in
# the need for manual intervention.
if has_version -b "dev-lang/rust:stable/$(ver_cut 1-2)"; then
# we need to find all .{rlib,so} files in the old rust lib directory
# and store them in an array for later use
readarray -d '' old_rust_libs < <(
find "${EROOT}/usr/lib/rust/${PV}/lib/rustlib" \
-type f \( -name '*.rlib' -o -name '*.so' \) -print0)
export old_rust_libs
if [[ ${#old_rust_libs[@]} -gt 0 ]]; then
einfo "Found old .rlib and .so files in the old rust lib directory"
else
die "Found no old .rlib and .so files but old rust version is installed. Bailing!"
fi
fi
}
pkg_postinst() {
local old_rust="dev-lang/rust:stable/$(ver_cut 1-2)"
if has_version -b ${old_rust}; then
# Be _extra_ careful here as we're removing files from the live filesystem
local f
local only_one_file=()
einfo "Tidying up libraries files from non-slotted \`${old_rust}\`."
for f in "${old_rust_libs[@]}"; do
[[ -f ${f} ]] || die "old_rust_libs array contains non-existent file"
local base_name="${f%-*}"
local ext="${f##*.}"
local matching_files=("${base_name}"-*.${ext})
case ${#matching_files[@]} in
2)
einfo "Removing old .${ext}: ${f}"
rm "${f}" || die
;;
1)
# Turns out fingerprints are not as unique as we'd thought, _sometimes_ they collide,
# so we may have already installed over the old file.
# We'll warn about this just in case, but it's probably fine.
only_one_file+=( "${matching_files[0]}" )
;;
*)
die "Expected one or two files matching ${base_name}-\*.rlib, but found ${#matching_files[@]}"
;;
esac
done
if [[ ${#only_one_file} -gt 0 ]]; then
einfo "While tidying up non-slotted rust libraries for \`${old_rust}\`,"
einfo "the following file(s) did not have a duplicate where one was expected:"
for f in "${only_one_file[@]}"; do
einfo " * ${f}"
done
einfo ""
einfo "This is unlikely to cause problems; the fingerprint for the library ended up being the same."
einfo "However, if you encounter any issues please report them to the Gentoo Rust Team."
fi
fi
eselect rust update
if has_version dev-debug/gdb || has_version llvm-core/lldb; then
@ -747,8 +690,13 @@ pkg_postinst() {
elog "for convenience they are installed under /usr/bin/rust-{gdb,lldb}-${PV}."
fi
optfeature "Emacs support" "app-emacs/rust-mode"
optfeature "Vim support" "app-vim/rust-vim"
if has_version app-editors/emacs; then
optfeature "emacs support for rust" app-emacs/rust-mode
fi
if has_version app-editors/gvim || has_version app-editors/vim; then
optfeature "vim support for rust" app-vim/rust-vim
fi
}
pkg_postrm() {