1 |
commit: f5f3024c3ef7506c3b3a496dc725f5e38ce5d626 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed May 5 15:19:21 2021 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed May 5 20:15:44 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f5f3024c |
7 |
|
8 |
dev-lang/rust: greatly reduce documentation installation time |
9 |
|
10 |
Bug: https://bugs.gentoo.org/783468 |
11 |
X-Upstream-Issue: https://github.com/rust-lang/rust/issues/80684 |
12 |
X-Upstream-Fix: https://github.com/rust-lang/rust/pull/84289 |
13 |
Package-Manager: Portage-3.0.18, Repoman-3.0.3 |
14 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
15 |
|
16 |
dev-lang/rust/files/1.51.0-slow-doc-install.patch | 92 +++++++++++++++++++++++ |
17 |
dev-lang/rust/rust-1.51.0-r2.ebuild | 1 + |
18 |
2 files changed, 93 insertions(+) |
19 |
|
20 |
diff --git a/dev-lang/rust/files/1.51.0-slow-doc-install.patch b/dev-lang/rust/files/1.51.0-slow-doc-install.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..4aa7a714795 |
23 |
--- /dev/null |
24 |
+++ b/dev-lang/rust/files/1.51.0-slow-doc-install.patch |
25 |
@@ -0,0 +1,92 @@ |
26 |
+From 6dfd700c595a8853fd58349c38c4768b922a2e85 Mon Sep 17 00:00:00 2001 |
27 |
+From: Anders Kaseorg <andersk@×××.edu> |
28 |
+Date: Sat, 17 Apr 2021 22:20:36 -0700 |
29 |
+Subject: [PATCH] bootstrap: Restore missing --bulk-dirs for rust-docs, |
30 |
+ rustc-docs |
31 |
+ |
32 |
+The --bulk-dirs argument was removed for rust-docs in commit |
33 |
+c768ce138427b1844c1f6594daba9c0e33928032 and rustc-docs in commit |
34 |
+8ca46fc7a83734c9622f11f25d16b82316f44bcc (#79788), presumably by |
35 |
+mistake; that slowed down installation of rust-docs from under a |
36 |
+second to some twenty *minutes*. Restoring --bulk-dirs reverses this |
37 |
+slowdown. |
38 |
+ |
39 |
+Fixes #80684. |
40 |
+ |
41 |
+Signed-off-by: Anders Kaseorg <andersk@×××.edu> |
42 |
+--- |
43 |
+ src/bootstrap/dist.rs | 4 ++-- |
44 |
+ src/bootstrap/tarball.rs | 17 +++++++++++++++++ |
45 |
+ 2 files changed, 19 insertions(+), 2 deletions(-) |
46 |
+ |
47 |
+diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs |
48 |
+index 38ebe0e52083d..aee3c8324bc11 100644 |
49 |
+--- a/src/bootstrap/dist.rs |
50 |
++++ b/src/bootstrap/dist.rs |
51 |
+@@ -74,7 +74,7 @@ impl Step for Docs { |
52 |
+ |
53 |
+ let mut tarball = Tarball::new(builder, "rust-docs", &host.triple); |
54 |
+ tarball.set_product_name("Rust Documentation"); |
55 |
+- tarball.add_dir(&builder.doc_out(host), dest); |
56 |
++ tarball.add_bulk_dir(&builder.doc_out(host), dest); |
57 |
+ tarball.add_file(&builder.src.join("src/doc/robots.txt"), dest, 0o644); |
58 |
+ Some(tarball.generate()) |
59 |
+ } |
60 |
+@@ -107,7 +107,7 @@ impl Step for RustcDocs { |
61 |
+ |
62 |
+ let mut tarball = Tarball::new(builder, "rustc-docs", &host.triple); |
63 |
+ tarball.set_product_name("Rustc Documentation"); |
64 |
+- tarball.add_dir(&builder.compiler_doc_out(host), "share/doc/rust/html/rustc"); |
65 |
++ tarball.add_bulk_dir(&builder.compiler_doc_out(host), "share/doc/rust/html/rustc"); |
66 |
+ Some(tarball.generate()) |
67 |
+ } |
68 |
+ } |
69 |
+diff --git a/src/bootstrap/tarball.rs b/src/bootstrap/tarball.rs |
70 |
+index b02d7e062a524..9ff5c2327e0f7 100644 |
71 |
+--- a/src/bootstrap/tarball.rs |
72 |
++++ b/src/bootstrap/tarball.rs |
73 |
+@@ -99,6 +99,7 @@ pub(crate) struct Tarball<'a> { |
74 |
+ temp_dir: PathBuf, |
75 |
+ image_dir: PathBuf, |
76 |
+ overlay_dir: PathBuf, |
77 |
++ bulk_dirs: Vec<PathBuf>, |
78 |
+ |
79 |
+ include_target_in_component_name: bool, |
80 |
+ is_preview: bool, |
81 |
+@@ -137,6 +138,7 @@ impl<'a> Tarball<'a> { |
82 |
+ temp_dir, |
83 |
+ image_dir, |
84 |
+ overlay_dir, |
85 |
++ bulk_dirs: Vec::new(), |
86 |
+ |
87 |
+ include_target_in_component_name: false, |
88 |
+ is_preview: false, |
89 |
+@@ -201,6 +203,11 @@ impl<'a> Tarball<'a> { |
90 |
+ self.builder.cp_r(src.as_ref(), &dest); |
91 |
+ } |
92 |
+ |
93 |
++ pub(crate) fn add_bulk_dir(&mut self, src: impl AsRef<Path>, dest: impl AsRef<Path>) { |
94 |
++ self.bulk_dirs.push(dest.as_ref().to_path_buf()); |
95 |
++ self.add_dir(src, dest); |
96 |
++ } |
97 |
++ |
98 |
+ pub(crate) fn generate(self) -> GeneratedTarball { |
99 |
+ let mut component_name = self.component.clone(); |
100 |
+ if self.is_preview { |
101 |
+@@ -221,6 +228,16 @@ impl<'a> Tarball<'a> { |
102 |
+ .arg("--image-dir") |
103 |
+ .arg(&this.image_dir) |
104 |
+ .arg(format!("--component-name={}", &component_name)); |
105 |
++ |
106 |
++ if let Some((dir, dirs)) = this.bulk_dirs.split_first() { |
107 |
++ let mut arg = dir.as_os_str().to_os_string(); |
108 |
++ for dir in dirs { |
109 |
++ arg.push(","); |
110 |
++ arg.push(dir); |
111 |
++ } |
112 |
++ cmd.arg("--bulk-dirs").arg(&arg); |
113 |
++ } |
114 |
++ |
115 |
+ this.non_bare_args(cmd); |
116 |
+ }) |
117 |
+ } |
118 |
|
119 |
diff --git a/dev-lang/rust/rust-1.51.0-r2.ebuild b/dev-lang/rust/rust-1.51.0-r2.ebuild |
120 |
index 28b670418ed..17e948f5841 100644 |
121 |
--- a/dev-lang/rust/rust-1.51.0-r2.ebuild |
122 |
+++ b/dev-lang/rust/rust-1.51.0-r2.ebuild |
123 |
@@ -147,6 +147,7 @@ PATCHES=( |
124 |
"${FILESDIR}"/1.47.0-ignore-broken-and-non-applicable-tests.patch |
125 |
"${FILESDIR}"/1.49.0-gentoo-musl-target-specs.patch |
126 |
"${FILESDIR}"/1.51.0-bootstrap-panic.patch |
127 |
+ "${FILESDIR}"/1.51.0-slow-doc-install.patch |
128 |
"${FILESDIR}"/rustc-1.51.0-backport-pr81728.patch |
129 |
"${FILESDIR}"/rustc-1.51.0-backport-pr81741.patch |
130 |
"${FILESDIR}"/rustc-1.51.0-backport-pr82289.patch |