|
| 1 | +From 601d24810e89efd42f7cd69d4a7ccecd4e35364d Mon Sep 17 00:00:00 2001 |
| 2 | +From: Eric Huss < [email protected]> |
| 3 | +Date: Tue, 22 Jun 2021 22:10:25 -0700 |
| 4 | +Subject: [PATCH 1/2] Don't dist miri on stable or beta. |
| 5 | + |
| 6 | +--- |
| 7 | + src/bootstrap/dist.rs | 3 +++ |
| 8 | + 1 file changed, 3 insertions(+) |
| 9 | + |
| 10 | +diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs |
| 11 | +index 71ed0af4a7c04..e0c33f7357741 100644 |
| 12 | +--- a/src/bootstrap/dist.rs |
| 13 | ++++ b/src/bootstrap/dist.rs |
| 14 | +@@ -1171,6 +1171,9 @@ impl Step for Miri { |
| 15 | + } |
| 16 | + |
| 17 | + fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> { |
| 18 | ++ if !builder.build.unstable_features() { |
| 19 | ++ return None; |
| 20 | ++ } |
| 21 | + let compiler = self.compiler; |
| 22 | + let target = self.target; |
| 23 | + assert!(builder.config.extended); |
| 24 | + |
| 25 | +From 6aa79a34d87252deaae11e75663e5740a22f14ea Mon Sep 17 00:00:00 2001 |
| 26 | +From: Eric Huss < [email protected]> |
| 27 | +Date: Wed, 23 Jun 2021 07:03:42 -0700 |
| 28 | +Subject: [PATCH 2/2] Comment and include rust-analyzer. |
| 29 | + |
| 30 | +--- |
| 31 | + src/bootstrap/dist.rs | 9 +++++++++ |
| 32 | + 1 file changed, 9 insertions(+) |
| 33 | + |
| 34 | +diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs |
| 35 | +index e0c33f7357741..19895baf08f16 100644 |
| 36 | +--- a/src/bootstrap/dist.rs |
| 37 | ++++ b/src/bootstrap/dist.rs |
| 38 | +@@ -1072,6 +1072,12 @@ impl Step for RustAnalyzer { |
| 39 | + } |
| 40 | + |
| 41 | + fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> { |
| 42 | ++ // This prevents rust-analyzer from being built for "dist" or "install" |
| 43 | ++ // on the stable/beta channels. It is a nightly-only tool and should |
| 44 | ++ // not be included. |
| 45 | ++ if !builder.build.unstable_features() { |
| 46 | ++ return None; |
| 47 | ++ } |
| 48 | + let compiler = self.compiler; |
| 49 | + let target = self.target; |
| 50 | + assert!(builder.config.extended); |
| 51 | +@@ -1171,6 +1177,9 @@ impl Step for Miri { |
| 52 | + } |
| 53 | + |
| 54 | + fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> { |
| 55 | ++ // This prevents miri from being built for "dist" or "install" |
| 56 | ++ // on the stable/beta channels. It is a nightly-only tool and should |
| 57 | ++ // not be included. |
| 58 | + if !builder.build.unstable_features() { |
| 59 | + return None; |
| 60 | + } |
| 61 | +From f698cacc33f0c9148bb3bb7501087b0d37e837ec Mon Sep 17 00:00:00 2001 |
| 62 | +From: Eric Huss < [email protected]> |
| 63 | +Date: Fri, 9 Jul 2021 10:01:23 -0700 |
| 64 | +Subject: [PATCH 1/3] Fix rust-analyzer install when not available. |
| 65 | + |
| 66 | +--- |
| 67 | + src/bootstrap/install.rs | 13 +++++++++---- |
| 68 | + 1 file changed, 9 insertions(+), 4 deletions(-) |
| 69 | + |
| 70 | +diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs |
| 71 | +index 13ee909afd5e4..6f3054538a898 100644 |
| 72 | +--- a/src/bootstrap/install.rs |
| 73 | ++++ b/src/bootstrap/install.rs |
| 74 | +@@ -165,10 +165,15 @@ install!((self, builder, _config), |
| 75 | + } |
| 76 | + }; |
| 77 | + RustAnalyzer, "rust-analyzer", Self::should_build(_config), only_hosts: true, { |
| 78 | +- let tarball = builder |
| 79 | +- .ensure(dist::RustAnalyzer { compiler: self.compiler, target: self.target }) |
| 80 | +- .expect("missing rust-analyzer"); |
| 81 | +- install_sh(builder, "rust-analyzer", self.compiler.stage, Some(self.target), &tarball); |
| 82 | ++ if let Some(tarball) = |
| 83 | ++ builder.ensure(dist::RustAnalyzer { compiler: self.compiler, target: self.target }) |
| 84 | ++ { |
| 85 | ++ install_sh(builder, "rust-analyzer", self.compiler.stage, Some(self.target), &tarball); |
| 86 | ++ } else { |
| 87 | ++ builder.info( |
| 88 | ++ &format!("skipping Install rust-analyzer stage{} ({})", self.compiler.stage, self.target), |
| 89 | ++ ); |
| 90 | ++ } |
| 91 | + }; |
| 92 | + Clippy, "clippy", Self::should_build(_config), only_hosts: true, { |
| 93 | + let tarball = builder.ensure(dist::Clippy { compiler: self.compiler, target: self.target }); |
| 94 | + |
| 95 | +From 60ff731110815349dbc052c36e9cc50b9f12f32a Mon Sep 17 00:00:00 2001 |
| 96 | +From: Eric Huss < [email protected]> |
| 97 | +Date: Sun, 11 Jul 2021 09:01:31 -0700 |
| 98 | +Subject: [PATCH 2/3] Add comments why install steps should never fail. |
| 99 | + |
| 100 | +--- |
| 101 | + src/bootstrap/install.rs | 6 ++++++ |
| 102 | + 1 file changed, 6 insertions(+) |
| 103 | + |
| 104 | +diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs |
| 105 | +index 6f3054538a898..2ac9d3dda206f 100644 |
| 106 | +--- a/src/bootstrap/install.rs |
| 107 | ++++ b/src/bootstrap/install.rs |
| 108 | +@@ -139,11 +139,15 @@ macro_rules! install { |
| 109 | + |
| 110 | + install!((self, builder, _config), |
| 111 | + Docs, "src/doc", _config.docs, only_hosts: false, { |
| 112 | ++ // `expect` should be safe, only None when config.docs is false, |
| 113 | ++ // which is guarded in `should_run` |
| 114 | + let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs"); |
| 115 | + install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball); |
| 116 | + }; |
| 117 | + Std, "library/std", true, only_hosts: false, { |
| 118 | + for target in &builder.targets { |
| 119 | ++ // `expect` should be safe, only None when host != build, but this |
| 120 | ++ // only runs when host == build |
| 121 | + let tarball = builder.ensure(dist::Std { |
| 122 | + compiler: self.compiler, |
| 123 | + target: *target |
| 124 | +@@ -217,6 +221,8 @@ install!((self, builder, _config), |
| 125 | + } |
| 126 | + }; |
| 127 | + Analysis, "analysis", Self::should_build(_config), only_hosts: false, { |
| 128 | ++ // `expect` should be safe, only None with host != build, but this |
| 129 | ++ // only uses the `build` compiler |
| 130 | + let tarball = builder.ensure(dist::Analysis { |
| 131 | + // Find the actual compiler (handling the full bootstrap option) which |
| 132 | + // produced the save-analysis data because that data isn't copied |
| 133 | + |
| 134 | +From 166c147c2727cd6d6ad4d39c40c51273b8a63c96 Mon Sep 17 00:00:00 2001 |
| 135 | +From: Eric Huss < [email protected]> |
| 136 | +Date: Mon, 12 Jul 2021 13:29:47 -0700 |
| 137 | +Subject: [PATCH 3/3] Provide a better error when `x.py install src/doc` |
| 138 | + doesn't work. |
| 139 | + |
| 140 | +--- |
| 141 | + src/bootstrap/install.rs | 10 ++++++---- |
| 142 | + 1 file changed, 6 insertions(+), 4 deletions(-) |
| 143 | + |
| 144 | +diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs |
| 145 | +index 2ac9d3dda206f..8a1b6df0dafe3 100644 |
| 146 | +--- a/src/bootstrap/install.rs |
| 147 | ++++ b/src/bootstrap/install.rs |
| 148 | +@@ -139,10 +139,12 @@ macro_rules! install { |
| 149 | + |
| 150 | + install!((self, builder, _config), |
| 151 | + Docs, "src/doc", _config.docs, only_hosts: false, { |
| 152 | +- // `expect` should be safe, only None when config.docs is false, |
| 153 | +- // which is guarded in `should_run` |
| 154 | +- let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs"); |
| 155 | +- install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball); |
| 156 | ++ if let Some(tarball) = builder.ensure(dist::Docs { host: self.target }) { |
| 157 | ++ install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball); |
| 158 | ++ } else { |
| 159 | ++ panic!("docs are not available to install, \ |
| 160 | ++ check that `build.docs` is true in `config.toml`"); |
| 161 | ++ } |
| 162 | + }; |
| 163 | + Std, "library/std", true, only_hosts: false, { |
| 164 | + for target in &builder.targets { |
0 commit comments