summaryrefslogtreecommitdiff
path: root/dev-lang/rust
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-11-12 03:02:41 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-11-12 03:02:41 +0000
commit51be8f45b17e3da3ac48eca6b16b703bb58fda76 (patch)
treebc6f18bc4913276cff3f8c2f2ec357f9026c602c /dev-lang/rust
parent0ab98a20dbfb8c64ab93e02280abb4ff18652ae0 (diff)
gentoo auto-resync : 12:11:2024 - 03:02:41
Diffstat (limited to 'dev-lang/rust')
-rw-r--r--dev-lang/rust/Manifest16
-rw-r--r--dev-lang/rust/rust-1.71.1-r100.ebuild102
-rw-r--r--dev-lang/rust/rust-1.74.1-r100.ebuild107
-rw-r--r--dev-lang/rust/rust-1.75.0-r100.ebuild110
-rw-r--r--dev-lang/rust/rust-1.77.1-r100.ebuild109
-rw-r--r--dev-lang/rust/rust-1.79.0-r100.ebuild107
-rw-r--r--dev-lang/rust/rust-1.80.1-r100.ebuild107
-rw-r--r--dev-lang/rust/rust-1.81.0-r100.ebuild108
-rw-r--r--dev-lang/rust/rust-1.82.0-r100.ebuild105
9 files changed, 85 insertions, 786 deletions
diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
index 9e31f7549ee6..3891210d2435 100644
--- a/dev-lang/rust/Manifest
+++ b/dev-lang/rust/Manifest
@@ -260,20 +260,20 @@ DIST rustc-1.81.0-src.tar.xz 216743872 BLAKE2B d9f52da9092d0723c862ebbb2dc351cad
DIST rustc-1.81.0-src.tar.xz.asc 801 BLAKE2B 01cd9f386d3fd73f4eb43b14d7d479ebababb8640abbff170e697817b94b8a18edd801c6047ecf3c084a0a51764c5e4f3f4bd6b00e8ae000ef0b850e9506572a SHA512 19c0da9d67f2bd9fd79a2078f0f486ee7fad5646a09a609b7e30d9531851955ae8df0ec69f9ddc09e2fd6e74d529648335b0fda833839c88c54c84494ec1988e
DIST rustc-1.82.0-src.tar.xz 219769328 BLAKE2B 611f33e134c2d459c9af1695c0a4d033df93afc986e91a17fceb0dd293fb4ffbd5f7475ef571d36cecf49da6c3fdb3801c98d7f72f9dd1c39e42502f649b192f SHA512 d158c7c71c1814bde2a3ec3cbeabe34949bd3201b730c0d7ec6baad4158bb28dd13696c430a6b99dc38b9d23ad7ddf8dde7d2487cbfbbbe9c3473016994210f0
DIST rustc-1.82.0-src.tar.xz.asc 801 BLAKE2B 8138fb15b8d7ec15be45378fe663207a8e87e3c527348ab079995b1840a771ed6e9d5464eb8855ac9e006c0cfcf54b1a4fea489d31e6c9899cb03e6f4c737b67 SHA512 3cd6b27e72041baf9996efa10f25aca2e04f3e3727b60ecfd90c1bef9c52d216d2dc130802f935b110e35766645a27637a01661aa8d5acf02bf64b02a107c93c
-EBUILD rust-1.71.1-r100.ebuild 22834 BLAKE2B b3322d93746bfcce7ad9be1256875f227e25dc89fd56ef8d4887dc9b2003402900e6bb6567ffcc63c8d52c2233a8a458df1cb4393adc423e060b31fc5ac817b9 SHA512 c6710af1e909c30fd5a4b2a11b3e287b8c5ae89deea523aaa7878f4717bbe395671fed36936ceacc6f70411fee167bba6b98e3170d9e02cef04db5a92ecd0aa0
+EBUILD rust-1.71.1-r100.ebuild 19571 BLAKE2B 8d4f15f7b85dc3d31721f2a9a99b566c79dbb2430ff610775b563502b4dd3fee9ea69de844bec2d3bb74e297262c9a9993adc8a25daa0c085b61c6b33f870f76 SHA512 6de97650bb9e8337ed97ff801a303db30d1524784f6dfb682acf91619103355153dcce746d1f1ebba87c1aee2ef93ef2d306fa75b7c936891cbe69b7d74d5323
EBUILD rust-1.71.1.ebuild 23467 BLAKE2B cc179525f8be2375e4bb0651b3210986254d027414bdef178a33309a7d99deba0a656454b5f1c84a852be104c93edaf5eec24c6f65f067365ed0a202d140fde0 SHA512 2a81e2a2c49d19d88c7794d809648a4630ca476410ea3270a772fa8d315b56c1b1698fc523ff5451a4336e23993f76d444c6c3b12d491ed89019f075a6fceb83
-EBUILD rust-1.74.1-r100.ebuild 24485 BLAKE2B 3e2d5225d9e798054d8f276e8acdb5287736d4b31d20ed9a7676a2c55a8ece673f7e1bf49278a46b2f4c69ce43682c53a1d13eb474c5aaf942786b86af825be3 SHA512 31c2f2b9cc38cc558680e6eaf7c5e9ca7ac920be674df41f057efd14865b1cb7e6bae7f0417bdc346ad4a617b9274a6d9d724139393812d96c12f1d24dac8415
+EBUILD rust-1.74.1-r100.ebuild 20819 BLAKE2B babdaae078ba818e1092cc58b346a8a2b9315dafc16a90253b78096ebf0b34472d74283e388420f713541875b35d4a6733ca6895405b09e19189c61b1c12fad5 SHA512 bcea84008e66a2b0d740a111d671320d3066d5ee8414ae3b0cee4d74e4affe2c4225bcee71d80631404f1cebc4ff84a588b2153f3492cd4c3c34afb8381acbf2
EBUILD rust-1.74.1.ebuild 25118 BLAKE2B 4de0c3973eb9fff948c6254f6696f0de0b36f4d507fba035ef3873de2cbb92842bf409b371036fda337f6c66fb89fd156f4fbe21c12a72b3ef5ccada586ecfae SHA512 c24a3a85ba60916f12be526f0641546e921b5433f883516bf8e7c5b74362b0c8205c27533094911edc1eca8235bfebfeb820fb316d954509a96d200cf2574151
EBUILD rust-1.75.0-r1.ebuild 25282 BLAKE2B eebe5ea3b922221821b6dba77dea369248e5c6d952c45d1ca70d6952596b97c891fc29f502dad0192a690939a8f3fad6b5b2538daf72365b0113e8669a7f43d2 SHA512 96aaaccaf93d27b099ba0ec85882ff26b2eaa2021ca17768f607b5043b872a36e4c9d3ac13b4a7b8cbda6f3d7084edb1db11173d081a8972c51aa71a0e506935
-EBUILD rust-1.75.0-r100.ebuild 24649 BLAKE2B e506e752183a0bd7ae304add6a90148b7dcec710d8f6dfd00daf8afb3a4fe304ecb1bc83ea0567578b0e530f383aa04d6e44a2d885285003d180fb40ba0d013f SHA512 8ee4522be25cabfc80dfc29d2557ee28cf3210054d8618c83afe3fba8d3a80e9ebb3c03bfbe76c01bed1d1070612b3b0b900510e41fd6def2da7b2e3eefe3d29
-EBUILD rust-1.77.1-r100.ebuild 24611 BLAKE2B 84c76d74664e4186d64c564cdd0134263e4ceedac808af0ce8c01ca8813de3f0b8bc9dbff5589c870f8d90a1bd3f3e263cae2aaa0d59ea0ad27b22d215900fb3 SHA512 3eeafd048319e522d064d222bd19fed133dfa4be0b6de6ab98aa1f633d8f6985f28ddb547752ea77a41ced92fe5e762ceee4b0803f29fcaf53b141570d7c43e7
+EBUILD rust-1.75.0-r100.ebuild 20982 BLAKE2B deae5158e7dcfd5e011d37130894c34b3d640f30d8607e39c5a2659a60c107525bfbcf786ac94cd25f57bd4550e08ac84eb1e9ccd0da5b2be5d6a0280cb01f67 SHA512 a1e4234ed368a31f5cda30bde01c748881136580e2ba2ab103d8ad16c5e6c2958c44ee6600a0ed0043e146983825c581f9a00e98a6fa6e73a2f6da26dc05ecf0
+EBUILD rust-1.77.1-r100.ebuild 20945 BLAKE2B 92f9ab8d5e31392aad683f85b1680f3bae2d76a0628e26d98756c6991bcb12cf1b75412c518beb2f4ce94f73bbeed32621758f7238e75dbfb8aac9333d6c7984 SHA512 873d344ae6aa87f0dd63f677083b6b53ee38d0676b135ec8343eef53f2dad8a6ab7321bf710998cddc7b8f70ee97876dc99463f3ba48d8239856245c07782f18
EBUILD rust-1.77.1.ebuild 25245 BLAKE2B d514569674cc230e4959a9e73d38f14b263dac22fa7ec3f91c417d142caf65f5920ab44bc28e0e23c32bc7113f73c1b27fbf74a82215e35c33dd97ac4b3f2ee4 SHA512 b36d066101a248f31560fd7db39f9367e42618ba882c43df3807fc70823ec319365096623e2d41dd37a9babd83d2d55c007145ae7185a1818bd926783ad3eb5c
-EBUILD rust-1.79.0-r100.ebuild 24846 BLAKE2B 17c985d69e237feb9f57c875a868f6b10eab59ac01f4a9cb958894bbb58170456ee69b794c94e51ee28b55b7e860846c4cbb63a022bafbfb8073a904f7b419d0 SHA512 662017cd52dd1c4edaa9658fde4a33ae58a7ec897bf167d550777cdcb1fa829aa316cb87fa853fd79fc55602121a38997eaa6712c059a9d3d5def6171434c5ca
+EBUILD rust-1.79.0-r100.ebuild 21180 BLAKE2B 7e8d257a3992c646b5e1d3c8ec1e90252a1bbee5e3706e281fcf492bbc0e9cadc637db0caf778cfe18bf9b482d486322ebbfddf0d449fe0395c16429969a47ba SHA512 bd2e1843b1395556c89d1a19b16e9a0666e0f6aedcce2cbae8aa92914f0a69874acff03f5264cc94d51774209d83f98127bd844fda290afd67338aa8c8052ba3
EBUILD rust-1.79.0.ebuild 25480 BLAKE2B d2087cce728db5d5383e324476ba5380f95776d0d4742917742d9bd332b643c498f7a30ae32045d44a7aaeba7f235a614add12aa739765e4c308a02027ef02b4 SHA512 04ca9c5dcf088a0398ab05a39eb77119dd495248217fffe7451736cdee3c3ab1a274a54c4b6257384d39678cc87102d3e2ea3f0dcb40cbd657a0e07b7b93eaac
-EBUILD rust-1.80.1-r100.ebuild 24761 BLAKE2B f71f6e88c4b135400e8cb2e58e1bded0296eb7a52f5d888f78a8cb0fe4143e8e2d42ddffc304c6768dfadfea00585acabff3404f28c249144b3a788c3d82306b SHA512 383acc3254e55953ca4918562b0a51e9ee0386c92cbfedfef9a7a6d24018b07238ed9d5cead88d20ffecda241de1dc1687f44e97fcbe689715281146499295c9
+EBUILD rust-1.80.1-r100.ebuild 21095 BLAKE2B 5b1bc6d3eb693255a3f07d41d38fd86a93b11bf431ea9a8b5299e6783ecdbe18baedbe0c5c1cd2c4ea5b302d25d96e89d0aa323e48acfc24c0defa2110427c7b SHA512 b1b995516ba2950050f1fb448271f84760a3f141ace8a740653c1199a9916f5cac8c7d864980f512f05ff2605f3a06fb3db3468fff43b32708577eaf41582708
EBUILD rust-1.80.1.ebuild 25412 BLAKE2B 4905111b95c2710d39f414f7eb645a5906e24258608a3fd4b3e4d160846ca0a546a113474079ff8772012469bda7d7b915dc3de0ebd7c3f8038df3e35ef5efe2 SHA512 e10c2e029100faa54caec1fe98fb19c23c8b06a1f6b1a52b899eb1761945e7de1a835e4aa2526c060b952cd12d52f70a28118bff80d2ba51053cf88eef460dde
-EBUILD rust-1.81.0-r100.ebuild 24858 BLAKE2B 9806f184b606e3e8928415ff6598a0ab5e1675d422de7888b81bfe3be71e008542413577e1043f255b57686b0829e5bcb9e89d2438047f96ff165fb7fcd26650 SHA512 79b0c354e8b6f05ea4d98e95dfc115d2e30237d181124245f65db9dc7c9cb55ce204d4f5df2f667a88461a9459f011cc67b7d348766bfaef957f36de8a6e24c8
+EBUILD rust-1.81.0-r100.ebuild 21223 BLAKE2B 0b269a49c85236dd75feef10fabc2a2a3de14994ebf2ec02865d64a120c22afc4a04dc915c65a6fd3c833c2137c2afb56fc6fbf7485a636c6778cb857d8138d4 SHA512 c25d0db934b41d03d3c637a3f55f6b81d14577c4303a504df14b56feae9d0817efe5e422c63dbba69e5c04f5c92dc884cea1bd44f2eeb266f342eb6708333f85
EBUILD rust-1.81.0.ebuild 25380 BLAKE2B c213ba368f9f49be7e3c6f0260684f9b7c7f1afa7727ca7a7db7802b5a40a9009756464f9fb5a3165cbb5161e3e18181973a67d97a2e1cde13e4d6733ac5f2b9 SHA512 56501ddc2d06c2e7ff98e704a255d850897028d115588bca21ba43530f6d8a39ad684642e802faded8ae83da06dd6d6e503c76759e6d1df9f0fdebc0f6d6ec6c
-EBUILD rust-1.82.0-r100.ebuild 25072 BLAKE2B aff538513d14f3941909b55f7df4aa8be8d5486ce36b64d93c2016d84983299f49e1dfaf928cb8dfd0c4e430cb517e1cc80bc45b1fb3179108a508fad1317ec8 SHA512 3f475d92940070bff90f7163e86cfdf637bb838c89cb19791bc97cffa34e9dfe82b764813dfd86b7e6f2ec819fa9b4387a880f9a6a13c1a14e446e8aa39e60f7
+EBUILD rust-1.82.0-r100.ebuild 21417 BLAKE2B 7c530caf1aa5af7fa139d55f18bfb3298daabbcf873ade3329ce7c0f8c0d03ab8a1967dc5af44bd7ba714bb6aadb10b82169e7dd824c113c3150281eb126ed9a SHA512 c4388c3080c437e53b249c3dcd8d7f042a82819f2fb20d64c244b4aacaf0acb1ef53b2de3d5a823d113ff01ca73d5bbc6b0226a768f8442b0d7cac0b8d16f4aa
EBUILD rust-1.82.0.ebuild 25639 BLAKE2B 276ef627db58d7d7cb85f4f84f0c68ef36da91822d75c83f13c14ac73b35729b2ce354f79506122449cdb8517bb34a6c1f13dc158987e05b088ae96e1ec33f11 SHA512 8dd95a85eff44f5567ab6f038399cddbd111213810a1390dbef0ed9d68284c46368511006158935db3d9b70f06851e7e3a562a9c0044f85a532dc6c812a38c24
MISC metadata.xml 1945 BLAKE2B cf3ed0b2550564faee94e53e21deb0e905b38cd45c503ba18f55c36f13093fa65c4dac8e544c891c9378b2ce32912cab1a1a0b61a277ff29f5288b672f4a218d SHA512 a28dc5b78e15aaeec5ccf028a053c3df6a12b24bcfb6e8948e2e25b3c04cc8ede5973f1e57c723081355853152baa8c8219e36bb603b714628e71587d2bba45e
diff --git a/dev-lang/rust/rust-1.71.1-r100.ebuild b/dev-lang/rust/rust-1.71.1-r100.ebuild
index d6cb947db404..75c3d5cb771b 100644
--- a/dev-lang/rust/rust-1.71.1-r100.ebuild
+++ b/dev-lang/rust/rust-1.71.1-r100.ebuild
@@ -6,8 +6,11 @@ EAPI=8
LLVM_COMPAT=( 16 )
PYTHON_COMPAT=( python3_{10..12} )
+RUST_MAX_VER=${PV}
+RUST_MIN_VER="$(ver_cut 1).$(($(ver_cut 2) - 1)).0"
+
inherit check-reqs estack flag-o-matic llvm-r1 multiprocessing \
- multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
+ multilib multilib-build python-any-r1 rust rust-toolchain toolchain-funcs verify-sig
if [[ ${PV} = *beta* ]]; then
betaver=${PV//*beta}
@@ -20,18 +23,14 @@ else
KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
fi
-S="${WORKDIR}/${MY_P}-src"
-
-RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
-
DESCRIPTION="Language empowering everyone to build reliable and efficient software"
HOMEPAGE="https://www.rust-lang.org/"
SRC_URI="
https://static.rust-lang.org/dist/${SRC}
verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
- !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
"
+S="${WORKDIR}/${MY_P}-src"
# keep in sync with llvm ebuild of the same version as bundled one.
ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai LoongArch Mips MSP430
@@ -52,29 +51,12 @@ done
LLVM_DEPEND+=( " wasm? ( $(llvm_gen_dep 'sys-devel/lld:${LLVM_SLOT}') )" )
LLVM_DEPEND+=( " $(llvm_gen_dep 'sys-devel/llvm:${LLVM_SLOT}')" )
-# to bootstrap we need at least exactly previous version, or same.
-# most of the time previous versions fail to bootstrap with newer
-# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
-# but it fails to bootstrap with 1.48.x
-# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.json
-RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
-RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
-BOOTSTRAP_DEPEND="||
- (
- =dev-lang/rust-"${RUST_DEP_PREV}"
- =dev-lang/rust-bin-"${RUST_DEP_PREV}"
- =dev-lang/rust-"${RUST_DEP_CURR}"
- =dev-lang/rust-bin-"${RUST_DEP_CURR}"
- )
-"
-
BDEPEND="${PYTHON_DEPS}
app-eselect/eselect-rust
|| (
>=sys-devel/gcc-4.7
>=sys-devel/clang-3.5
)
- system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
!system-llvm? (
>=dev-build/cmake-3.13.4
app-alternatives/ninja
@@ -158,32 +140,8 @@ toml_usex() {
usex "${1}" true false
}
-bootstrap_rust_version_check() {
- # never call from pkg_pretend. eselect-rust may be not installed yet.
- [[ ${MERGE_TYPE} == binary ]] && return
- local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
- local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
- local rustc_version=( $(eselect --brief rust show 2>/dev/null) )
- rustc_version=${rustc_version[0]#rust-bin-}
- rustc_version=${rustc_version#rust-}
-
- [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
-
- if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
- eerror "Rust >=${rustc_wanted} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too old"
- elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
- eerror "Rust <${rustc_toonew} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too new"
- else
- einfo "Using rust ${rustc_version} to build"
- fi
-}
-
pre_build_checks() {
- local M=8192
+ local M=9216
# multiply requirements by 1.3 if we are doing x86-multilib
if use amd64; then
M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 ))
@@ -206,7 +164,6 @@ pre_build_checks() {
M=$(( 15 * ${M} / 10 ))
fi
eshopts_pop
- M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
M=$(( $(usex doc 256 0) + ${M} ))
CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
}
@@ -236,7 +193,7 @@ pkg_setup() {
export LIBGIT2_NO_PKG_CONFIG=1 #749381
- use system-bootstrap && bootstrap_rust_version_check
+ rust_pkg_setup
if use system-llvm; then
llvm-r1_pkg_setup
@@ -247,38 +204,6 @@ pkg_setup() {
fi
}
-esetup_unwind_hack() {
- # https://bugs.gentoo.org/870280
- # this is a hack needed to bootstrap with libgcc_s linked tarball on llvm-libunwind system.
- # it should trigger for internal bootstrap or system-bootstrap with rust-bin.
- # the whole idea is for stage0 to bootstrap with fake libgcc_s.
- # final stage will receive -L${T}/lib but not -lgcc_s args, producing clean compiler.
- local fakelib="${T}/fakelib"
- mkdir -p "${fakelib}" || die
- # we need both symlinks, one for cargo runtime, other for linker.
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || die
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die
- export LD_LIBRARY_PATH="${fakelib}"
- export RUSTFLAGS+=" -L${fakelib}"
- # this is a literally magic variable that gets through cargo cache, without it some
- # crates ignore RUSTFLAGS.
- # this variable can not contain leading space.
- export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}"
-}
-
-src_prepare() {
- if ! use system-bootstrap; then
- has_version sys-devel/gcc || esetup_unwind_hack
- local rust_stage0_root="${WORKDIR}"/rust-stage0
- local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
-
- "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
- --without=rust-docs-json-preview,rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
- fi
-
- default
-}
-
src_configure() {
filter-lto # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231
@@ -306,14 +231,7 @@ src_configure() {
use rust-analyzer && tools+=',"rust-analyzer"'
use rust-src && tools+=',"src"'
- local rust_stage0_root
- if use system-bootstrap; then
- local printsysroot
- printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
- rust_stage0_root="${printsysroot}"
- else
- rust_stage0_root="${WORKDIR}"/rust-stage0
- fi
+ local rust_stage0_root="$(${RUSTC} --print sysroot || die "Can't determine rust's sysroot")"
# in case of prefix it will be already prefixed, as --print sysroot returns full path
[[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
@@ -710,8 +628,8 @@ pkg_postinst() {
eselect rust update
if has_version dev-debug/gdb || has_version dev-debug/lldb; then
- elog "Rust installs a helper script for calling GDB and LLDB,"
- elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
+ elog "Rust installs helper scripts for calling GDB and LLDB,"
+ elog "for convenience they are installed under /usr/bin/rust-{gdb,lldb}-${PV}."
fi
if has_version app-editors/emacs; then
diff --git a/dev-lang/rust/rust-1.74.1-r100.ebuild b/dev-lang/rust/rust-1.74.1-r100.ebuild
index bd474794968a..eb2f5da602b4 100644
--- a/dev-lang/rust/rust-1.74.1-r100.ebuild
+++ b/dev-lang/rust/rust-1.74.1-r100.ebuild
@@ -6,8 +6,11 @@ EAPI=8
LLVM_COMPAT=( 17 )
PYTHON_COMPAT=( python3_{10..12} )
+RUST_MAX_VER=${PV}
+RUST_MIN_VER="$(ver_cut 1).$(($(ver_cut 2) - 1)).0"
+
inherit check-reqs estack flag-o-matic llvm-r1 multiprocessing \
- multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
+ multilib multilib-build python-any-r1 rust rust-toolchain toolchain-funcs verify-sig
if [[ ${PV} = *beta* ]]; then
betaver=${PV//*beta}
@@ -20,15 +23,12 @@ else
KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86"
fi
-RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
-
DESCRIPTION="Language empowering everyone to build reliable and efficient software"
HOMEPAGE="https://www.rust-lang.org/"
SRC_URI="
https://static.rust-lang.org/dist/${SRC}
verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
- !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
"
S="${WORKDIR}/${MY_P}-src"
@@ -53,29 +53,12 @@ done
LLVM_DEPEND+=( " wasm? ( $(llvm_gen_dep 'sys-devel/lld:${LLVM_SLOT}') )" )
LLVM_DEPEND+=( " $(llvm_gen_dep 'sys-devel/llvm:${LLVM_SLOT}')" )
-# to bootstrap we need at least exactly previous version, or same.
-# most of the time previous versions fail to bootstrap with newer
-# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
-# but it fails to bootstrap with 1.48.x
-# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.json
-RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
-RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
-BOOTSTRAP_DEPEND="||
- (
- =dev-lang/rust-"${RUST_DEP_PREV}"
- =dev-lang/rust-bin-"${RUST_DEP_PREV}"
- =dev-lang/rust-"${RUST_DEP_CURR}"
- =dev-lang/rust-bin-"${RUST_DEP_CURR}"
- )
-"
-
BDEPEND="${PYTHON_DEPS}
app-eselect/eselect-rust
|| (
>=sys-devel/gcc-4.7
>=sys-devel/clang-3.5
)
- system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
!system-llvm? (
>=dev-build/cmake-3.13.4
app-alternatives/ninja
@@ -164,32 +147,8 @@ toml_usex() {
usex "${1}" true false
}
-bootstrap_rust_version_check() {
- # never call from pkg_pretend. eselect-rust may be not installed yet.
- [[ ${MERGE_TYPE} == binary ]] && return
- local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
- local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
- local rustc_version=( $(eselect --brief --root="${BROOT}" rust show 2>/dev/null) )
- rustc_version=${rustc_version[0]#rust-bin-}
- rustc_version=${rustc_version#rust-}
-
- [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
-
- if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
- eerror "Rust >=${rustc_wanted} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too old"
- elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
- eerror "Rust <${rustc_toonew} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too new"
- else
- einfo "Using rust ${rustc_version} to build"
- fi
-}
-
pre_build_checks() {
- local M=8192
+ local M=9216
# multiply requirements by 1.3 if we are doing x86-multilib
if use amd64; then
M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 ))
@@ -212,7 +171,6 @@ pre_build_checks() {
M=$(( 15 * ${M} / 10 ))
fi
eshopts_pop
- M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
M=$(( $(usex doc 256 0) + ${M} ))
CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
}
@@ -247,14 +205,13 @@ pkg_setup() {
export OPENSSL_INCLUDE_DIR="${ROOT}/usr/include"
export OPENSSL_LIB_DIR="${ROOT}/usr/$(get_libdir)"
- use system-bootstrap || die "USE=system-bootstrap is required when cross-compiling"
use system-llvm && die "USE=system-llvm not allowed when cross-compiling"
local cross_llvm_target="$(llvm_tuple_to_target "${CBUILD}")"
use "llvm_targets_${cross_llvm_target}" || \
die "Must enable LLVM_TARGETS=${cross_llvm_target} matching CBUILD=${CBUILD} when cross-compiling"
fi
- use system-bootstrap && bootstrap_rust_version_check
+ rust_pkg_setup
if use system-llvm; then
llvm-r1_pkg_setup
@@ -265,45 +222,6 @@ pkg_setup() {
fi
}
-esetup_unwind_hack() {
- # https://bugs.gentoo.org/870280
- # this is a hack needed to bootstrap with libgcc_s linked tarball on llvm-libunwind system.
- # it should trigger for internal bootstrap or system-bootstrap with rust-bin.
- # the whole idea is for stage0 to bootstrap with fake libgcc_s.
- # final stage will receive -L${T}/lib but not -lgcc_s args, producing clean compiler.
- local fakelib="${T}/fakelib"
- mkdir -p "${fakelib}" || die
- # we need both symlinks, one for cargo runtime, other for linker.
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || die
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die
- export LD_LIBRARY_PATH="${fakelib}"
- export RUSTFLAGS+=" -L${fakelib}"
- # this is a literally magic variable that gets through cargo cache, without it some
- # crates ignore RUSTFLAGS.
- # this variable can not contain leading space.
- export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}"
-}
-
-src_prepare() {
- # Clear vendor checksums for crates that we patched to bump libc.
- # NOTE: refresh this on each bump.
- #for i in addr2line-0.20.0 bstr cranelift-jit crossbeam-channel elasticlunr-rs handlebars icu_locid libffi \
- # terminal_size tracing-tree; do
- # clear_vendor_checksums "${i}"
- #done
-
- if ! use system-bootstrap; then
- has_version sys-devel/gcc || esetup_unwind_hack
- local rust_stage0_root="${WORKDIR}"/rust-stage0
- local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi "${CBUILD}")"
-
- "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
- --without=rust-docs-json-preview,rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
- fi
-
- default
-}
-
src_configure() {
filter-lto # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231
@@ -331,14 +249,7 @@ src_configure() {
use rust-analyzer && tools+=',"rust-analyzer"'
use rust-src && tools+=',"src"'
- local rust_stage0_root
- if use system-bootstrap; then
- local printsysroot
- printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
- rust_stage0_root="${printsysroot}"
- else
- rust_stage0_root="${WORKDIR}"/rust-stage0
- fi
+ local rust_stage0_root="$(${RUSTC} --print sysroot || die "Can't determine rust's sysroot")"
# in case of prefix it will be already prefixed, as --print sysroot returns full path
[[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
@@ -746,8 +657,8 @@ pkg_postinst() {
eselect rust update
if has_version dev-debug/gdb || has_version dev-debug/lldb; then
- elog "Rust installs a helper script for calling GDB and LLDB,"
- elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
+ elog "Rust installs helper scripts for calling GDB and LLDB,"
+ elog "for convenience they are installed under /usr/bin/rust-{gdb,lldb}-${PV}."
fi
if has_version app-editors/emacs; then
diff --git a/dev-lang/rust/rust-1.75.0-r100.ebuild b/dev-lang/rust/rust-1.75.0-r100.ebuild
index 0517e38b84f4..8b6de6276bce 100644
--- a/dev-lang/rust/rust-1.75.0-r100.ebuild
+++ b/dev-lang/rust/rust-1.75.0-r100.ebuild
@@ -6,8 +6,11 @@ EAPI=8
LLVM_COMPAT=( 17 )
PYTHON_COMPAT=( python3_{10..12} )
+RUST_MAX_VER=${PV}
+RUST_MIN_VER="$(ver_cut 1).$(($(ver_cut 2) - 1)).0"
+
inherit check-reqs estack flag-o-matic llvm-r1 multiprocessing \
- multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
+ multilib multilib-build python-any-r1 rust rust-toolchain toolchain-funcs verify-sig
if [[ ${PV} = *beta* ]]; then
betaver=${PV//*beta}
@@ -20,18 +23,14 @@ else
KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86"
fi
-S="${WORKDIR}/${MY_P}-src"
-
-RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
-
DESCRIPTION="Language empowering everyone to build reliable and efficient software"
HOMEPAGE="https://www.rust-lang.org/"
SRC_URI="
https://static.rust-lang.org/dist/${SRC}
verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
- !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
"
+S="${WORKDIR}/${MY_P}-src"
# keep in sync with llvm ebuild of the same version as bundled one.
ALL_LLVM_TARGETS=( AArch64 AMDGPU ARC ARM AVR BPF CSKY DirectX Hexagon Lanai
@@ -53,29 +52,12 @@ done
LLVM_DEPEND+=( " wasm? ( $(llvm_gen_dep 'sys-devel/lld:${LLVM_SLOT}') )" )
LLVM_DEPEND+=( " $(llvm_gen_dep 'sys-devel/llvm:${LLVM_SLOT}')" )
-# to bootstrap we need at least exactly previous version, or same.
-# most of the time previous versions fail to bootstrap with newer
-# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
-# but it fails to bootstrap with 1.48.x
-# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.json
-RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
-RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
-BOOTSTRAP_DEPEND="||
- (
- =dev-lang/rust-"${RUST_DEP_PREV}"
- =dev-lang/rust-bin-"${RUST_DEP_PREV}"
- =dev-lang/rust-"${RUST_DEP_CURR}"
- =dev-lang/rust-bin-"${RUST_DEP_CURR}"
- )
-"
-
BDEPEND="${PYTHON_DEPS}
app-eselect/eselect-rust
|| (
>=sys-devel/gcc-4.7
>=sys-devel/clang-3.5
)
- system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
!system-llvm? (
>=dev-build/cmake-3.13.4
app-alternatives/ninja
@@ -167,32 +149,8 @@ toml_usex() {
usex "${1}" true false
}
-bootstrap_rust_version_check() {
- # never call from pkg_pretend. eselect-rust may be not installed yet.
- [[ ${MERGE_TYPE} == binary ]] && return
- local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
- local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
- local rustc_version=( $(eselect --brief --root="${BROOT}" rust show 2>/dev/null) )
- rustc_version=${rustc_version[0]#rust-bin-}
- rustc_version=${rustc_version#rust-}
-
- [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
-
- if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
- eerror "Rust >=${rustc_wanted} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too old"
- elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
- eerror "Rust <${rustc_toonew} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too new"
- else
- einfo "Using rust ${rustc_version} to build"
- fi
-}
-
pre_build_checks() {
- local M=8192
+ local M=9216
# multiply requirements by 1.3 if we are doing x86-multilib
if use amd64; then
M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 ))
@@ -215,7 +173,6 @@ pre_build_checks() {
M=$(( 15 * ${M} / 10 ))
fi
eshopts_pop
- M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
M=$(( $(usex doc 256 0) + ${M} ))
CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
}
@@ -250,14 +207,13 @@ pkg_setup() {
export OPENSSL_INCLUDE_DIR="${ROOT}/usr/include"
export OPENSSL_LIB_DIR="${ROOT}/usr/$(get_libdir)"
- use system-bootstrap || die "USE=system-bootstrap is required when cross-compiling"
use system-llvm && die "USE=system-llvm not allowed when cross-compiling"
local cross_llvm_target="$(llvm_tuple_to_target "${CBUILD}")"
use "llvm_targets_${cross_llvm_target}" || \
die "Must enable LLVM_TARGETS=${cross_llvm_target} matching CBUILD=${CBUILD} when cross-compiling"
fi
- use system-bootstrap && bootstrap_rust_version_check
+ rust_pkg_setup
if use system-llvm; then
llvm-r1_pkg_setup
@@ -268,45 +224,6 @@ pkg_setup() {
fi
}
-esetup_unwind_hack() {
- # https://bugs.gentoo.org/870280
- # this is a hack needed to bootstrap with libgcc_s linked tarball on llvm-libunwind system.
- # it should trigger for internal bootstrap or system-bootstrap with rust-bin.
- # the whole idea is for stage0 to bootstrap with fake libgcc_s.
- # final stage will receive -L${T}/lib but not -lgcc_s args, producing clean compiler.
- local fakelib="${T}/fakelib"
- mkdir -p "${fakelib}" || die
- # we need both symlinks, one for cargo runtime, other for linker.
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || die
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die
- export LD_LIBRARY_PATH="${fakelib}"
- export RUSTFLAGS+=" -L${fakelib}"
- # this is a literally magic variable that gets through cargo cache, without it some
- # crates ignore RUSTFLAGS.
- # this variable can not contain leading space.
- export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}"
-}
-
-src_prepare() {
- # Clear vendor checksums for crates that we patched to bump libc.
- # NOTE: refresh this on each bump.
- #for i in addr2line-0.20.0 bstr cranelift-jit crossbeam-channel elasticlunr-rs handlebars icu_locid libffi \
- # terminal_size tracing-tree; do
- # clear_vendor_checksums "${i}"
- #done
-
- if ! use system-bootstrap; then
- has_version sys-devel/gcc || esetup_unwind_hack
- local rust_stage0_root="${WORKDIR}"/rust-stage0
- local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi "${CBUILD}")"
-
- "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
- --without=rust-docs-json-preview,rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
- fi
-
- default
-}
-
src_configure() {
filter-lto # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231
@@ -334,14 +251,7 @@ src_configure() {
use rust-analyzer && tools+=',"rust-analyzer"'
use rust-src && tools+=',"src"'
- local rust_stage0_root
- if use system-bootstrap; then
- local printsysroot
- printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
- rust_stage0_root="${printsysroot}"
- else
- rust_stage0_root="${WORKDIR}"/rust-stage0
- fi
+ local rust_stage0_root="$(${RUSTC} --print sysroot || die "Can't determine rust's sysroot")"
# in case of prefix it will be already prefixed, as --print sysroot returns full path
[[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
@@ -749,8 +659,8 @@ pkg_postinst() {
eselect rust update
if has_version dev-debug/gdb || has_version dev-debug/lldb; then
- elog "Rust installs a helper script for calling GDB and LLDB,"
- elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
+ elog "Rust installs helper scripts for calling GDB and LLDB,"
+ elog "for convenience they are installed under /usr/bin/rust-{gdb,lldb}-${PV}."
fi
if has_version app-editors/emacs; then
diff --git a/dev-lang/rust/rust-1.77.1-r100.ebuild b/dev-lang/rust/rust-1.77.1-r100.ebuild
index a6e6f0023b76..6de3dceb2d04 100644
--- a/dev-lang/rust/rust-1.77.1-r100.ebuild
+++ b/dev-lang/rust/rust-1.77.1-r100.ebuild
@@ -6,8 +6,11 @@ EAPI=8
LLVM_COMPAT=( 17 )
PYTHON_COMPAT=( python3_{10..12} )
+RUST_MAX_VER=${PV}
+RUST_MIN_VER="$(ver_cut 1).$(($(ver_cut 2) - 1)).0"
+
inherit check-reqs estack flag-o-matic llvm-r1 multiprocessing \
- multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
+ multilib multilib-build python-any-r1 rust rust-toolchain toolchain-funcs verify-sig
if [[ ${PV} = *beta* ]]; then
betaver=${PV//*beta}
@@ -19,9 +22,6 @@ else
SRC="${MY_P}-src.tar.xz"
KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86"
fi
-S="${WORKDIR}/${MY_P}-src"
-
-RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
DESCRIPTION="Systems programming language from Mozilla"
HOMEPAGE="https://www.rust-lang.org/"
@@ -29,8 +29,8 @@ HOMEPAGE="https://www.rust-lang.org/"
SRC_URI="
https://static.rust-lang.org/dist/${SRC}
verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
- !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
"
+S="${WORKDIR}/${MY_P}-src"
# keep in sync with llvm ebuild of the same version as bundled one.
ALL_LLVM_TARGETS=( AArch64 AMDGPU ARC ARM AVR BPF CSKY DirectX Hexagon Lanai
@@ -52,29 +52,12 @@ done
LLVM_DEPEND+=( " wasm? ( $(llvm_gen_dep 'sys-devel/lld:${LLVM_SLOT}') )" )
LLVM_DEPEND+=( " $(llvm_gen_dep 'sys-devel/llvm:${LLVM_SLOT}')" )
-# to bootstrap we need at least exactly previous version, or same.
-# most of the time previous versions fail to bootstrap with newer
-# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
-# but it fails to bootstrap with 1.48.x
-# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.json
-RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
-RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
-BOOTSTRAP_DEPEND="||
- (
- =dev-lang/rust-"${RUST_DEP_PREV}"
- =dev-lang/rust-bin-"${RUST_DEP_PREV}"
- =dev-lang/rust-"${RUST_DEP_CURR}"
- =dev-lang/rust-bin-"${RUST_DEP_CURR}"
- )
-"
-
BDEPEND="${PYTHON_DEPS}
app-eselect/eselect-rust
|| (
>=sys-devel/gcc-4.7
>=sys-devel/clang-3.5
)
- system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
!system-llvm? (
>=dev-build/cmake-3.13.4
app-alternatives/ninja
@@ -164,32 +147,8 @@ toml_usex() {
usex "${1}" true false
}
-bootstrap_rust_version_check() {
- # never call from pkg_pretend. eselect-rust may be not installed yet.
- [[ ${MERGE_TYPE} == binary ]] && return
- local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
- local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
- local rustc_version=( $(eselect --brief --root="${BROOT}" rust show 2>/dev/null) )
- rustc_version=${rustc_version[0]#rust-bin-}
- rustc_version=${rustc_version#rust-}
-
- [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
-
- if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
- eerror "Rust >=${rustc_wanted} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too old"
- elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
- eerror "Rust <${rustc_toonew} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too new"
- else
- einfo "Using rust ${rustc_version} to build"
- fi
-}
-
pre_build_checks() {
- local M=8192
+ local M=9216
# multiply requirements by 1.3 if we are doing x86-multilib
if use amd64; then
M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 ))
@@ -212,7 +171,6 @@ pre_build_checks() {
M=$(( 15 * ${M} / 10 ))
fi
eshopts_pop
- M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
M=$(( $(usex doc 256 0) + ${M} ))
CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
}
@@ -247,14 +205,13 @@ pkg_setup() {
export OPENSSL_INCLUDE_DIR="${ROOT}/usr/include"
export OPENSSL_LIB_DIR="${ROOT}/usr/$(get_libdir)"
- use system-bootstrap || die "USE=system-bootstrap is required when cross-compiling"
use system-llvm && die "USE=system-llvm not allowed when cross-compiling"
local cross_llvm_target="$(llvm_tuple_to_target "${CBUILD}")"
use "llvm_targets_${cross_llvm_target}" || \
die "Must enable LLVM_TARGETS=${cross_llvm_target} matching CBUILD=${CBUILD} when cross-compiling"
fi
- use system-bootstrap && bootstrap_rust_version_check
+ rust_pkg_setup
if use system-llvm; then
llvm-r1_pkg_setup
@@ -265,45 +222,6 @@ pkg_setup() {
fi
}
-esetup_unwind_hack() {
- # https://bugs.gentoo.org/870280
- # this is a hack needed to bootstrap with libgcc_s linked tarball on llvm-libunwind system.
- # it should trigger for internal bootstrap or system-bootstrap with rust-bin.
- # the whole idea is for stage0 to bootstrap with fake libgcc_s.
- # final stage will receive -L${T}/lib but not -lgcc_s args, producing clean compiler.
- local fakelib="${T}/fakelib"
- mkdir -p "${fakelib}" || die
- # we need both symlinks, one for cargo runtime, other for linker.
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || die
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die
- export LD_LIBRARY_PATH="${fakelib}"
- export RUSTFLAGS+=" -L${fakelib}"
- # this is a literally magic variable that gets through cargo cache, without it some
- # crates ignore RUSTFLAGS.
- # this variable can not contain leading space.
- export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}"
-}
-
-src_prepare() {
- # Clear vendor checksums for crates that we patched to bump libc.
- # NOTE: refresh this on each bump.
- #for i in addr2line-0.20.0 bstr cranelift-jit crossbeam-channel elasticlunr-rs handlebars icu_locid libffi \
- # terminal_size tracing-tree; do
- # clear_vendor_checksums "${i}"
- #done
-
- if ! use system-bootstrap; then
- has_version sys-devel/gcc || esetup_unwind_hack
- local rust_stage0_root="${WORKDIR}"/rust-stage0
- local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi "${CBUILD}")"
-
- "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
- --without=rust-docs-json-preview,rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
- fi
-
- default
-}
-
src_configure() {
filter-lto # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231
@@ -331,14 +249,7 @@ src_configure() {
use rust-analyzer && tools+=',"rust-analyzer","rust-analyzer-proc-macro-srv"'
use rust-src && tools+=',"src"'
- local rust_stage0_root
- if use system-bootstrap; then
- local printsysroot
- printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
- rust_stage0_root="${printsysroot}"
- else
- rust_stage0_root="${WORKDIR}"/rust-stage0
- fi
+ local rust_stage0_root="$(${RUSTC} --print sysroot || die "Can't determine rust's sysroot")"
# in case of prefix it will be already prefixed, as --print sysroot returns full path
[[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
@@ -747,8 +658,8 @@ pkg_postinst() {
eselect rust update
if has_version dev-debug/gdb || has_version dev-debug/lldb; then
- elog "Rust installs a helper script for calling GDB and LLDB,"
- elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
+ elog "Rust installs helper scripts for calling GDB and LLDB,"
+ elog "for convenience they are installed under /usr/bin/rust-{gdb,lldb}-${PV}."
fi
if has_version app-editors/emacs; then
diff --git a/dev-lang/rust/rust-1.79.0-r100.ebuild b/dev-lang/rust/rust-1.79.0-r100.ebuild
index bf13cf11984a..3d9b91670a92 100644
--- a/dev-lang/rust/rust-1.79.0-r100.ebuild
+++ b/dev-lang/rust/rust-1.79.0-r100.ebuild
@@ -6,8 +6,11 @@ EAPI=8
LLVM_COMPAT=( 18 )
PYTHON_COMPAT=( python3_{10..13} )
+RUST_MAX_VER=${PV}
+RUST_MIN_VER="$(ver_cut 1).$(($(ver_cut 2) - 1)).0"
+
inherit check-reqs estack flag-o-matic llvm-r1 multiprocessing \
- multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
+ multilib multilib-build python-any-r1 rust rust-toolchain toolchain-funcs verify-sig
if [[ ${PV} = *beta* ]]; then
betaver=${PV//*beta}
@@ -20,15 +23,12 @@ else
KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
fi
-RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
-
DESCRIPTION="Systems programming language from Mozilla"
HOMEPAGE="https://www.rust-lang.org/"
SRC_URI="
https://static.rust-lang.org/dist/${SRC}
verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
- !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
"
S="${WORKDIR}/${MY_P}-src"
@@ -52,29 +52,12 @@ done
LLVM_DEPEND+=( " wasm? ( $(llvm_gen_dep 'sys-devel/lld:${LLVM_SLOT}') )" )
LLVM_DEPEND+=( " $(llvm_gen_dep 'sys-devel/llvm:${LLVM_SLOT}')" )
-# to bootstrap we need at least exactly previous version, or same.
-# most of the time previous versions fail to bootstrap with newer
-# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
-# but it fails to bootstrap with 1.48.x
-# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.json
-RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
-RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
-BOOTSTRAP_DEPEND="||
- (
- =dev-lang/rust-"${RUST_DEP_PREV}"
- =dev-lang/rust-bin-"${RUST_DEP_PREV}"
- =dev-lang/rust-"${RUST_DEP_CURR}"
- =dev-lang/rust-bin-"${RUST_DEP_CURR}"
- )
-"
-
BDEPEND="${PYTHON_DEPS}
app-eselect/eselect-rust
|| (
>=sys-devel/gcc-4.7
>=sys-devel/clang-3.5
)
- system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
!system-llvm? (
>=dev-build/cmake-3.13.4
app-alternatives/ninja
@@ -164,32 +147,8 @@ toml_usex() {
usex "${1}" true false
}
-bootstrap_rust_version_check() {
- # never call from pkg_pretend. eselect-rust may be not installed yet.
- [[ ${MERGE_TYPE} == binary ]] && return
- local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
- local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
- local rustc_version=( $(eselect --brief --root="${BROOT}" rust show 2>/dev/null) )
- rustc_version=${rustc_version[0]#rust-bin-}
- rustc_version=${rustc_version#rust-}
-
- [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
-
- if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
- eerror "Rust >=${rustc_wanted} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too old"
- elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
- eerror "Rust <${rustc_toonew} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too new"
- else
- einfo "Using rust ${rustc_version} to build"
- fi
-}
-
pre_build_checks() {
- local M=8192
+ local M=9216
# multiply requirements by 1.3 if we are doing x86-multilib
if use amd64; then
M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 ))
@@ -212,7 +171,6 @@ pre_build_checks() {
M=$(( 15 * ${M} / 10 ))
fi
eshopts_pop
- M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
M=$(( $(usex doc 256 0) + ${M} ))
CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
}
@@ -247,14 +205,13 @@ pkg_setup() {
export OPENSSL_INCLUDE_DIR="${ROOT}/usr/include"
export OPENSSL_LIB_DIR="${ROOT}/usr/$(get_libdir)"
- use system-bootstrap || die "USE=system-bootstrap is required when cross-compiling"
use system-llvm && die "USE=system-llvm not allowed when cross-compiling"
local cross_llvm_target="$(llvm_tuple_to_target "${CBUILD}")"
use "llvm_targets_${cross_llvm_target}" || \
die "Must enable LLVM_TARGETS=${cross_llvm_target} matching CBUILD=${CBUILD} when cross-compiling"
fi
- use system-bootstrap && bootstrap_rust_version_check
+ rust_pkg_setup
if use system-llvm; then
llvm-r1_pkg_setup
@@ -265,45 +222,6 @@ pkg_setup() {
fi
}
-esetup_unwind_hack() {
- # https://bugs.gentoo.org/870280
- # this is a hack needed to bootstrap with libgcc_s linked tarball on llvm-libunwind system.
- # it should trigger for internal bootstrap or system-bootstrap with rust-bin.
- # the whole idea is for stage0 to bootstrap with fake libgcc_s.
- # final stage will receive -L${T}/lib but not -lgcc_s args, producing clean compiler.
- local fakelib="${T}/fakelib"
- mkdir -p "${fakelib}" || die
- # we need both symlinks, one for cargo runtime, other for linker.
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || die
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die
- export LD_LIBRARY_PATH="${fakelib}"
- export RUSTFLAGS+=" -L${fakelib}"
- # this is a literally magic variable that gets through cargo cache, without it some
- # crates ignore RUSTFLAGS.
- # this variable can not contain leading space.
- export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}"
-}
-
-src_prepare() {
- # Clear vendor checksums for crates that we patched to bump libc.
- # NOTE: refresh this on each bump.
- #for i in addr2line-0.20.0 bstr cranelift-jit crossbeam-channel elasticlunr-rs handlebars icu_locid libffi \
- # terminal_size tracing-tree; do
- # clear_vendor_checksums "${i}"
- #done
-
- if ! use system-bootstrap; then
- has_version sys-devel/gcc || esetup_unwind_hack
- local rust_stage0_root="${WORKDIR}"/rust-stage0
- local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi "${CBUILD}")"
-
- "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
- --without=rust-docs-json-preview,rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
- fi
-
- default
-}
-
src_configure() {
filter-lto # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231
@@ -331,14 +249,7 @@ src_configure() {
use rust-analyzer && tools+=',"rust-analyzer","rust-analyzer-proc-macro-srv"'
use rust-src && tools+=',"src"'
- local rust_stage0_root
- if use system-bootstrap; then
- local printsysroot
- printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
- rust_stage0_root="${printsysroot}"
- else
- rust_stage0_root="${WORKDIR}"/rust-stage0
- fi
+ local rust_stage0_root="$(${RUSTC} --print sysroot || die "Can't determine rust's sysroot")"
# in case of prefix it will be already prefixed, as --print sysroot returns full path
[[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
@@ -750,8 +661,8 @@ pkg_postinst() {
eselect rust update
if has_version dev-debug/gdb || has_version dev-debug/lldb; then
- elog "Rust installs a helper script for calling GDB and LLDB,"
- elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
+ elog "Rust installs helper scripts for calling GDB and LLDB,"
+ elog "for convenience they are installed under /usr/bin/rust-{gdb,lldb}-${PV}."
fi
if has_version app-editors/emacs; then
diff --git a/dev-lang/rust/rust-1.80.1-r100.ebuild b/dev-lang/rust/rust-1.80.1-r100.ebuild
index 782d0f8d92f5..adfdb2883072 100644
--- a/dev-lang/rust/rust-1.80.1-r100.ebuild
+++ b/dev-lang/rust/rust-1.80.1-r100.ebuild
@@ -6,8 +6,11 @@ EAPI=8
LLVM_COMPAT=( 18 )
PYTHON_COMPAT=( python3_{10..13} )
+RUST_MAX_VER=${PV}
+RUST_MIN_VER="$(ver_cut 1).$(($(ver_cut 2) - 1)).0"
+
inherit check-reqs estack flag-o-matic llvm-r1 multiprocessing \
- multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
+ multilib multilib-build python-any-r1 rust rust-toolchain toolchain-funcs verify-sig
if [[ ${PV} = *beta* ]]; then
betaver=${PV//*beta}
@@ -20,15 +23,12 @@ else
KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
fi
-RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
-
DESCRIPTION="Systems programming language from Mozilla"
HOMEPAGE="https://www.rust-lang.org/"
SRC_URI="
https://static.rust-lang.org/dist/${SRC}
verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
- !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
"
S="${WORKDIR}/${MY_P}-src"
@@ -52,29 +52,12 @@ done
LLVM_DEPEND+=( " wasm? ( $(llvm_gen_dep 'sys-devel/lld:${LLVM_SLOT}') )" )
LLVM_DEPEND+=( " $(llvm_gen_dep 'sys-devel/llvm:${LLVM_SLOT}')" )
-# to bootstrap we need at least exactly previous version, or same.
-# most of the time previous versions fail to bootstrap with newer
-# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
-# but it fails to bootstrap with 1.48.x
-# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.json
-RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
-RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
-BOOTSTRAP_DEPEND="||
- (
- =dev-lang/rust-"${RUST_DEP_PREV}"
- =dev-lang/rust-bin-"${RUST_DEP_PREV}"
- =dev-lang/rust-"${RUST_DEP_CURR}"
- =dev-lang/rust-bin-"${RUST_DEP_CURR}"
- )
-"
-
BDEPEND="${PYTHON_DEPS}
app-eselect/eselect-rust
|| (
>=sys-devel/gcc-4.7
>=sys-devel/clang-3.5
)
- system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
!system-llvm? (
>=dev-build/cmake-3.13.4
app-alternatives/ninja
@@ -163,32 +146,8 @@ toml_usex() {
usex "${1}" true false
}
-bootstrap_rust_version_check() {
- # never call from pkg_pretend. eselect-rust may be not installed yet.
- [[ ${MERGE_TYPE} == binary ]] && return
- local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
- local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
- local rustc_version=( $(eselect --brief --root="${BROOT}" rust show 2>/dev/null) )
- rustc_version=${rustc_version[0]#rust-bin-}
- rustc_version=${rustc_version#rust-}
-
- [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
-
- if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
- eerror "Rust >=${rustc_wanted} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too old"
- elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
- eerror "Rust <${rustc_toonew} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too new"
- else
- einfo "Using rust ${rustc_version} to build"
- fi
-}
-
pre_build_checks() {
- local M=8192
+ local M=9216
# multiply requirements by 1.3 if we are doing x86-multilib
if use amd64; then
M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 ))
@@ -211,7 +170,6 @@ pre_build_checks() {
M=$(( 15 * ${M} / 10 ))
fi
eshopts_pop
- M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
M=$(( $(usex doc 256 0) + ${M} ))
CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
}
@@ -246,14 +204,13 @@ pkg_setup() {
export OPENSSL_INCLUDE_DIR="${ROOT}/usr/include"
export OPENSSL_LIB_DIR="${ROOT}/usr/$(get_libdir)"
- use system-bootstrap || die "USE=system-bootstrap is required when cross-compiling"
use system-llvm && die "USE=system-llvm not allowed when cross-compiling"
local cross_llvm_target="$(llvm_tuple_to_target "${CBUILD}")"
use "llvm_targets_${cross_llvm_target}" || \
die "Must enable LLVM_TARGETS=${cross_llvm_target} matching CBUILD=${CBUILD} when cross-compiling"
fi
- use system-bootstrap && bootstrap_rust_version_check
+ rust_pkg_setup
if use system-llvm; then
llvm-r1_pkg_setup
@@ -264,45 +221,6 @@ pkg_setup() {
fi
}
-esetup_unwind_hack() {
- # https://bugs.gentoo.org/870280
- # this is a hack needed to bootstrap with libgcc_s linked tarball on llvm-libunwind system.
- # it should trigger for internal bootstrap or system-bootstrap with rust-bin.
- # the whole idea is for stage0 to bootstrap with fake libgcc_s.
- # final stage will receive -L${T}/lib but not -lgcc_s args, producing clean compiler.
- local fakelib="${T}/fakelib"
- mkdir -p "${fakelib}" || die
- # we need both symlinks, one for cargo runtime, other for linker.
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || die
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die
- export LD_LIBRARY_PATH="${fakelib}"
- export RUSTFLAGS+=" -L${fakelib}"
- # this is a literally magic variable that gets through cargo cache, without it some
- # crates ignore RUSTFLAGS.
- # this variable can not contain leading space.
- export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}"
-}
-
-src_prepare() {
- # Clear vendor checksums for crates that we patched to bump libc.
- # NOTE: refresh this on each bump.
- #for i in addr2line-0.20.0 bstr cranelift-jit crossbeam-channel elasticlunr-rs handlebars icu_locid libffi \
- # terminal_size tracing-tree; do
- # clear_vendor_checksums "${i}"
- #done
-
- if ! use system-bootstrap; then
- has_version sys-devel/gcc || esetup_unwind_hack
- local rust_stage0_root="${WORKDIR}"/rust-stage0
- local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi "${CBUILD}")"
-
- "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
- --without=rust-docs-json-preview,rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
- fi
-
- default
-}
-
src_configure() {
filter-lto # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231
@@ -330,14 +248,7 @@ src_configure() {
use rust-analyzer && tools+=',"rust-analyzer","rust-analyzer-proc-macro-srv"'
use rust-src && tools+=',"src"'
- local rust_stage0_root
- if use system-bootstrap; then
- local printsysroot
- printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
- rust_stage0_root="${printsysroot}"
- else
- rust_stage0_root="${WORKDIR}"/rust-stage0
- fi
+ local rust_stage0_root="$(${RUSTC} --print sysroot || die "Can't determine rust's sysroot")"
# in case of prefix it will be already prefixed, as --print sysroot returns full path
[[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
@@ -749,8 +660,8 @@ pkg_postinst() {
eselect rust update
if has_version dev-debug/gdb || has_version dev-debug/lldb; then
- elog "Rust installs a helper script for calling GDB and LLDB,"
- elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
+ elog "Rust installs helper scripts for calling GDB and LLDB,"
+ elog "for convenience they are installed under /usr/bin/rust-{gdb,lldb}-${PV}."
fi
if has_version app-editors/emacs; then
diff --git a/dev-lang/rust/rust-1.81.0-r100.ebuild b/dev-lang/rust/rust-1.81.0-r100.ebuild
index a6316b4e46fb..8af903281b73 100644
--- a/dev-lang/rust/rust-1.81.0-r100.ebuild
+++ b/dev-lang/rust/rust-1.81.0-r100.ebuild
@@ -6,8 +6,11 @@ EAPI=8
LLVM_COMPAT=( 18 )
PYTHON_COMPAT=( python3_{10..13} )
+RUST_MAX_VER=${PV}
+RUST_MIN_VER="$(ver_cut 1).$(($(ver_cut 2) - 1)).0"
+
inherit check-reqs estack flag-o-matic llvm-r1 multiprocessing optfeature \
- multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
+ multilib multilib-build python-any-r1 rust rust-toolchain toolchain-funcs verify-sig
if [[ ${PV} = *beta* ]]; then
betaver=${PV//*beta}
@@ -21,14 +24,12 @@ else
fi
RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).1"
-
DESCRIPTION="Systems programming language from Mozilla"
HOMEPAGE="https://www.rust-lang.org/"
SRC_URI="
https://static.rust-lang.org/dist/${SRC}
verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
- !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
"
S="${WORKDIR}/${MY_P}-src"
@@ -42,7 +43,7 @@ LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
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-bootstrap 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
@@ -52,29 +53,12 @@ done
LLVM_DEPEND+=( " wasm? ( $(llvm_gen_dep 'sys-devel/lld:${LLVM_SLOT}') )" )
LLVM_DEPEND+=( " $(llvm_gen_dep 'sys-devel/llvm:${LLVM_SLOT}')" )
-# to bootstrap we need at least exactly previous version, or same.
-# most of the time previous versions fail to bootstrap with newer
-# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
-# but it fails to bootstrap with 1.48.x
-# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.json
-RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
-RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
-BOOTSTRAP_DEPEND="||
- (
- =dev-lang/rust-"${RUST_DEP_PREV}"
- =dev-lang/rust-bin-"${RUST_DEP_PREV}"
- =dev-lang/rust-"${RUST_DEP_CURR}"
- =dev-lang/rust-bin-"${RUST_DEP_CURR}"
- )
-"
-
BDEPEND="${PYTHON_DEPS}
app-eselect/eselect-rust
|| (
>=sys-devel/gcc-4.7
>=sys-devel/clang-3.5
)
- system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
!system-llvm? (
>=dev-build/cmake-3.13.4
app-alternatives/ninja
@@ -166,32 +150,8 @@ toml_usex() {
usex "${1}" true false
}
-bootstrap_rust_version_check() {
- # never call from pkg_pretend. eselect-rust may be not installed yet.
- [[ ${MERGE_TYPE} == binary ]] && return
- local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
- local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
- local rustc_version=( $(eselect --brief --root="${BROOT}" rust show 2>/dev/null) )
- rustc_version=${rustc_version[0]#rust-bin-}
- rustc_version=${rustc_version#rust-}
-
- [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
-
- if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
- eerror "Rust >=${rustc_wanted} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too old"
- elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
- eerror "Rust <${rustc_toonew} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too new"
- else
- einfo "Using rust ${rustc_version} to build"
- fi
-}
-
pre_build_checks() {
- local M=8192
+ local M=9216
# multiply requirements by 1.3 if we are doing x86-multilib
if use amd64; then
M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 ))
@@ -214,7 +174,6 @@ pre_build_checks() {
M=$(( 15 * ${M} / 10 ))
fi
eshopts_pop
- M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
M=$(( $(usex doc 256 0) + ${M} ))
CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
}
@@ -249,14 +208,13 @@ pkg_setup() {
export OPENSSL_INCLUDE_DIR="${ROOT}/usr/include"
export OPENSSL_LIB_DIR="${ROOT}/usr/$(get_libdir)"
- use system-bootstrap || die "USE=system-bootstrap is required when cross-compiling"
use system-llvm && die "USE=system-llvm not allowed when cross-compiling"
local cross_llvm_target="$(llvm_tuple_to_target "${CBUILD}")"
use "llvm_targets_${cross_llvm_target}" || \
die "Must enable LLVM_TARGETS=${cross_llvm_target} matching CBUILD=${CBUILD} when cross-compiling"
fi
- use system-bootstrap && bootstrap_rust_version_check
+ rust_pkg_setup
if use system-llvm; then
llvm-r1_pkg_setup
@@ -267,45 +225,6 @@ pkg_setup() {
fi
}
-esetup_unwind_hack() {
- # https://bugs.gentoo.org/870280
- # this is a hack needed to bootstrap with libgcc_s linked tarball on llvm-libunwind system.
- # it should trigger for internal bootstrap or system-bootstrap with rust-bin.
- # the whole idea is for stage0 to bootstrap with fake libgcc_s.
- # final stage will receive -L${T}/lib but not -lgcc_s args, producing clean compiler.
- local fakelib="${T}/fakelib"
- mkdir -p "${fakelib}" || die
- # we need both symlinks, one for cargo runtime, other for linker.
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || die
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die
- export LD_LIBRARY_PATH="${fakelib}"
- export RUSTFLAGS+=" -L${fakelib}"
- # this is a literally magic variable that gets through cargo cache, without it some
- # crates ignore RUSTFLAGS.
- # this variable can not contain leading space.
- export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}"
-}
-
-src_prepare() {
- # Clear vendor checksums for crates that we patched to bump libc.
- # NOTE: refresh this on each bump.
- #for i in addr2line-0.20.0 bstr cranelift-jit crossbeam-channel elasticlunr-rs handlebars icu_locid libffi \
- # terminal_size tracing-tree; do
- # clear_vendor_checksums "${i}"
- #done
-
- if ! use system-bootstrap; then
- has_version sys-devel/gcc || esetup_unwind_hack
- local rust_stage0_root="${WORKDIR}"/rust-stage0
- local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi "${CBUILD}")"
-
- "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
- --without=rust-docs-json-preview,rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
- fi
-
- default
-}
-
src_configure() {
filter-lto # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231
@@ -333,14 +252,7 @@ src_configure() {
use rust-analyzer && tools+=',"rust-analyzer","rust-analyzer-proc-macro-srv"'
use rust-src && tools+=',"src"'
- local rust_stage0_root
- if use system-bootstrap; then
- local printsysroot
- printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
- rust_stage0_root="${printsysroot}"
- else
- rust_stage0_root="${WORKDIR}"/rust-stage0
- fi
+ local rust_stage0_root="$(${RUSTC} --print sysroot || die "Can't determine rust's sysroot")"
# in case of prefix it will be already prefixed, as --print sysroot returns full path
[[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
@@ -750,8 +662,8 @@ pkg_postinst() {
eselect rust update
if has_version dev-debug/gdb || has_version dev-debug/lldb; then
- elog "Rust installs a helper script for calling GDB and LLDB,"
- elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
+ elog "Rust installs helper scripts for calling GDB and LLDB,"
+ elog "for convenience they are installed under /usr/bin/rust-{gdb,lldb}-${PV}."
fi
if has_version app-editors/emacs; then
diff --git a/dev-lang/rust/rust-1.82.0-r100.ebuild b/dev-lang/rust/rust-1.82.0-r100.ebuild
index 6cba749daef5..a1c5754e615c 100644
--- a/dev-lang/rust/rust-1.82.0-r100.ebuild
+++ b/dev-lang/rust/rust-1.82.0-r100.ebuild
@@ -6,8 +6,11 @@ EAPI=8
LLVM_COMPAT=( 19 )
PYTHON_COMPAT=( python3_{10..13} )
+RUST_MAX_VER=${PV}
+RUST_MIN_VER="$(ver_cut 1).$(($(ver_cut 2) - 1)).0"
+
inherit check-reqs estack flag-o-matic llvm-r1 multiprocessing optfeature \
- multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
+ multilib multilib-build python-any-r1 rust rust-toolchain toolchain-funcs verify-sig
if [[ ${PV} = *beta* ]]; then
betaver=${PV//*beta}
@@ -20,15 +23,12 @@ else
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi
-RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
-
DESCRIPTION="Systems programming language from Mozilla"
HOMEPAGE="https://www.rust-lang.org/"
SRC_URI="
https://static.rust-lang.org/dist/${SRC}
verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
- !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
"
S="${WORKDIR}/${MY_P}-src"
@@ -42,7 +42,7 @@ LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
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-bootstrap 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
@@ -52,29 +52,12 @@ done
LLVM_DEPEND+=( " wasm? ( $(llvm_gen_dep 'sys-devel/lld:${LLVM_SLOT}') )" )
LLVM_DEPEND+=( " $(llvm_gen_dep 'sys-devel/llvm:${LLVM_SLOT}')" )
-# to bootstrap we need at least exactly previous version, or same.
-# most of the time previous versions fail to bootstrap with newer
-# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
-# but it fails to bootstrap with 1.48.x
-# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.json
-RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
-RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
-BOOTSTRAP_DEPEND="||
- (
- =dev-lang/rust-"${RUST_DEP_PREV}"
- =dev-lang/rust-bin-"${RUST_DEP_PREV}"
- =dev-lang/rust-"${RUST_DEP_CURR}"
- =dev-lang/rust-bin-"${RUST_DEP_CURR}"
- )
-"
-
BDEPEND="${PYTHON_DEPS}
app-eselect/eselect-rust
|| (
>=sys-devel/gcc-4.7
>=sys-devel/clang-3.5
)
- system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
!system-llvm? (
>=dev-build/cmake-3.13.4
app-alternatives/ninja
@@ -163,32 +146,8 @@ toml_usex() {
usex "${1}" true false
}
-bootstrap_rust_version_check() {
- # never call from pkg_pretend. eselect-rust may be not installed yet.
- [[ ${MERGE_TYPE} == binary ]] && return
- local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
- local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
- local rustc_version=( $(eselect --brief --root="${BROOT}" rust show 2>/dev/null) )
- rustc_version=${rustc_version[0]#rust-bin-}
- rustc_version=${rustc_version#rust-}
-
- [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
-
- if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
- eerror "Rust >=${rustc_wanted} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too old"
- elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
- eerror "Rust <${rustc_toonew} is required"
- eerror "please run 'eselect rust' and set correct rust version"
- die "selected rust version is too new"
- else
- einfo "Using rust ${rustc_version} to build"
- fi
-}
-
pre_build_checks() {
- local M=8192
+ local M=9216
# multiply requirements by 1.3 if we are doing x86-multilib
if use amd64; then
M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 ))
@@ -211,7 +170,6 @@ pre_build_checks() {
M=$(( 15 * ${M} / 10 ))
fi
eshopts_pop
- M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
M=$(( $(usex doc 256 0) + ${M} ))
CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
}
@@ -246,14 +204,13 @@ pkg_setup() {
export OPENSSL_INCLUDE_DIR="${ROOT}/usr/include"
export OPENSSL_LIB_DIR="${ROOT}/usr/$(get_libdir)"
- use system-bootstrap || die "USE=system-bootstrap is required when cross-compiling"
use system-llvm && die "USE=system-llvm not allowed when cross-compiling"
local cross_llvm_target="$(llvm_tuple_to_target "${CBUILD}")"
use "llvm_targets_${cross_llvm_target}" || \
die "Must enable LLVM_TARGETS=${cross_llvm_target} matching CBUILD=${CBUILD} when cross-compiling"
fi
- use system-bootstrap && bootstrap_rust_version_check
+ rust_pkg_setup
if use system-llvm; then
llvm-r1_pkg_setup
@@ -264,33 +221,7 @@ pkg_setup() {
fi
}
-esetup_unwind_hack() {
- # https://bugs.gentoo.org/870280
- # this is a hack needed to bootstrap with libgcc_s linked tarball on llvm-libunwind system.
- # it should trigger for internal bootstrap or system-bootstrap with rust-bin.
- # the whole idea is for stage0 to bootstrap with fake libgcc_s.
- # final stage will receive -L${T}/lib but not -lgcc_s args, producing clean compiler.
- local fakelib="${T}/fakelib"
- mkdir -p "${fakelib}" || die
- # we need both symlinks, one for cargo runtime, other for linker.
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || die
- ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die
- export LD_LIBRARY_PATH="${fakelib}"
- export RUSTFLAGS+=" -L${fakelib}"
- # this is a literally magic variable that gets through cargo cache, without it some
- # crates ignore RUSTFLAGS.
- # this variable can not contain leading space.
- export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}"
-}
-
src_prepare() {
- # Clear vendor checksums for crates that we patched to bump libc.
- # NOTE: refresh this on each bump.
- #for i in addr2line-0.20.0 bstr cranelift-jit crossbeam-channel elasticlunr-rs handlebars icu_locid libffi \
- # terminal_size tracing-tree; do
- # clear_vendor_checksums "${i}"
- #done
-
# Rust baselines to Pentium4 on x86, this patch lowers the baseline to i586 when sse2 is not set.
if use x86; then
if ! use cpu_flags_x86_sse2; then
@@ -299,15 +230,6 @@ src_prepare() {
fi
fi
- if ! use system-bootstrap; then
- has_version sys-devel/gcc || esetup_unwind_hack
- local rust_stage0_root="${WORKDIR}"/rust-stage0
- local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi "${CBUILD}")"
-
- "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
- --without=rust-docs-json-preview,rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
- fi
-
default
}
@@ -338,14 +260,7 @@ src_configure() {
use rust-analyzer && tools+=',"rust-analyzer","rust-analyzer-proc-macro-srv"'
use rust-src && tools+=',"src"'
- local rust_stage0_root
- if use system-bootstrap; then
- local printsysroot
- printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
- rust_stage0_root="${printsysroot}"
- else
- rust_stage0_root="${WORKDIR}"/rust-stage0
- fi
+ local rust_stage0_root="$(${RUSTC} --print sysroot || die "Can't determine rust's sysroot")"
# in case of prefix it will be already prefixed, as --print sysroot returns full path
[[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
@@ -757,8 +672,8 @@ pkg_postinst() {
eselect rust update
if has_version dev-debug/gdb || has_version dev-debug/lldb; then
- elog "Rust installs a helper script for calling GDB and LLDB,"
- elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
+ elog "Rust installs helper scripts for calling GDB and LLDB,"
+ elog "for convenience they are installed under /usr/bin/rust-{gdb,lldb}-${PV}."
fi
if has_version app-editors/emacs; then