From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 78162138359 for ; Tue, 4 Aug 2020 23:44:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 87E06E07C5; Tue, 4 Aug 2020 23:44:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E523CE07C5 for ; Tue, 4 Aug 2020 23:44:47 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6C97534F016 for ; Tue, 4 Aug 2020 23:44:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DB4832AE for ; Tue, 4 Aug 2020 23:44:44 +0000 (UTC) From: "Georgy Yakovlev" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Georgy Yakovlev" Message-ID: <1596584591.ef89cb77bf9fc16eec9e140e29138adb8d74258a.gyakovlev@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/rust/rust-1.45.2.ebuild X-VCS-Directories: dev-lang/rust/ X-VCS-Committer: gyakovlev X-VCS-Committer-Name: Georgy Yakovlev X-VCS-Revision: ef89cb77bf9fc16eec9e140e29138adb8d74258a X-VCS-Branch: master Date: Tue, 4 Aug 2020 23:44:44 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 20d9faec-56bf-4549-9982-f4da2f7ebdfa X-Archives-Hash: 379a485ca9649e9b960c4637d1500678 commit: ef89cb77bf9fc16eec9e140e29138adb8d74258a Author: Georgy Yakovlev gentoo org> AuthorDate: Tue Aug 4 23:39:45 2020 +0000 Commit: Georgy Yakovlev gentoo org> CommitDate: Tue Aug 4 23:43:11 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef89cb77 dev-lang/rust: improve pre-build checks in 1.45.2 Bug: https://bugs.gentoo.org/709362 Bug: https://bugs.gentoo.org/706292 Package-Manager: Portage-3.0.1, Repoman-2.3.23 Signed-off-by: Georgy Yakovlev gentoo.org> dev-lang/rust/rust-1.45.2.ebuild | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/dev-lang/rust/rust-1.45.2.ebuild b/dev-lang/rust/rust-1.45.2.ebuild index f0ade3a593c..60b307bbd5f 100644 --- a/dev-lang/rust/rust-1.45.2.ebuild +++ b/dev-lang/rust/rust-1.45.2.ebuild @@ -129,14 +129,41 @@ toml_usex() { usex "$1" true false } +boostrap_rust_version_check() { + # never call from pkg_pretend. eselect-rust may be not installed yet. + local rustc_wanted="$(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 rustc version!" + + 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 + else + einfo "Using rust ${rustc_version} to build" + fi +} + pre_build_checks() { - CHECKREQS_DISK_BUILD="9G" + local M=6144 + M=$(( $(usex clippy 128 0) + ${M} )) + M=$(( $(usex miri 128 0) + ${M} )) + M=$(( $(usex rls 512 0) + ${M} )) + M=$(( $(usex rustfmt 256 0) + ${M} )) + M=$(( $(usex system-llvm 0 2048) + ${M} )) + M=$(( $(usex wasm 256 0) + ${M} )) + M=$(( $(usex debug 15 10) * ${M} / 10 )) eshopts_push -s extglob if is-flagq '-g?(gdb)?([1-9])'; then - CHECKREQS_DISK_BUILD="15G" + M=$(( 15 * ${M} / 10 )) fi eshopts_pop - check-reqs_pkg_setup + M=$(( $(usex system-bootstrap 0 1024) + ${M} )) + M=$(( $(usex doc 256 0) + ${M} )) + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE} } pkg_pretend() { @@ -146,6 +173,7 @@ pkg_pretend() { pkg_setup() { pre_build_checks python-any-r1_pkg_setup + use system-bootstrap && boostrap_rust_version_check # required to link agains system libs, otherwise # crates use bundled sources and compile own static version