From 9560450cb09acd7c5e3eb10f7d834e0352dce5ed Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 30 Mar 2021 15:31:03 -0400 Subject: [PATCH] import rust-1.49.0-1.module+el8.4.0+9446+1a463e08 --- .gitignore | 2 +- .rust.metadata | 2 +- ...ust-pr57840-llvm7-debuginfo-variants.patch | 32 --- ...0123-ensure-llvm-is-in-the-link-path.patch | 210 --------------- ...-pr70163-prepare-for-llvm-10-upgrade.patch | 175 ------------- ...0591-ensure-llvm-is-in-the-link-path.patch | 40 --- ...pr71782-Use-a-non-existent-test-path.patch | 56 ---- ...tch => rustc-1.48.0-disable-libssh2.patch} | 20 +- SOURCES/rustc-1.48.0-no-default-pie.patch | 18 ++ SOURCES/rustc-1.49.0-disable-http2.patch | 66 +++++ SPECS/rust.spec | 245 +++++++++--------- 11 files changed, 223 insertions(+), 643 deletions(-) delete mode 100644 SOURCES/rust-pr57840-llvm7-debuginfo-variants.patch delete mode 100644 SOURCES/rust-pr70123-ensure-llvm-is-in-the-link-path.patch delete mode 100644 SOURCES/rust-pr70163-prepare-for-llvm-10-upgrade.patch delete mode 100644 SOURCES/rust-pr70591-ensure-llvm-is-in-the-link-path.patch delete mode 100644 SOURCES/rust-pr71782-Use-a-non-existent-test-path.patch rename SOURCES/{rustc-1.42.0-disable-libssh2.patch => rustc-1.48.0-disable-libssh2.patch} (57%) create mode 100644 SOURCES/rustc-1.48.0-no-default-pie.patch create mode 100644 SOURCES/rustc-1.49.0-disable-http2.patch diff --git a/.gitignore b/.gitignore index 3b56dc2..82539fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/rustc-1.43.1-src.tar.xz +SOURCES/rustc-1.49.0-src.tar.xz diff --git a/.rust.metadata b/.rust.metadata index b1bb850..c913e9e 100644 --- a/.rust.metadata +++ b/.rust.metadata @@ -1 +1 @@ -24243dbbeb70be8370fddc4a83e68a1ad228c4ed SOURCES/rustc-1.43.1-src.tar.xz +f6f4d4e41694935511097c3913d9f720d5e606f8 SOURCES/rustc-1.49.0-src.tar.xz diff --git a/SOURCES/rust-pr57840-llvm7-debuginfo-variants.patch b/SOURCES/rust-pr57840-llvm7-debuginfo-variants.patch deleted file mode 100644 index b1fd427..0000000 --- a/SOURCES/rust-pr57840-llvm7-debuginfo-variants.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit ab998a2eeb2bcdc69ce70c814af97f0d1302a404 (from d17f62d857c70508efbf60be41135880bcd2e062) -Merge: d17f62d857c7 9452a8dfa3ba -Author: Mazdak Farrokhzad -Date: Thu Jan 24 00:20:00 2019 +0100 - - Rollup merge of #57840 - tromey:fix-issue-57762, r=nikic - - Fix issue 57762 - - against a stock LLVM 7. LLVM 7 was released without a necessary fix - for a bug in the DWARF discriminant code. - - This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7. - - Closes #57762 - -diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs -index 6deedd0b5ea3..9f63038c3623 100644 ---- a/src/librustc_codegen_llvm/debuginfo/metadata.rs -+++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs -@@ -1164,7 +1164,10 @@ fn use_enum_fallback(cx: &CodegenCx) -> bool { - // On MSVC we have to use the fallback mode, because LLVM doesn't - // lower variant parts to PDB. - return cx.sess().target.target.options.is_like_msvc -- || llvm_util::get_major_version() < 7; -+ // LLVM version 7 did not release with an important bug fix; -+ // but the required patch is in the LLVM 8. Rust LLVM reports -+ // 8 as well. -+ || llvm_util::get_major_version() < 8; - } - - // FIXME(eddyb) maybe precompute this? Right now it's computed once diff --git a/SOURCES/rust-pr70123-ensure-llvm-is-in-the-link-path.patch b/SOURCES/rust-pr70123-ensure-llvm-is-in-the-link-path.patch deleted file mode 100644 index d076d35..0000000 --- a/SOURCES/rust-pr70123-ensure-llvm-is-in-the-link-path.patch +++ /dev/null @@ -1,210 +0,0 @@ -commit 9423c4f0dda638ec2a925140850b85e8d3e6d455 (from bee074f032970fd1b59650c04a70e75eeee9c63b) -Merge: bee074f03297 3a2a4429a288 -Author: Mazdak Farrokhzad -Date: Mon Mar 23 10:29:13 2020 +0100 - - Rollup merge of #70123 - cuviper:library-path, r=Mark-Simulacrum - - Ensure LLVM is in the link path for rustc tools - - The build script for `rustc_llvm` outputs LLVM information in `cargo:rustc-link-lib` and `cargo:rustc-link-search` so the compiler can be linked correctly. However, while the lib is carried along in metadata, the search paths are not. So when cargo is invoked again later for rustc _tools_, they'll also try to link with LLVM, but the necessary paths may be left out. - - Rustbuild can use the environment to set the LLVM link path for tools -- `LIB` for MSVC toolchains and `LIBRARY_PATH` for everyone else. - - Fixes #68714. - -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 602e4511ea58..dd519506d42a 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -11,7 +11,7 @@ use std::path::{Path, PathBuf}; - use std::process::Command; - use std::time::{Duration, Instant}; - --use build_helper::t; -+use build_helper::{output, t}; - - use crate::cache::{Cache, Interned, INTERNER}; - use crate::check; -@@ -23,7 +23,7 @@ use crate::install; - use crate::native; - use crate::test; - use crate::tool; --use crate::util::{self, add_lib_path, exe, libdir}; -+use crate::util::{self, add_dylib_path, add_link_lib_path, exe, libdir}; - use crate::{Build, DocTests, GitRepo, Mode}; - - pub use crate::Compiler; -@@ -660,7 +660,7 @@ impl<'a> Builder<'a> { - return; - } - -- add_lib_path(vec![self.rustc_libdir(compiler)], &mut cmd.command); -+ add_dylib_path(vec![self.rustc_libdir(compiler)], &mut cmd.command); - } - - /// Gets a path to the compiler specified. -@@ -698,6 +698,20 @@ impl<'a> Builder<'a> { - cmd - } - -+ /// Return the path to `llvm-config` for the target, if it exists. -+ /// -+ /// Note that this returns `None` if LLVM is disabled, or if we're in a -+ /// check build or dry-run, where there's no need to build all of LLVM. -+ fn llvm_config(&self, target: Interned) -> Option { -+ if self.config.llvm_enabled() && self.kind != Kind::Check && !self.config.dry_run { -+ let llvm_config = self.ensure(native::Llvm { target }); -+ if llvm_config.is_file() { -+ return Some(llvm_config); -+ } -+ } -+ None -+ } -+ - /// Prepares an invocation of `cargo` to be run. - /// - /// This will create a `Command` that represents a pending execution of -@@ -1034,6 +1048,17 @@ impl<'a> Builder<'a> { - .env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_libdir(compiler)); - } - -+ // Tools that use compiler libraries may inherit the `-lLLVM` link -+ // requirement, but the `-L` library path is not propagated across -+ // separate Cargo projects. We can add LLVM's library path to the -+ // platform-specific environment variable as a workaround. -+ if mode == Mode::ToolRustc { -+ if let Some(llvm_config) = self.llvm_config(target) { -+ let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir")); -+ add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cargo); -+ } -+ } -+ - if self.config.incremental { - cargo.env("CARGO_INCREMENTAL", "1"); - } else { -diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 65a00db33949..ad494b88b3af 100644 ---- a/src/bootstrap/compile.rs -+++ b/src/bootstrap/compile.rs -@@ -451,44 +451,6 @@ impl Step for Rustc { - false, - ); - -- // We used to build librustc_codegen_llvm as a separate step, -- // which produced a dylib that the compiler would dlopen() at runtime. -- // This meant that we only needed to make sure that libLLVM.so was -- // installed by the time we went to run a tool using it - since -- // librustc_codegen_llvm was effectively a standalone artifact, -- // other crates were completely oblivious to its dependency -- // on `libLLVM.so` during build time. -- // -- // However, librustc_codegen_llvm is now built as an ordinary -- // crate during the same step as the rest of the compiler crates. -- // This means that any crates depending on it will see the fact -- // that it uses `libLLVM.so` as a native library, and will -- // cause us to pass `-llibLLVM.so` to the linker when we link -- // a binary. -- // -- // For `rustc` itself, this works out fine. -- // During the `Assemble` step, we call `dist::maybe_install_llvm_dylib` -- // to copy libLLVM.so into the `stage` directory. We then link -- // the compiler binary, which will find `libLLVM.so` in the correct place. -- // -- // However, this is insufficient for tools that are build against stage0 -- // (e.g. stage1 rustdoc). Since `Assemble` for stage0 doesn't actually do anything, -- // we won't have `libLLVM.so` in the stage0 sysroot. In the past, this wasn't -- // a problem - we would copy the tool binary into its correct stage directory -- // (e.g. stage1 for a stage1 rustdoc built against a stage0 compiler). -- // Since libLLVM.so wasn't resolved until runtime, it was fine for it to -- // not exist while we were building it. -- // -- // To ensure that we can still build stage1 tools against a stage0 compiler, -- // we explicitly copy libLLVM.so into the stage0 sysroot when building -- // the stage0 compiler. This ensures that tools built against stage0 -- // will see libLLVM.so at build time, making the linker happy. -- if compiler.stage == 0 { -- builder.info(&format!("Installing libLLVM.so to stage 0 ({})", compiler.host)); -- let sysroot = builder.sysroot(compiler); -- dist::maybe_install_llvm_dylib(builder, compiler.host, &sysroot); -- } -- - builder.ensure(RustcLink { - compiler: builder.compiler(compiler.stage, builder.config.build), - target_compiler: compiler, -diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs -index 67e0ed5c5802..c8ccba467e50 100644 ---- a/src/bootstrap/tool.rs -+++ b/src/bootstrap/tool.rs -@@ -12,7 +12,7 @@ use crate::channel; - use crate::channel::GitInfo; - use crate::compile; - use crate::toolstate::ToolState; --use crate::util::{add_lib_path, exe, CiEnv}; -+use crate::util::{add_dylib_path, exe, CiEnv}; - use crate::Compiler; - use crate::Mode; - -@@ -388,7 +388,7 @@ pub struct ErrorIndex { - impl ErrorIndex { - pub fn command(builder: &Builder<'_>, compiler: Compiler) -> Command { - let mut cmd = Command::new(builder.ensure(ErrorIndex { compiler })); -- add_lib_path( -+ add_dylib_path( - vec![PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host))], - &mut cmd, - ); -@@ -689,7 +689,7 @@ impl<'a> Builder<'a> { - } - } - -- add_lib_path(lib_paths, &mut cmd); -+ add_dylib_path(lib_paths, &mut cmd); - cmd - } - } -diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs -index eac790fe504b..2bc6f1939d97 100644 ---- a/src/bootstrap/util.rs -+++ b/src/bootstrap/util.rs -@@ -40,7 +40,7 @@ pub fn libdir(target: &str) -> &'static str { - } - - /// Adds a list of lookup paths to `cmd`'s dynamic library lookup path. --pub fn add_lib_path(path: Vec, cmd: &mut Command) { -+pub fn add_dylib_path(path: Vec, cmd: &mut Command) { - let mut list = dylib_path(); - for path in path { - list.insert(0, path); -@@ -72,6 +72,31 @@ pub fn dylib_path() -> Vec { - env::split_paths(&var).collect() - } - -+/// Adds a list of lookup paths to `cmd`'s link library lookup path. -+pub fn add_link_lib_path(path: Vec, cmd: &mut Command) { -+ let mut list = link_lib_path(); -+ for path in path { -+ list.insert(0, path); -+ } -+ cmd.env(link_lib_path_var(), t!(env::join_paths(list))); -+} -+ -+/// Returns the environment variable which the link library lookup path -+/// resides in for this platform. -+fn link_lib_path_var() -> &'static str { -+ if cfg!(target_env = "msvc") { "LIB" } else { "LIBRARY_PATH" } -+} -+ -+/// Parses the `link_lib_path_var()` environment variable, returning a list of -+/// paths that are members of this lookup path. -+fn link_lib_path() -> Vec { -+ let var = match env::var_os(link_lib_path_var()) { -+ Some(v) => v, -+ None => return vec![], -+ }; -+ env::split_paths(&var).collect() -+} -+ - /// `push` all components to `buf`. On windows, append `.exe` to the last component. - pub fn push_exe_path(mut buf: PathBuf, components: &[&str]) -> PathBuf { - let (&file, components) = components.split_last().expect("at least one component required"); diff --git a/SOURCES/rust-pr70163-prepare-for-llvm-10-upgrade.patch b/SOURCES/rust-pr70163-prepare-for-llvm-10-upgrade.patch deleted file mode 100644 index 765c2e9..0000000 --- a/SOURCES/rust-pr70163-prepare-for-llvm-10-upgrade.patch +++ /dev/null @@ -1,175 +0,0 @@ -commit 374ab25585f0a817fe7bd6986737f12347b12d0b (from 1add455ec6f81045e7651c6225902823f5d4fbfa) -Merge: 1add455ec6f8 497f879b1e24 -Author: bors -Date: Tue Mar 24 12:42:54 2020 +0000 - - Auto merge of #70163 - nikic:llvm-10-preparation, r=cuviper - - Prepare for LLVM 10 upgrade - - This is #67759 minus the submodule update. - - * Fix two compatibility issues in the rustllvm wrapper. - * Update data layout strings in tests. - * Fix LLVM version comparison (this become a problem because the major version has two digits now). - - r? @cuviper - -diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs -index aa1d1b7c4241..b52fbe4666eb 100644 ---- a/src/bootstrap/test.rs -+++ b/src/bootstrap/test.rs -@@ -1141,6 +1141,8 @@ impl Step for Compiletest { - let llvm_config = builder.ensure(native::Llvm { target: builder.config.build }); - if !builder.config.dry_run { - let llvm_version = output(Command::new(&llvm_config).arg("--version")); -+ // Remove trailing newline from llvm-config output. -+ let llvm_version = llvm_version.trim_end(); - cmd.arg("--llvm-version").arg(llvm_version); - } - if !builder.is_rust_llvm(target) { -diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp -index 90d24d20737d..9e8614e3b6d3 100644 ---- a/src/rustllvm/PassWrapper.cpp -+++ b/src/rustllvm/PassWrapper.cpp -@@ -67,7 +67,11 @@ extern "C" void LLVMInitializePasses() { - } - - extern "C" void LLVMTimeTraceProfilerInitialize() { --#if LLVM_VERSION_GE(9, 0) -+#if LLVM_VERSION_GE(10, 0) -+ timeTraceProfilerInitialize( -+ /* TimeTraceGranularity */ 0, -+ /* ProcName */ "rustc"); -+#elif LLVM_VERSION_GE(9, 0) - timeTraceProfilerInitialize(); - #endif - } -diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp -index 25cfee3373dc..799adb418822 100644 ---- a/src/rustllvm/RustWrapper.cpp -+++ b/src/rustllvm/RustWrapper.cpp -@@ -1333,8 +1333,13 @@ extern "C" LLVMValueRef LLVMRustBuildMemSet(LLVMBuilderRef B, - LLVMValueRef Dst, unsigned DstAlign, - LLVMValueRef Val, - LLVMValueRef Size, bool IsVolatile) { -+#if LLVM_VERSION_GE(10, 0) -+ return wrap(unwrap(B)->CreateMemSet( -+ unwrap(Dst), unwrap(Val), unwrap(Size), MaybeAlign(DstAlign), IsVolatile)); -+#else - return wrap(unwrap(B)->CreateMemSet( - unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile)); -+#endif - } - - extern "C" LLVMValueRef -diff --git a/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json b/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json -index 8d028280a8da..00de3de05f07 100644 ---- a/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json -+++ b/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json -@@ -1,5 +1,5 @@ - { -- "data-layout": "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128", -+ "data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128", - "linker-flavor": "gcc", - "llvm-target": "i686-unknown-linux-gnu", - "target-endian": "little", -diff --git a/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json b/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json -index 48040ae3da0e..6d5e964ed4fe 100644 ---- a/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json -+++ b/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json -@@ -1,6 +1,6 @@ - { - "pre-link-args": {"gcc": ["-m64"]}, -- "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128", -+ "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", - "linker-flavor": "gcc", - "llvm-target": "x86_64-unknown-linux-gnu", - "target-endian": "little", -diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs -index 2a24a8c3c948..cb648db8830e 100644 ---- a/src/tools/compiletest/src/header.rs -+++ b/src/tools/compiletest/src/header.rs -@@ -191,6 +191,7 @@ impl EarlyProps { - return true; - } - if let Some(ref actual_version) = config.llvm_version { -+ let actual_version = version_to_int(actual_version); - if line.starts_with("min-llvm-version") { - let min_version = line - .trim_end() -@@ -199,7 +200,7 @@ impl EarlyProps { - .expect("Malformed llvm version directive"); - // Ignore if actual version is smaller the minimum required - // version -- &actual_version[..] < min_version -+ actual_version < version_to_int(min_version) - } else if line.starts_with("min-system-llvm-version") { - let min_version = line - .trim_end() -@@ -208,7 +209,7 @@ impl EarlyProps { - .expect("Malformed llvm version directive"); - // Ignore if using system LLVM and actual version - // is smaller the minimum required version -- config.system_llvm && &actual_version[..] < min_version -+ config.system_llvm && actual_version < version_to_int(min_version) - } else if line.starts_with("ignore-llvm-version") { - // Syntax is: "ignore-llvm-version [- ]" - let range_components = line -@@ -219,15 +220,15 @@ impl EarlyProps { - .take(3) // 3 or more = invalid, so take at most 3. - .collect::>(); - match range_components.len() { -- 1 => &actual_version[..] == range_components[0], -+ 1 => actual_version == version_to_int(range_components[0]), - 2 => { -- let v_min = range_components[0]; -- let v_max = range_components[1]; -+ let v_min = version_to_int(range_components[0]); -+ let v_max = version_to_int(range_components[1]); - if v_max < v_min { - panic!("Malformed LLVM version range: max < min") - } - // Ignore if version lies inside of range. -- &actual_version[..] >= v_min && &actual_version[..] <= v_max -+ actual_version >= v_min && actual_version <= v_max - } - _ => panic!("Malformed LLVM version directive"), - } -@@ -238,6 +239,20 @@ impl EarlyProps { - false - } - } -+ -+ fn version_to_int(version: &str) -> u32 { -+ let version_without_suffix = version.split('-').next().unwrap(); -+ let components: Vec = version_without_suffix -+ .split('.') -+ .map(|s| s.parse().expect("Malformed version component")) -+ .collect(); -+ match components.len() { -+ 1 => components[0] * 10000, -+ 2 => components[0] * 10000 + components[1] * 100, -+ 3 => components[0] * 10000 + components[1] * 100 + components[2], -+ _ => panic!("Malformed version"), -+ } -+ } - } - } - -diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs -index 6c478f7e29da..31d991e0c2f8 100644 ---- a/src/tools/compiletest/src/header/tests.rs -+++ b/src/tools/compiletest/src/header/tests.rs -@@ -122,9 +122,8 @@ fn llvm_version() { - config.llvm_version = Some("9.3.1-rust-1.43.0-dev".to_owned()); - assert!(!parse_rs(&config, "// min-llvm-version 9.2").ignore); - -- // FIXME. -- // config.llvm_version = Some("10.0.0-rust".to_owned()); -- // assert!(!parse_rs(&config, "// min-llvm-version 9.0").ignore); -+ config.llvm_version = Some("10.0.0-rust".to_owned()); -+ assert!(!parse_rs(&config, "// min-llvm-version 9.0").ignore); - } - - #[test] diff --git a/SOURCES/rust-pr70591-ensure-llvm-is-in-the-link-path.patch b/SOURCES/rust-pr70591-ensure-llvm-is-in-the-link-path.patch deleted file mode 100644 index 9f5722b..0000000 --- a/SOURCES/rust-pr70591-ensure-llvm-is-in-the-link-path.patch +++ /dev/null @@ -1,40 +0,0 @@ -commit 6067315d58ff3d49b305ae3c99810656856c8e21 -Author: Josh Stone -Date: Mon Mar 30 14:03:39 2020 -0700 - - Ensure LLVM is in the link path for "fulldeps" tests - - This is a follow-up to #70123, which added `llvm-config --libdir` to the - `LIBRARY_PATH` for rustc tools. We need the same for "run-make-fulldeps" - and "ui-fulldeps" tests which depend on compiler libraries, implicitly - needing to link to `-lLLVM` as well. - -diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs -index 5b946b05735d..2499856235f1 100644 ---- a/src/bootstrap/test.rs -+++ b/src/bootstrap/test.rs -@@ -21,7 +21,7 @@ use crate::flags::Subcommand; - use crate::native; - use crate::tool::{self, SourceType, Tool}; - use crate::toolstate::ToolState; --use crate::util::{self, dylib_path, dylib_path_var}; -+use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var}; - use crate::Crate as CargoCrate; - use crate::{envify, DocTests, GitRepo, Mode}; - -@@ -1178,6 +1178,15 @@ impl Step for Compiletest { - cmd.arg("--system-llvm"); - } - -+ // Tests that use compiler libraries may inherit the `-lLLVM` link -+ // requirement, but the `-L` library path is not propagated across -+ // separate compilations. We can add LLVM's library path to the -+ // platform-specific environment variable as a workaround. -+ if !builder.config.dry_run && suite.ends_with("fulldeps") { -+ let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir")); -+ add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cmd); -+ } -+ - // Only pass correct values for these flags for the `run-make` suite as it - // requires that a C++ compiler was configured which isn't always the case. - if !builder.config.dry_run && suite == "run-make-fulldeps" { diff --git a/SOURCES/rust-pr71782-Use-a-non-existent-test-path.patch b/SOURCES/rust-pr71782-Use-a-non-existent-test-path.patch deleted file mode 100644 index df02449..0000000 --- a/SOURCES/rust-pr71782-Use-a-non-existent-test-path.patch +++ /dev/null @@ -1,56 +0,0 @@ -From fbd3fbdb24563a9d8fd3651f6bdc90bbbbd81d3e Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 1 May 2020 16:50:10 -0700 -Subject: [PATCH] Use a non-existent test path instead of clobbering /dev/null - ---- - src/test/ui/non-ice-error-on-worker-io-fail.rs | 10 +++++++--- - src/test/ui/non-ice-error-on-worker-io-fail.stderr | 2 +- - 2 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/src/test/ui/non-ice-error-on-worker-io-fail.rs b/src/test/ui/non-ice-error-on-worker-io-fail.rs -index 8af17742850d..30779fc65c0f 100644 ---- a/src/test/ui/non-ice-error-on-worker-io-fail.rs -+++ b/src/test/ui/non-ice-error-on-worker-io-fail.rs -@@ -4,8 +4,12 @@ - // - // An attempt to `-o` into a directory we cannot write into should indeed - // be an error; but not an ICE. -+// -+// However, some folks run tests as root, which can write `/dev/` and end -+// up clobbering `/dev/null`. Instead we'll use a non-existent path, which -+// also used to ICE, but even root can't magically write there. - --// compile-flags: -o /dev/null -+// compile-flags: -o /does-not-exist/output - - // The error-pattern check occurs *before* normalization, and the error patterns - // are wildly different between build environments. So this is a cop-out (and we -@@ -15,10 +19,10 @@ - // error-pattern: error - - // On Mac OS X, we get an error like the below --// normalize-stderr-test "failed to write bytecode to /dev/null.non_ice_error_on_worker_io_fail.*" -> "io error modifying /dev/" -+// normalize-stderr-test "failed to write bytecode to /does-not-exist/output.non_ice_error_on_worker_io_fail.*" -> "io error modifying /does-not-exist/" - - // On Linux, we get an error like the below --// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /dev/" -+// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /does-not-exist/" - - // ignore-tidy-linelength - // ignore-windows - this is a unix-specific test -diff --git a/src/test/ui/non-ice-error-on-worker-io-fail.stderr b/src/test/ui/non-ice-error-on-worker-io-fail.stderr -index f732abc52b71..edadecf273a7 100644 ---- a/src/test/ui/non-ice-error-on-worker-io-fail.stderr -+++ b/src/test/ui/non-ice-error-on-worker-io-fail.stderr -@@ -1,6 +1,6 @@ - warning: ignoring --out-dir flag due to -o flag - --error: io error modifying /dev/ -+error: io error modifying /does-not-exist/ - - error: aborting due to previous error - --- -2.26.2 - diff --git a/SOURCES/rustc-1.42.0-disable-libssh2.patch b/SOURCES/rustc-1.48.0-disable-libssh2.patch similarity index 57% rename from SOURCES/rustc-1.42.0-disable-libssh2.patch rename to SOURCES/rustc-1.48.0-disable-libssh2.patch index 770ad34..6916e74 100644 --- a/SOURCES/rustc-1.42.0-disable-libssh2.patch +++ b/SOURCES/rustc-1.48.0-disable-libssh2.patch @@ -1,6 +1,6 @@ ---- rustc-1.42.0-src/Cargo.lock.orig 2020-03-09 15:11:17.000000000 -0700 -+++ rustc-1.42.0-src/Cargo.lock 2020-04-02 16:39:22.268896227 -0700 -@@ -1796,7 +1796,6 @@ +--- rustc-1.48.0-src/Cargo.lock.orig 2020-11-16 06:01:53.000000000 -0800 ++++ rustc-1.48.0-src/Cargo.lock 2020-11-16 09:27:44.425104404 -0800 +@@ -1676,7 +1676,6 @@ dependencies = [ "cc", "libc", @@ -8,14 +8,14 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1813,20 +1812,6 @@ +@@ -1693,20 +1692,6 @@ ] [[package]] -name = "libssh2-sys" --version = "0.2.14" +-version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "36aa6e813339d3a063292b77091dfbbb6152ff9006a459895fa5bebed7d34f10" +-checksum = "ca46220853ba1c512fc82826d0834d87b06bcd3c2a42241b7de72f3d2fe17056" -dependencies = [ - "cc", - "libc", @@ -27,11 +27,11 @@ - -[[package]] name = "libz-sys" - version = "1.0.25" + version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.42.0-src/vendor/git2/Cargo.toml.orig 2020-03-09 17:00:19.000000000 -0700 -+++ rustc-1.42.0-src/vendor/git2/Cargo.toml 2020-04-02 16:38:46.163664007 -0700 -@@ -55,7 +55,7 @@ +--- rustc-1.48.0-src/vendor/git2/Cargo.toml.orig 2020-11-16 06:27:49.000000000 -0800 ++++ rustc-1.48.0-src/vendor/git2/Cargo.toml 2020-11-16 09:27:44.425104404 -0800 +@@ -49,7 +49,7 @@ version = "0.1.39" [features] diff --git a/SOURCES/rustc-1.48.0-no-default-pie.patch b/SOURCES/rustc-1.48.0-no-default-pie.patch new file mode 100644 index 0000000..bb6b3d1 --- /dev/null +++ b/SOURCES/rustc-1.48.0-no-default-pie.patch @@ -0,0 +1,18 @@ +--- rustc-1.48.0-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2020-11-16 06:01:53.000000000 -0800 ++++ rustc-1.48.0-src/compiler/rustc_codegen_ssa/src/back/link.rs 2020-11-16 09:37:15.779516797 -0800 +@@ -1185,10 +1185,12 @@ + } + + fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { +- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { +- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe, ++ // Only use PIE if explicity specified. ++ let explicit_pic = matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic)); ++ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { ++ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe, + (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, +- (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe, ++ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe, + (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe, + (_, true, _) => LinkOutputKind::StaticDylib, + (_, false, _) => LinkOutputKind::DynamicDylib, diff --git a/SOURCES/rustc-1.49.0-disable-http2.patch b/SOURCES/rustc-1.49.0-disable-http2.patch new file mode 100644 index 0000000..d6c6aa7 --- /dev/null +++ b/SOURCES/rustc-1.49.0-disable-http2.patch @@ -0,0 +1,66 @@ +--- rustc-1.49.0-src/Cargo.lock.orig 2021-01-05 12:45:10.456414612 -0800 ++++ rustc-1.49.0-src/Cargo.lock 2021-01-05 12:45:10.458414575 -0800 +@@ -882,7 +882,6 @@ + dependencies = [ + "cc", + "libc", +- "libnghttp2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -1728,16 +1727,6 @@ + ] + + [[package]] +-name = "libnghttp2-sys" +-version = "0.1.4+1.41.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1" +-dependencies = [ +- "cc", +- "libc", +-] +- +-[[package]] + name = "libz-sys" + version = "1.1.2" + source = "registry+https://github.com/rust-lang/crates.io-index" +--- rustc-1.49.0-src/src/tools/cargo/Cargo.toml.orig 2021-01-05 12:45:10.458414575 -0800 ++++ rustc-1.49.0-src/src/tools/cargo/Cargo.toml 2021-01-05 12:47:25.966928554 -0800 +@@ -25,7 +25,7 @@ + crates-io = { path = "crates/crates-io", version = "0.31.1" } + crossbeam-utils = "0.8" + crypto-hash = "0.3.1" +-curl = { version = "0.4.23", features = ["http2"] } ++curl = { version = "0.4.23", features = [] } + curl-sys = "0.4.22" + env_logger = "0.8.1" + pretty_env_logger = { version = "0.4", optional = true } +--- rustc-1.49.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-12-28 19:03:25.000000000 -0800 ++++ rustc-1.49.0-src/src/tools/cargo/src/cargo/core/package.rs 2021-01-05 12:45:10.458414575 -0800 +@@ -408,14 +408,8 @@ + // Also note that pipelining is disabled as curl authors have indicated + // that it's buggy, and we've empirically seen that it's buggy with HTTP + // proxies. +- let mut multi = Multi::new(); +- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true); +- multi +- .pipelining(false, multiplexing) +- .chain_err(|| "failed to enable multiplexing/pipelining in curl")?; +- +- // let's not flood crates.io with connections +- multi.set_max_host_connections(2)?; ++ let multi = Multi::new(); ++ let multiplexing = false; + + Ok(PackageSet { + packages: package_ids +@@ -584,7 +578,7 @@ + macro_rules! try_old_curl { + ($e:expr, $msg:expr) => { + let result = $e; +- if cfg!(target_os = "macos") { ++ if cfg!(any(target_os = "linux", target_os = "macos")) { + if let Err(e) = result { + warn!("ignoring libcurl {} error: {}", $msg, e); + } diff --git a/SPECS/rust.spec b/SPECS/rust.spec index b195df6..111a995 100644 --- a/SPECS/rust.spec +++ b/SPECS/rust.spec @@ -1,5 +1,5 @@ # Only x86_64 and i686 are Tier 1 platforms at this time. -# https://forge.rust-lang.org/platform-support.html +# https://doc.rust-lang.org/nightly/rustc/platform-support.html #global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x %global rust_arches x86_64 i686 aarch64 ppc64le s390x @@ -10,10 +10,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.42.0 -%global bootstrap_cargo 1.42.0 -%global bootstrap_channel 1.42.0 -%global bootstrap_date 2020-03-12 +%global bootstrap_rust 1.48.0 +%global bootstrap_cargo 1.48.0 +%global bootstrap_channel 1.48.0 +%global bootstrap_date 2020-11-19 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -22,34 +22,38 @@ %bcond_with llvm_static # We can also choose to just use Rust's bundled LLVM, in case the system LLVM -# is insufficient. Rust currently requires LLVM 7.0+. -%if 0%{?rhel} && 0%{?rhel} <= 6 && !0%{?epel} -%bcond_without bundled_llvm -%else +# is insufficient. Rust currently requires LLVM 8.0+. %bcond_with bundled_llvm + +# Requires stable libgit2 1.0 +%if 0%{?fedora} >= 32 +%bcond_with bundled_libgit2 +%else +%bcond_without bundled_libgit2 %endif -# libgit2-sys expects to use its bundled library, which is sometimes just a -# snapshot of libgit2's master branch. This can mean the FFI declarations -# won't match our released libgit2.so, e.g. having changed struct fields. -# So, tread carefully if you toggle this... -%bcond_without bundled_libgit2 - %if 0%{?rhel} +# Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) %bcond_without disabled_libssh2 %else -%bcond_with bundled_libssh2 +%bcond_with disabled_libssh2 +%endif + +%if 0%{?rhel} && 0%{?rhel} < 8 +%bcond_with curl_http2 +%else +%bcond_without curl_http2 %endif # LLDB isn't available everywhere... -%if !0%{?rhel} || 0%{?rhel} > 7 -%bcond_without lldb -%else +%if 0%{?rhel} && 0%{?rhel} < 8 %bcond_with lldb +%else +%bcond_without lldb %endif Name: rust -Version: 1.43.1 +Version: 1.49.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -64,25 +68,19 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# Revert https://github.com/rust-lang/rust/pull/57840 -# We do have the necessary fix in our LLVM 7. -Patch1: rust-pr57840-llvm7-debuginfo-variants.patch +### RHEL-specific patches below ### -# Ensure LLVM is in the link path for rustc tools and "fulldeps" tests -# https://github.com/rust-lang/rust/pull/70123 -# https://github.com/rust-lang/rust/pull/70591 -Patch2: rust-pr70123-ensure-llvm-is-in-the-link-path.patch -Patch3: rust-pr70591-ensure-llvm-is-in-the-link-path.patch +# Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) +Patch100: rustc-1.48.0-disable-libssh2.patch -# Prepare for LLVM 10 upgrade -# https://github.com/rust-lang/rust/pull/70163 -Patch4: rust-pr70163-prepare-for-llvm-10-upgrade.patch +# libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys +# will try to build it statically -- instead we turn off the feature. +Patch101: rustc-1.49.0-disable-http2.patch -# https://github.com/rust-lang/rust/pull/71782 -Patch5: rust-pr71782-Use-a-non-existent-test-path.patch +# kernel rh1410097 causes too-small stacks for PIE. +# (affects RHEL6 kernels when building for RHEL7) +Patch102: rustc-1.48.0-no-default-pie.patch -# Disable cargo->libgit2->libssh2, as it's not approved for FIPS (rhbz1732949) -Patch10: rustc-1.42.0-disable-libssh2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -94,6 +92,8 @@ Patch10: rustc-1.42.0-disable-libssh2.patch arch = "powerpc64" elseif arch == "ppc64le" then arch = "powerpc64le" + elseif arch == "riscv64" then + arch = "riscv64gc" end return arch.."-unknown-linux-"..abi end} @@ -127,11 +127,11 @@ end} Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust} %else BuildRequires: cargo >= %{bootstrap_cargo} -%if 0%{?fedora} >= 27 || 0%{?rhel} > 7 -BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version}) -%else +%if 0%{?rhel} && 0%{?rhel} < 8 BuildRequires: %{name} >= %{bootstrap_rust} BuildConflicts: %{name} > %{version} +%else +BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version}) %endif %global local_rust_root %{_prefix} %endif @@ -141,38 +141,32 @@ BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: ncurses-devel BuildRequires: curl +# explicit curl-devel to avoid httpd24-curl (rhbz1540167) +BuildRequires: curl-devel BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(liblzma) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(zlib) %if %without bundled_libgit2 -BuildRequires: pkgconfig(libgit2) >= 0.27 +BuildRequires: pkgconfig(libgit2) >= 1.0.0 %endif -%if %{without disabled_libssh2} && %{without bundled_libssh2} +%if %{without disabled_libssh2} # needs libssh2_userauth_publickey_frommemory BuildRequires: pkgconfig(libssh2) >= 1.6.0 %endif -%if 0%{?rhel} -%if 0%{?rhel} <= 7 -%global python python2 -%else -%global python /usr/libexec/platform-python -%endif -%else %global python python3 -%endif BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 9.0.0 +Provides: bundled(llvm) = 11.0.0 %else BuildRequires: cmake >= 2.8.11 -%if 0%{?epel} -%global llvm llvm7.0 +%if 0%{?epel} == 7 +%global llvm llvm9.0 %endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} @@ -180,7 +174,7 @@ BuildRequires: cmake >= 2.8.11 %global llvm llvm %global llvm_root %{_prefix} %endif -BuildRequires: %{llvm}-devel >= 7.0 +BuildRequires: %{llvm}-devel >= 9.0 %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel @@ -193,9 +187,6 @@ BuildRequires: procps-ng # debuginfo-gdb tests need gdb BuildRequires: gdb -# TODO: work on unbundling these! -Provides: bundled(libbacktrace) = 8.1.0 - # Virtual provides for folks who attempt "dnf install rustc" Provides: rustc = %{version}-%{release} Provides: rustc%{?_isa} = %{version}-%{release} @@ -217,14 +208,14 @@ Requires: /usr/bin/cc # While we don't want to encourage dynamic linking to Rust shared libraries, as # there's no stable ABI, we still need the unallocated metadata (.rustc) to -# support custom-derive plugins like #[proc_macro_derive(Foo)]. But eu-strip is -# very eager by default, so we have to limit it to -g, only debugging symbols. -%if 0%{?fedora} >= 27 || 0%{?rhel} > 7 -# Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997 -%global _find_debuginfo_opts --keep-section .rustc -%else +# support custom-derive plugins like #[proc_macro_derive(Foo)]. +%if 0%{?rhel} && 0%{?rhel} < 8 +# eu-strip is very eager by default, so we have to limit it to -g, only debugging symbols. %global _find_debuginfo_opts -g %undefine _include_minidebuginfo +%else +# Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997 +%global _find_debuginfo_opts --keep-section .rustc %endif # Use hardening ldflags. @@ -276,11 +267,7 @@ programs. Summary: LLDB pretty printers for Rust BuildArch: noarch Requires: lldb -%if 0%{?fedora} >= 31 || 0%{?rhel} > 7 -Requires: python3-lldb -%else -Requires: python2-lldb -%endif +Requires: %{python}-lldb Requires: %{name}-debugger-common = %{version}-%{release} %description lldb @@ -305,10 +292,7 @@ its standard library. %package -n cargo Summary: Rust's package manager and build tool %if %with bundled_libgit2 -Provides: bundled(libgit2) = 0.99.0 -%endif -%if %with bundled_libssh2 -Provides: bundled(libssh2) = 1.9.0~dev +Provides: bundled(libgit2) = 1.1.0 %endif # For tests: BuildRequires: git @@ -351,10 +335,7 @@ A tool for formatting Rust code according to style guidelines. %package -n rls Summary: Rust Language Server for IDE integration %if %with bundled_libgit2 -Provides: bundled(libgit2) = 0.99.0 -%endif -%if %with bundled_libssh2 -Provides: bundled(libssh2) = 1.9.0~dev +Provides: bundled(libgit2) = 1.1.0 %endif Requires: rust-analysis # /usr/bin/rls is dynamically linked against internal rustc libs @@ -416,28 +397,35 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 -R -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 - %if %with disabled_libssh2 -%patch10 -p1 +%patch100 -p1 %endif -%if "%{python}" != "python2" -sed -i.try-py3 -e '/try python2.7/i try %{python} "$@"' ./configure +%if %without curl_http2 +%patch101 -p1 +rm -rf vendor/libnghttp2-sys/ +%endif + +%if 0%{?rhel} && 0%{?rhel} < 8 +%patch102 -p1 +%endif + +%if "%{python}" != "python3" +# Use our preferred python first +sed -i.try-python -e '/^try python3 /i try "%{python}" "$@"' ./configure %endif %if %without bundled_llvm rm -rf src/llvm-project/ +mkdir -p src/llvm-project/libunwind/ %endif # Remove other unused vendored libraries rm -rf vendor/curl-sys/curl/ rm -rf vendor/jemalloc-sys/jemalloc/ +rm -rf vendor/libssh2-sys/libssh2/ rm -rf vendor/libz-sys/src/zlib/ +rm -rf vendor/libz-sys/src/zlib-ng/ rm -rf vendor/lzma-sys/xz-*/ rm -rf vendor/openssl-src/openssl/ @@ -445,9 +433,6 @@ rm -rf vendor/openssl-src/openssl/ rm -rf vendor/libgit2-sys/libgit2/ %endif -%if %without bundled_libssh2 -rm -rf vendor/libssh2-sys/libssh2/ -%endif %if %with disabled_libssh2 rm -rf vendor/libssh2-sys/ %endif @@ -455,10 +440,7 @@ rm -rf vendor/libssh2-sys/ # This only affects the transient rust-installer, but let it use our dynamic xz-libs sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/tool.rs -# rename bundled license for packaging -cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace} - -%if %{with bundled_llvm} && 0%{?epel} +%if %{with bundled_llvm} && 0%{?epel} == 7 mkdir -p cmake-bin ln -s /usr/bin/cmake3 cmake-bin/cmake %global cmake_path $PWD/cmake-bin @@ -481,21 +463,23 @@ find vendor -name .cargo-checksum.json \ # it's a shebang and make them executable. Then brp-mangle-shebangs gets upset... find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' - -%build - +# Set up shared environment variables for build/install/check +%global rust_env RUSTFLAGS="%{rustflags}" +%if 0%{?cmake_path:1} +%global rust_env %{rust_env} PATH="%{cmake_path}:$PATH" +%endif %if %without bundled_libgit2 # convince libgit2-sys to use the distro libgit2 -export LIBGIT2_SYS_USE_PKG_CONFIG=1 +%global rust_env %{rust_env} LIBGIT2_SYS_USE_PKG_CONFIG=1 %endif - -%if %without bundled_libssh2 +%if %without disabled_libssh2 # convince libssh2-sys to use the distro libssh2 -export LIBSSH2_SYS_USE_PKG_CONFIG=1 +%global rust_env %{rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1 %endif -%{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?rustflags:export RUSTFLAGS="%{rustflags}"} + +%build +export %{rust_env} # We're going to override --libdir when configuring to get rustlib into a # common path, but we'll fix the shared libraries during install. @@ -505,7 +489,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %ifarch %{arm} %{ix86} s390x # full debuginfo is exhausting memory; just do libstd for now # https://github.com/rust-lang/rust/issues/45854 -%if (0%{?fedora} && 0%{?fedora} < 27) || (0%{?rhel} && 0%{?rhel} <= 7) +%if 0%{?rhel} && 0%{?rhel} < 8 # Older rpmbuild didn't work with partial debuginfo coverage. %global debug_package %{nil} %define enable_debuginfo --debuginfo-level=0 @@ -523,6 +507,14 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %define codegen_units_std --set rust.codegen-units-std=1 %endif +# Some builders have relatively little memory for their CPU count. +# At least 2GB per CPU is a good rule of thumb for building rustc. +ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN) +max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 2 )) +if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then + ncpus="$max_cpus" +fi + %configure --disable-option-checking \ --libdir=%{common_libdir} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ @@ -534,18 +526,18 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 --disable-rpath \ %{enable_debuginfo} \ --enable-extended \ + --tools=analysis,cargo,clippy,rls,rustfmt,src \ --enable-vendor \ --enable-verbose-tests \ %{?codegen_units_std} \ --release-channel=%{channel} -%{python} ./x.py build -%{python} ./x.py doc +%{python} ./x.py build -j "$ncpus" --stage 2 +%{python} ./x.py doc --stage 2 %install -%{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?rustflags:export RUSTFLAGS="%{rustflags}"} +export %{rust_env} DESTDIR=%{buildroot} %{python} ./x.py install @@ -609,20 +601,19 @@ ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html %if %without lldb rm -f %{buildroot}%{_bindir}/rust-lldb -rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* +rm -f %{buildroot}%{rustlibdir}/etc/lldb_* %endif %check -%{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?rustflags:export RUSTFLAGS="%{rustflags}"} +export %{rust_env} # The results are not stable on koji, so mask errors and just log it. -%{python} ./x.py test --no-fail-fast || : -%{python} ./x.py test --no-fail-fast cargo || : -%{python} ./x.py test --no-fail-fast clippy || : -%{python} ./x.py test --no-fail-fast rls || : -%{python} ./x.py test --no-fail-fast rustfmt || : +%{python} ./x.py test --no-fail-fast --stage 2 || : +%{python} ./x.py test --no-fail-fast --stage 2 cargo || : +%{python} ./x.py test --no-fail-fast --stage 2 clippy || : +%{python} ./x.py test --no-fail-fast --stage 2 rls || : +%{python} ./x.py test --no-fail-fast --stage 2 rustfmt || : %ldconfig_scriptlets @@ -630,7 +621,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files %license COPYRIGHT LICENSE-APACHE LICENSE-MIT -%license vendor/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace %doc README.md %{_bindir}/rustc %{_bindir}/rustdoc @@ -641,7 +631,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.so -%exclude %{_bindir}/*miri %files std-static @@ -654,19 +643,19 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files debugger-common %dir %{rustlibdir} %dir %{rustlibdir}/etc -%{rustlibdir}/etc/debugger_*.py* +%{rustlibdir}/etc/rust_*.py* %files gdb %{_bindir}/rust-gdb -%{rustlibdir}/etc/gdb_*.py* +%{rustlibdir}/etc/gdb_* %exclude %{_bindir}/rust-gdbgui %if %with lldb %files lldb %{_bindir}/rust-lldb -%{rustlibdir}/etc/lldb_*.py* +%{rustlibdir}/etc/lldb_* %endif @@ -677,7 +666,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %{_docdir}/%{name}/html/*/ %{_docdir}/%{name}/html/*.html %{_docdir}/%{name}/html/*.css -%{_docdir}/%{name}/html/*.ico %{_docdir}/%{name}/html/*.js %{_docdir}/%{name}/html/*.png %{_docdir}/%{name}/html/*.svg @@ -733,6 +721,27 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Wed Jan 13 2021 Josh Stone - 1.49.0-1 +- Update to 1.49.0. + +* Tue Jan 12 2021 Josh Stone - 1.48.0-1 +- Update to 1.48.0. + +* Thu Oct 22 2020 Josh Stone - 1.47.0-1 +- Update to 1.47.0. + +* Wed Oct 14 2020 Josh Stone - 1.46.0-1 +- Update to 1.46.0. + +* Tue Aug 04 2020 Josh Stone - 1.45.2-1 +- Update to 1.45.2. + +* Thu Jul 16 2020 Josh Stone - 1.45.0-1 +- Update to 1.45.0. + +* Tue Jul 14 2020 Josh Stone - 1.44.1-1 +- Update to 1.44.1. + * Thu May 07 2020 Josh Stone - 1.43.1-1 - Update to 1.43.1.