1 |
commit: 48168cfc3dc5291587caf5e7cc6559ac40005132 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 18 05:25:24 2021 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 18 05:26:14 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48168cfc |
7 |
|
8 |
dev-lang/rust: add rustversion patch |
9 |
|
10 |
otherwise bootstrap may fail with nightly branded compiler |
11 |
|
12 |
Upstream-issue: https://github.com/dtolnay/rustversion/issues/28 |
13 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
14 |
|
15 |
dev-lang/rust/files/1.53.0-rustversion.patch | 80 ++++++++++++++++++++++++++++ |
16 |
dev-lang/rust/rust-1.53.0.ebuild | 1 + |
17 |
2 files changed, 81 insertions(+) |
18 |
|
19 |
diff --git a/dev-lang/rust/files/1.53.0-rustversion.patch b/dev-lang/rust/files/1.53.0-rustversion.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..a654d4ac7e6 |
22 |
--- /dev/null |
23 |
+++ b/dev-lang/rust/files/1.53.0-rustversion.patch |
24 |
@@ -0,0 +1,80 @@ |
25 |
+From b0b666350a91529caeb36e957e465eba3b6d7589 Mon Sep 17 00:00:00 2001 |
26 |
+From: David Tolnay <dtolnay@×××××.com> |
27 |
+Date: Fri, 14 May 2021 13:49:17 -0700 |
28 |
+Subject: [PATCH 1/2] Add regression test for issue 28 |
29 |
+ |
30 |
+--- |
31 |
+ tests/test_parse.rs | 8 ++++++++ |
32 |
+ 1 file changed, 8 insertions(+) |
33 |
+ |
34 |
+diff --git a/tests/test_parse.rs b/tests/test_parse.rs |
35 |
+index a5de1aa..cb39b31 100644 |
36 |
+--- a/vendor/rustversion/tests/test_parse.rs |
37 |
++++ b/vendor/rustversion/tests/test_parse.rs |
38 |
+@@ -76,6 +76,14 @@ fn test_parse() { |
39 |
+ }), |
40 |
+ }, |
41 |
+ ), |
42 |
++ ( |
43 |
++ "rustc 1.52.1-nightly (gentoo)", |
44 |
++ Version { |
45 |
++ minor: 52, |
46 |
++ patch: 1, |
47 |
++ channel: Dev, |
48 |
++ }, |
49 |
++ ), |
50 |
+ ]; |
51 |
+ |
52 |
+ for (string, expected) in cases { |
53 |
+ |
54 |
+From 2ee81bd2701915684137ae40415afa4b552af79e Mon Sep 17 00:00:00 2001 |
55 |
+From: David Tolnay <dtolnay@×××××.com> |
56 |
+Date: Fri, 14 May 2021 13:59:44 -0700 |
57 |
+Subject: [PATCH 2/2] Parse distro nightly without a date |
58 |
+ |
59 |
+--- |
60 |
+ build/rustc.rs | 30 ++++++++++++++---------------- |
61 |
+ 1 file changed, 14 insertions(+), 16 deletions(-) |
62 |
+ |
63 |
+diff --git a/build/rustc.rs b/build/rustc.rs |
64 |
+index 723e6bd..dfc6a05 100644 |
65 |
+--- a/vendor/rustversion/build/rustc.rs |
66 |
++++ b/vendor/rustversion/build/rustc.rs |
67 |
+@@ -48,23 +48,21 @@ pub fn parse(string: &str) -> Option<Version> { |
68 |
+ Some(channel) if channel == "dev" => Dev, |
69 |
+ Some(channel) if channel.starts_with("beta") => Beta, |
70 |
+ Some(channel) if channel == "nightly" => match words.next() { |
71 |
+- Some(hash) => { |
72 |
+- if !hash.starts_with('(') { |
73 |
+- return None; |
74 |
++ Some(hash) if hash.starts_with('(') => match words.next() { |
75 |
++ None if hash.ends_with(')') => Dev, |
76 |
++ Some(date) if date.ends_with(')') => { |
77 |
++ let mut date = date[..date.len() - 1].split('-'); |
78 |
++ let year = date.next()?.parse().ok()?; |
79 |
++ let month = date.next()?.parse().ok()?; |
80 |
++ let day = date.next()?.parse().ok()?; |
81 |
++ match date.next() { |
82 |
++ None => Nightly(Date { year, month, day }), |
83 |
++ Some(_) => return None, |
84 |
++ } |
85 |
+ } |
86 |
+- let date = words.next()?; |
87 |
+- if !date.ends_with(')') { |
88 |
+- return None; |
89 |
+- } |
90 |
+- let mut date = date[..date.len() - 1].split('-'); |
91 |
+- let year = date.next()?.parse().ok()?; |
92 |
+- let month = date.next()?.parse().ok()?; |
93 |
+- let day = date.next()?.parse().ok()?; |
94 |
+- match date.next() { |
95 |
+- None => Nightly(Date { year, month, day }), |
96 |
+- Some(_) => return None, |
97 |
+- } |
98 |
+- } |
99 |
++ None | Some(_) => return None, |
100 |
++ }, |
101 |
++ Some(_) => return None, |
102 |
+ None => Dev, |
103 |
+ }, |
104 |
+ Some(_) => return None, |
105 |
|
106 |
diff --git a/dev-lang/rust/rust-1.53.0.ebuild b/dev-lang/rust/rust-1.53.0.ebuild |
107 |
index 79a4b179f6b..07427b717a4 100644 |
108 |
--- a/dev-lang/rust/rust-1.53.0.ebuild |
109 |
+++ b/dev-lang/rust/rust-1.53.0.ebuild |
110 |
@@ -148,6 +148,7 @@ VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/rust.asc" |
111 |
PATCHES=( |
112 |
"${FILESDIR}"/1.47.0-ignore-broken-and-non-applicable-tests.patch |
113 |
"${FILESDIR}"/1.49.0-gentoo-musl-target-specs.patch |
114 |
+ "${FILESDIR}"/1.53.0-rustversion.patch #https://github.com/dtolnay/rustversion/issues/28 |
115 |
) |
116 |
|
117 |
S="${WORKDIR}/${MY_P}-src" |