From: Jan Palus Date: Wed, 14 Jul 2021 19:53:02 +0000 (+0200) Subject: backport fixes to disable miri and analyzer; rel 2 X-Git-Tag: auto/th/rust-1.53.0-2 X-Git-Url: http://git.pld-linux.org/?p=packages%2Frust.git;a=commitdiff_plain;h=b87115619ccad14cadc87081019c98b17fa0b645 backport fixes to disable miri and analyzer; rel 2 miri fails if there's no git repository anywhere in directory tree however miri and rust-analyzer were not supposed to be built on stable channel in the first place: https://github.com/rust-lang/rust/pull/86568 https://github.com/rust-lang/rust/pull/87007 --- diff --git a/disable_miri.patch b/disable_miri.patch new file mode 100644 index 0000000..73eec74 --- /dev/null +++ b/disable_miri.patch @@ -0,0 +1,164 @@ +From 601d24810e89efd42f7cd69d4a7ccecd4e35364d Mon Sep 17 00:00:00 2001 +From: Eric Huss +Date: Tue, 22 Jun 2021 22:10:25 -0700 +Subject: [PATCH 1/2] Don't dist miri on stable or beta. + +--- + src/bootstrap/dist.rs | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs +index 71ed0af4a7c04..e0c33f7357741 100644 +--- a/src/bootstrap/dist.rs ++++ b/src/bootstrap/dist.rs +@@ -1171,6 +1171,9 @@ impl Step for Miri { + } + + fn run(self, builder: &Builder<'_>) -> Option { ++ if !builder.build.unstable_features() { ++ return None; ++ } + let compiler = self.compiler; + let target = self.target; + assert!(builder.config.extended); + +From 6aa79a34d87252deaae11e75663e5740a22f14ea Mon Sep 17 00:00:00 2001 +From: Eric Huss +Date: Wed, 23 Jun 2021 07:03:42 -0700 +Subject: [PATCH 2/2] Comment and include rust-analyzer. + +--- + src/bootstrap/dist.rs | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs +index e0c33f7357741..19895baf08f16 100644 +--- a/src/bootstrap/dist.rs ++++ b/src/bootstrap/dist.rs +@@ -1072,6 +1072,12 @@ impl Step for RustAnalyzer { + } + + fn run(self, builder: &Builder<'_>) -> Option { ++ // This prevents rust-analyzer from being built for "dist" or "install" ++ // on the stable/beta channels. It is a nightly-only tool and should ++ // not be included. ++ if !builder.build.unstable_features() { ++ return None; ++ } + let compiler = self.compiler; + let target = self.target; + assert!(builder.config.extended); +@@ -1171,6 +1177,9 @@ impl Step for Miri { + } + + fn run(self, builder: &Builder<'_>) -> Option { ++ // This prevents miri from being built for "dist" or "install" ++ // on the stable/beta channels. It is a nightly-only tool and should ++ // not be included. + if !builder.build.unstable_features() { + return None; + } +From f698cacc33f0c9148bb3bb7501087b0d37e837ec Mon Sep 17 00:00:00 2001 +From: Eric Huss +Date: Fri, 9 Jul 2021 10:01:23 -0700 +Subject: [PATCH 1/3] Fix rust-analyzer install when not available. + +--- + src/bootstrap/install.rs | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs +index 13ee909afd5e4..6f3054538a898 100644 +--- a/src/bootstrap/install.rs ++++ b/src/bootstrap/install.rs +@@ -165,10 +165,15 @@ install!((self, builder, _config), + } + }; + RustAnalyzer, "rust-analyzer", Self::should_build(_config), only_hosts: true, { +- let tarball = builder +- .ensure(dist::RustAnalyzer { compiler: self.compiler, target: self.target }) +- .expect("missing rust-analyzer"); +- install_sh(builder, "rust-analyzer", self.compiler.stage, Some(self.target), &tarball); ++ if let Some(tarball) = ++ builder.ensure(dist::RustAnalyzer { compiler: self.compiler, target: self.target }) ++ { ++ install_sh(builder, "rust-analyzer", self.compiler.stage, Some(self.target), &tarball); ++ } else { ++ builder.info( ++ &format!("skipping Install rust-analyzer stage{} ({})", self.compiler.stage, self.target), ++ ); ++ } + }; + Clippy, "clippy", Self::should_build(_config), only_hosts: true, { + let tarball = builder.ensure(dist::Clippy { compiler: self.compiler, target: self.target }); + +From 60ff731110815349dbc052c36e9cc50b9f12f32a Mon Sep 17 00:00:00 2001 +From: Eric Huss +Date: Sun, 11 Jul 2021 09:01:31 -0700 +Subject: [PATCH 2/3] Add comments why install steps should never fail. + +--- + src/bootstrap/install.rs | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs +index 6f3054538a898..2ac9d3dda206f 100644 +--- a/src/bootstrap/install.rs ++++ b/src/bootstrap/install.rs +@@ -139,11 +139,15 @@ macro_rules! install { + + install!((self, builder, _config), + Docs, "src/doc", _config.docs, only_hosts: false, { ++ // `expect` should be safe, only None when config.docs is false, ++ // which is guarded in `should_run` + let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs"); + install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball); + }; + Std, "library/std", true, only_hosts: false, { + for target in &builder.targets { ++ // `expect` should be safe, only None when host != build, but this ++ // only runs when host == build + let tarball = builder.ensure(dist::Std { + compiler: self.compiler, + target: *target +@@ -217,6 +221,8 @@ install!((self, builder, _config), + } + }; + Analysis, "analysis", Self::should_build(_config), only_hosts: false, { ++ // `expect` should be safe, only None with host != build, but this ++ // only uses the `build` compiler + let tarball = builder.ensure(dist::Analysis { + // Find the actual compiler (handling the full bootstrap option) which + // produced the save-analysis data because that data isn't copied + +From 166c147c2727cd6d6ad4d39c40c51273b8a63c96 Mon Sep 17 00:00:00 2001 +From: Eric Huss +Date: Mon, 12 Jul 2021 13:29:47 -0700 +Subject: [PATCH 3/3] Provide a better error when `x.py install src/doc` + doesn't work. + +--- + src/bootstrap/install.rs | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs +index 2ac9d3dda206f..8a1b6df0dafe3 100644 +--- a/src/bootstrap/install.rs ++++ b/src/bootstrap/install.rs +@@ -139,10 +139,12 @@ macro_rules! install { + + install!((self, builder, _config), + Docs, "src/doc", _config.docs, only_hosts: false, { +- // `expect` should be safe, only None when config.docs is false, +- // which is guarded in `should_run` +- let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs"); +- install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball); ++ if let Some(tarball) = builder.ensure(dist::Docs { host: self.target }) { ++ install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball); ++ } else { ++ panic!("docs are not available to install, \ ++ check that `build.docs` is true in `config.toml`"); ++ } + }; + Std, "library/std", true, only_hosts: false, { + for target in &builder.targets { diff --git a/rust.spec b/rust.spec index 30ee9b8..87ad97e 100644 --- a/rust.spec +++ b/rust.spec @@ -37,7 +37,7 @@ Summary: The Rust Programming Language Summary(pl.UTF-8): Język programowania Rust Name: rust Version: 1.53.0 -Release: 1 +Release: 2 # Licenses: (rust itself) and (bundled libraries) License: (Apache v2.0 or MIT) and (BSD and ISC and MIT) Group: Development/Languages @@ -53,6 +53,7 @@ Source4: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_ru # Source4-md5: e36ad0e20aef949b4335cf2599a136bb Source5: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-armv7-unknown-linux-gnueabihf.tar.xz # Source5-md5: 77d28773b9fa07979a075e5232b23ac7 +Patch0: disable_miri.patch URL: https://www.rust-lang.org/ # for src/compiler-rt BuildRequires: cmake >= 3.4.3 @@ -114,6 +115,7 @@ Requires: %{name}-std%{?_isa} = %{version}-%{release} %ifarch x32 Requires: %{name}-std(x86-64) = %{version}-%{release} %endif +Obsoletes: rust-analyzer < 1.53.0 # Only x86_64 and i686 are Tier 1 platforms at this time. # x32 is Tier 2, only rust-std is available (no rustc or cargo). # https://doc.rust-lang.org/nightly/rustc/platform-support.html @@ -210,18 +212,6 @@ Standard library for Rust. %description std -l pl.UTF-8 Standardowa biblioteka Rusta. -%package analyzer -Summary: Implementation of Language Server Protocol for Rust -Summary(pl.UTF-8): Implementacja Language Server Protocol dla Rusta -Group: Development/Tools -Requires: %{name} = %{version}-%{release} - -%description analyzer -Implementation of Language Server Protocol for Rust. - -%description analyzer -l pl.UTF-8 -Implementacja Language Server Protocol dla Rusta. - %package debugger-common Summary: Common debugger pretty printers for Rust Summary(pl.UTF-8): Narzędzia wypisujące struktury Rusa wspólne dla różnych debuggerów @@ -336,6 +326,7 @@ Dopełnianie parametrów polecenia cargo w powłoce Zsh. %prep %setup -q -n %{rustc_package} +%patch0 -p1 %if %{with bootstrap} %ifarch %{x8664} x32 @@ -476,7 +467,6 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) %doc COPYRIGHT LICENSE-APACHE LICENSE-MIT README.md library/backtrace/crates/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace -%attr(755,root,root) %{_bindir}/miri %attr(755,root,root) %{_bindir}/rustc %attr(755,root,root) %{_bindir}/rustdoc %attr(755,root,root) %{_bindir}/rustfmt @@ -498,10 +488,6 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{rustlibdir}/%{rust_triple}/lib/*.so %{rustlibdir}/%{rust_triple}/lib/*.rlib -%files analyzer -%defattr(644,root,root,755) -%attr(755,root,root) %{_bindir}/rust-analyzer - %files debugger-common %defattr(644,root,root,755) %dir %{_datadir}/%{name} @@ -534,7 +520,6 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/cargo %attr(755,root,root) %{_bindir}/cargo-clippy %attr(755,root,root) %{_bindir}/cargo-fmt -%attr(755,root,root) %{_bindir}/cargo-miri %attr(755,root,root) %{_bindir}/clippy-driver %attr(755,root,root) %{_libexecdir}/cargo-credential-1password %{_mandir}/man1/cargo*.1*