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 977121382C5 for ; Fri, 18 Jun 2021 05:26:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D785DE0814; Fri, 18 Jun 2021 05:26:39 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 AE347E0814 for ; Fri, 18 Jun 2021 05:26:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 5441B335D6A for ; Fri, 18 Jun 2021 05:26:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id ABBCD78E for ; Fri, 18 Jun 2021 05:26:35 +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: <1623993974.48168cfc3dc5291587caf5e7cc6559ac40005132.gyakovlev@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/, dev-lang/rust/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/rust/files/1.53.0-rustversion.patch dev-lang/rust/rust-1.53.0.ebuild X-VCS-Directories: dev-lang/rust/ dev-lang/rust/files/ X-VCS-Committer: gyakovlev X-VCS-Committer-Name: Georgy Yakovlev X-VCS-Revision: 48168cfc3dc5291587caf5e7cc6559ac40005132 X-VCS-Branch: master Date: Fri, 18 Jun 2021 05:26:35 +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: 2c0929ff-f19e-416d-bb0e-cf5fd0549edd X-Archives-Hash: 51ecd188c69bdd388250ad3f365a7868 commit: 48168cfc3dc5291587caf5e7cc6559ac40005132 Author: Georgy Yakovlev gentoo org> AuthorDate: Fri Jun 18 05:25:24 2021 +0000 Commit: Georgy Yakovlev gentoo org> CommitDate: Fri Jun 18 05:26:14 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48168cfc dev-lang/rust: add rustversion patch otherwise bootstrap may fail with nightly branded compiler Upstream-issue: https://github.com/dtolnay/rustversion/issues/28 Signed-off-by: Georgy Yakovlev gentoo.org> dev-lang/rust/files/1.53.0-rustversion.patch | 80 ++++++++++++++++++++++++++++ dev-lang/rust/rust-1.53.0.ebuild | 1 + 2 files changed, 81 insertions(+) diff --git a/dev-lang/rust/files/1.53.0-rustversion.patch b/dev-lang/rust/files/1.53.0-rustversion.patch new file mode 100644 index 00000000000..a654d4ac7e6 --- /dev/null +++ b/dev-lang/rust/files/1.53.0-rustversion.patch @@ -0,0 +1,80 @@ +From b0b666350a91529caeb36e957e465eba3b6d7589 Mon Sep 17 00:00:00 2001 +From: David Tolnay +Date: Fri, 14 May 2021 13:49:17 -0700 +Subject: [PATCH 1/2] Add regression test for issue 28 + +--- + tests/test_parse.rs | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/tests/test_parse.rs b/tests/test_parse.rs +index a5de1aa..cb39b31 100644 +--- a/vendor/rustversion/tests/test_parse.rs ++++ b/vendor/rustversion/tests/test_parse.rs +@@ -76,6 +76,14 @@ fn test_parse() { + }), + }, + ), ++ ( ++ "rustc 1.52.1-nightly (gentoo)", ++ Version { ++ minor: 52, ++ patch: 1, ++ channel: Dev, ++ }, ++ ), + ]; + + for (string, expected) in cases { + +From 2ee81bd2701915684137ae40415afa4b552af79e Mon Sep 17 00:00:00 2001 +From: David Tolnay +Date: Fri, 14 May 2021 13:59:44 -0700 +Subject: [PATCH 2/2] Parse distro nightly without a date + +--- + build/rustc.rs | 30 ++++++++++++++---------------- + 1 file changed, 14 insertions(+), 16 deletions(-) + +diff --git a/build/rustc.rs b/build/rustc.rs +index 723e6bd..dfc6a05 100644 +--- a/vendor/rustversion/build/rustc.rs ++++ b/vendor/rustversion/build/rustc.rs +@@ -48,23 +48,21 @@ pub fn parse(string: &str) -> Option { + Some(channel) if channel == "dev" => Dev, + Some(channel) if channel.starts_with("beta") => Beta, + Some(channel) if channel == "nightly" => match words.next() { +- Some(hash) => { +- if !hash.starts_with('(') { +- return None; ++ Some(hash) if hash.starts_with('(') => match words.next() { ++ None if hash.ends_with(')') => Dev, ++ Some(date) if date.ends_with(')') => { ++ let mut date = date[..date.len() - 1].split('-'); ++ let year = date.next()?.parse().ok()?; ++ let month = date.next()?.parse().ok()?; ++ let day = date.next()?.parse().ok()?; ++ match date.next() { ++ None => Nightly(Date { year, month, day }), ++ Some(_) => return None, ++ } + } +- let date = words.next()?; +- if !date.ends_with(')') { +- return None; +- } +- let mut date = date[..date.len() - 1].split('-'); +- let year = date.next()?.parse().ok()?; +- let month = date.next()?.parse().ok()?; +- let day = date.next()?.parse().ok()?; +- match date.next() { +- None => Nightly(Date { year, month, day }), +- Some(_) => return None, +- } +- } ++ None | Some(_) => return None, ++ }, ++ Some(_) => return None, + None => Dev, + }, + Some(_) => return None, diff --git a/dev-lang/rust/rust-1.53.0.ebuild b/dev-lang/rust/rust-1.53.0.ebuild index 79a4b179f6b..07427b717a4 100644 --- a/dev-lang/rust/rust-1.53.0.ebuild +++ b/dev-lang/rust/rust-1.53.0.ebuild @@ -148,6 +148,7 @@ VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/rust.asc" PATCHES=( "${FILESDIR}"/1.47.0-ignore-broken-and-non-applicable-tests.patch "${FILESDIR}"/1.49.0-gentoo-musl-target-specs.patch + "${FILESDIR}"/1.53.0-rustversion.patch #https://github.com/dtolnay/rustversion/issues/28 ) S="${WORKDIR}/${MY_P}-src"