Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Ismael Luceno (3b2f5d901f449ba5366f09ef02a1aa07c906ffbf)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Ismael Luceno (3b2f5d901f449ba5366f09ef02a1aa07c906ffbf)
  • Date: Thu, 9 Jul 2020 07:16:54 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

devel/rust/BUILD |
1
devel/rust/DETAILS |
16
devel/rust/HISTORY |
9
devel/rust/PRE_BUILD |
7
devel/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-for-musl.patch |
67 +
devel/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch |
26
devel/rust/patches/1.42.0-fix-bootstrap.patch |
440 ----------
7 files changed, 112 insertions(+), 454 deletions(-)

New commits:
commit 3b2f5d901f449ba5366f09ef02a1aa07c906ffbf
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

rust 1.44.1

diff --git a/devel/rust/BUILD b/devel/rust/BUILD
index a44f4da..552179b 100755
--- a/devel/rust/BUILD
+++ b/devel/rust/BUILD
@@ -1,4 +1,5 @@
export CLANG_INSTALL_DIR=/usr &&
+CFLAGS="${CFLAGS//-DPIC}" &&
CXXFLAGS="${CXXFLAGS//-DPIC}" &&
if spell_ok "$SPELL"; then
_rust_root="$INSTALL_ROOT/usr"
diff --git a/devel/rust/DETAILS b/devel/rust/DETAILS
index 1d74b0e..49a23de 100755
--- a/devel/rust/DETAILS
+++ b/devel/rust/DETAILS
@@ -1,6 +1,6 @@
SPELL=rust
- VERSION=1.42.0
- CARGO_VERSION=0.43.0
+ VERSION=1.44.1
+ CARGO_VERSION=0.45.0
SOURCE_DIRECTORY=$BUILD_DIRECTORY/rustc-$VERSION-src
TMPFS=off
SOURCE=rustc-$VERSION-src.tar.xz
@@ -19,14 +19,14 @@ SOURCE_DIRECTORY=$BUILD_DIRECTORY/rustc-$VERSION-src
SOURCE2_IGNORE=signature
case "${BUILDX}" in
x86_64-unknown-linux-musl)
-
SOURCE3_HASH=sha512:e3f690c880f6a166ab4e6e199a8285ecaa4341aaaf26e4a6299c072d4a9d1afbaad97d18741d69970d5f278e5bdef58671be3fb1cd17da4305c9f8807106de87
-
SOURCE4_HASH=sha512:4efc3aaf16a0ec9ad28a4743aad1840f3aab37164beb16fe440ea6c0dc4f57efe8343f047921b7d8fca6a6febcf5e6ee7c328a3d72af459a973f92bc0c2d5361
-
SOURCE5_HASH=sha512:aa0c05f1511c782d0b8aaca21049a5f8c31b81677b538708f6d99109a8079cf0a9e021ae26ff662fba610634efaa90463265ddfa647aab4b5523cdcfd7b1c006
+
SOURCE3_HASH=sha512:264f82c5ddffc4cf18d7ff2b475b99efe45662baa769af5dd660f5a1fb3028cec592ddc3a727fe44e2d3fd78598fb9078b8105eb4685f31f3f70bd7681c1090b
+
SOURCE4_HASH=sha512:6b8b86fb0c513a521a550bb24b5cf10a314994ea2f1e8d11f5507ed33257f36181bad4e7eba8e5c0b31601acc2b57c80e5cf769fba30e8deba9f647e2d6eed6f
+
SOURCE5_HASH=sha512:ac770729f044b2fdae53b0f8f6f288c6684900cff990507eaec9570b93c92271d7c3124b874ca2e3a74fd02ff815a14fb76378bc2abfc46d776cbaca3b6adaa0
;;
x86_64-unknown-linux-gnu)
-
SOURCE3_HASH=sha512:ca2450ad3c4b52ed2ddef2c98314862a22a45e84b525c0c91d7db2b2556e606f4f11b46bdcbe5856239aa3c68874c6485f0c92c7b635545caee384fd48cb2d15
-
SOURCE4_HASH=sha512:e10cb383923c34bb7ac3a5dacd1f7cb675331400bc70efa0ff72fc740d2d0f3f876d8f681a1d31fae40b137ac896be20d27fa603802d970857a9f7c1c88b08eb
-
SOURCE5_HASH=sha512:d07eb0c2c8df31429484414ef20fb61338f42a054d76fafb8c0c37d6a2f38953a0e1838752c2f742128fc1943c0ba025e50da50a6b9ae6ae6c5c5c0d408a66ea
+
SOURCE3_HASH=sha512:9e55f503cebd3ff338c6ac05480ee249275d0c59efc6d189a78225cc3e2bfae323d6a2411f1631517bdc5601ecb3cd761333d1b0383e9b51fbca29be108594b9
+
SOURCE4_HASH=sha512:32cd63a8c691b32f314f3cc84cd05dc7bbd5435ab4ab78163c9bfefd003bac3bbe9f053d6f303062052f6f0bbc1cbb619b321aeac7e41c4d8f136ae8a31c2e19
+
SOURCE5_HASH=sha512:5c12ac8f9de590a40fb7b0ce8e71f3a24e97182514d231754e7e7ba5a9555b0fa8e1b48f7174071eccc563bb8fca0a7d0e3cf8ef374a7e884e5f6e3851336221
;;
esac
WEB_SITE=https://www.rust-lang.org/
diff --git a/devel/rust/HISTORY b/devel/rust/HISTORY
index 28edce5..2762db0 100644
--- a/devel/rust/HISTORY
+++ b/devel/rust/HISTORY
@@ -1,3 +1,12 @@
+2020-07-09 Ismael Luceno <ismael AT sourcemage.org>
+ * DETAILS: updated spell to 1.44.1 (with cargo 0.45.0)
+ * BUILD, PRE_BUILD: Remove "-DPIC" from CFLAGS too and remove related
+ patching
+ * patches/1.42.0-fix-bootstrap.patch: removed, no longer needed
+ * patches/0005-Prefer-libgcc_eh-over-libunwind-for-musl.patch,
+ patches/0011-Dynamically-link-libc-on-musl-by-default.patch:
+ Fixed build against musl libc
+
2020-04-20 Ismael Luceno <ismael AT iodev.co.uk>
* DETAILS: updated sha512 checksums of musl-based bootstrap binaries

diff --git a/devel/rust/PRE_BUILD b/devel/rust/PRE_BUILD
index 9245a67..69a4a30 100755
--- a/devel/rust/PRE_BUILD
+++ b/devel/rust/PRE_BUILD
@@ -20,9 +20,4 @@ sedit '/^ *base[.]crt_static_default *=/s/true/false/' \
src/librustc_target/spec/linux_musl_base.rs &&

# avoid rebuilding llvm
-rm -r src/llvm-project &&
-
-# No PIC confusion
-sed -e "s;PIC\,;pic\,;" \
- -e "s;PIC:;pic:;" \
- -i src/rustllvm/PassWrapper.cpp
+rm -r src/llvm-project
diff --git
a/devel/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-for-musl.patch
b/devel/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-for-musl.patch
new file mode 100644
index 0000000..49e6692
--- /dev/null
+++ b/devel/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-for-musl.patch
@@ -0,0 +1,67 @@
+From 6c6ccb3928deffd97a75ef2d9417aae467cd7031 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel AT sholland.org>
+Date: Sat, 21 Dec 2019 16:49:07 +0100
+Subject: [PATCH 05/16] Prefer libgcc_eh over libunwind for musl
+
++ @q66 changes to smaeul's original patch for Void's musl setup
+
+[ismael AT sourcemage.org: Updated for rust 1.44.1]
+---
+ src/libunwind/build.rs | 17 ++---------------
+ src/libunwind/lib.rs | 2 +-
+ 2 files changed, 3 insertions(+), 16 deletions(-)
+
+diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs
+index b8db16f8..0c69b9d2 100644
+--- a/src/libunwind/build.rs
++++ b/src/libunwind/build.rs
+@@ -5,15 +5,12 @@ fn main() {
+ let target = env::var("TARGET").expect("TARGET was not set");
+
+ if cfg!(feature = "llvm-libunwind")
+- && ((target.contains("linux") && !target.contains("musl")) ||
target.contains("fuchsia"))
++ && (target.contains("linux") || target.contains("fuchsia"))
+ {
+ // Build the unwinding from libunwind C/C++ source code.
+ llvm_libunwind::compile();
+ } else if target.contains("linux") {
+- if target.contains("musl") {
+- // linking for musl is handled in lib.rs
+- llvm_libunwind::compile();
+- } else if !target.contains("android") {
++ if !target.contains("android") {
+ println!("cargo:rustc-link-lib=gcc_s");
+ }
+ } else if target.contains("freebsd") {
+@@ -103,15 +99,6 @@ mod llvm_libunwind {
+ cfg.file(root.join("src").join(src));
+ }
+
+- if target_env == "musl" {
+- // use the same C compiler command to compile C++ code so we do
not need to setup the
+- // C++ compiler env variables on the builders
+- cfg.cpp(false);
+- // linking for musl is handled in lib.rs
+- cfg.cargo_metadata(false);
+- println!("cargo:rustc-link-search=native={}",
env::var("OUT_DIR").unwrap());
+- }
+-
+ cfg.compile("unwind");
+ }
+ }
+diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
+index 8d916447..6d653d41 100644
+--- a/src/libunwind/lib.rs
++++ b/src/libunwind/lib.rs
+@@ -21,7 +21,7 @@ cfg_if::cfg_if! {
+ }
+
+ #[cfg(target_env = "musl")]
+-#[link(name = "unwind", kind = "static", cfg(target_feature =
"crt-static"))]
++#[link(name = "gcc_eh", cfg(target_feature = "crt-static"))]
+ #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
+ extern {}
+
+--
+2.25.0
+
diff --git
a/devel/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
b/devel/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
new file mode 100644
index 0000000..0492242
--- /dev/null
+++ b/devel/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
@@ -0,0 +1,26 @@
+From d72ad9c226b4ed225c23d88ec5dbe6ba321b37ad Mon Sep 17 00:00:00 2001
+From: q66 <daniel AT octaforge.org>
+Date: Sat, 21 Dec 2019 17:04:13 +0100
+Subject: [PATCH 11/15] Dynamically link libc on musl by default
+
+---
+ src/librustc_target/spec/linux_musl_base.rs | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/librustc_target/spec/linux_musl_base.rs
b/src/librustc_target/spec/linux_musl_base.rs
+index 58ae91a9..1fae72d6 100644
+--- a/src/librustc_target/spec/linux_musl_base.rs
++++ b/src/librustc_target/spec/linux_musl_base.rs
+@@ -9,8 +9,7 @@ pub fn opts() -> TargetOptions {
+ // argument is *not* necessary for normal builds, but it can't hurt!
+
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-Wl,--eh-frame-hdr".to_string());
+
+- // These targets statically link libc by default
+- base.crt_static_default = true;
++ base.crt_static_default = false;
+ // These targets allow the user to choose between static and dynamic
linking.
+ base.crt_static_respected = true;
+
+--
+2.26.2
+
diff --git a/devel/rust/patches/1.42.0-fix-bootstrap.patch
b/devel/rust/patches/1.42.0-fix-bootstrap.patch
deleted file mode 100644
index 16e4e6d..0000000
--- a/devel/rust/patches/1.42.0-fix-bootstrap.patch
+++ /dev/null
@@ -1,440 +0,0 @@
-From 5f979e9afab42dd7536ca93994de66169880361e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= <matthias.krueger AT famsik.de>
-Date: Mon, 3 Feb 2020 20:13:30 +0100
-Subject: [PATCH] bootstrap: fix clippy warnings
-
----
- src/bootstrap/bin/rustc.rs | 6 +++---
- src/bootstrap/bin/rustdoc.rs | 2 +-
- src/bootstrap/builder.rs | 24 ++++++++----------------
- src/bootstrap/builder/tests.rs | 1 -
- src/bootstrap/compile.rs | 20 ++++++++++----------
- src/bootstrap/config.rs | 7 +++----
- src/bootstrap/dist.rs | 4 ++--
- src/bootstrap/doc.rs | 2 +-
- src/bootstrap/flags.rs | 2 +-
- src/bootstrap/install.rs | 5 ++---
- src/bootstrap/lib.rs | 6 +++---
- src/bootstrap/metadata.rs | 1 -
- src/bootstrap/native.rs | 4 +---
- src/bootstrap/test.rs | 9 +++------
- src/bootstrap/tool.rs | 2 +-
- src/bootstrap/toolstate.rs | 2 +-
- src/bootstrap/util.rs | 2 +-
- 17 files changed, 41 insertions(+), 58 deletions(-)
-
-diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
-index a34ec44566bc..a8c00c8c3ca8 100644
---- a/src/bootstrap/bin/rustc.rs
-+++ b/src/bootstrap/bin/rustc.rs
-@@ -47,7 +47,7 @@ fn main() {
- };
- let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
- let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was
not set");
-- let on_fail = env::var_os("RUSTC_ON_FAIL").map(|of| Command::new(of));
-+ let on_fail = env::var_os("RUSTC_ON_FAIL").map(Command::new);
-
- let rustc = env::var_os(rustc).unwrap_or_else(|| panic!("{:?} was not
set", rustc));
- let libdir = env::var_os(libdir).unwrap_or_else(|| panic!("{:?} was not
set", libdir));
-@@ -64,7 +64,7 @@ fn main() {
- if let Some(crate_name) = crate_name {
- if let Some(target) = env::var_os("RUSTC_TIME") {
- if target == "all"
-- || target.into_string().unwrap().split(",").any(|c|
c.trim() == crate_name)
-+ || target.into_string().unwrap().split(',').any(|c|
c.trim() == crate_name)
- {
- cmd.arg("-Ztime");
- }
-@@ -189,7 +189,7 @@ fn main() {
- crate_name,
- is_test,
- dur.as_secs(),
-- dur.subsec_nanos() / 1_000_000
-+ dur.subsec_millis()
- );
-
- match status.code() {
-diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
-index 8c8b33a4e4e0..04345867bf5c 100644
---- a/src/bootstrap/bin/rustdoc.rs
-+++ b/src/bootstrap/bin/rustdoc.rs
-@@ -61,7 +61,7 @@ fn main() {
- }
-
- // Needed to be able to run all rustdoc tests.
-- if let Some(_) = env::var_os("RUSTDOC_GENERATE_REDIRECT_PAGES") {
-+ if env::var_os("RUSTDOC_GENERATE_REDIRECT_PAGES").is_some() {
- // This "unstable-options" can be removed when
`--generate-redirect-pages` is stabilized
- if !has_unstable {
- cmd.arg("-Z").arg("unstable-options");
-diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
-index d9c894aa9c6b..18f6fda76084 100644
---- a/src/bootstrap/builder.rs
-+++ b/src/bootstrap/builder.rs
-@@ -510,7 +510,7 @@ impl<'a> Builder<'a> {
- Subcommand::Format { .. } | Subcommand::Clean { .. } =>
panic!(),
- };
-
-- let builder = Builder {
-+ Builder {
- build,
- top_stage: build.config.stage.unwrap_or(2),
- kind,
-@@ -518,9 +518,7 @@ impl<'a> Builder<'a> {
- stack: RefCell::new(Vec::new()),
- time_spent_on_dependencies: Cell::new(Duration::new(0, 0)),
- paths: paths.to_owned(),
-- };
--
-- builder
-+ }
- }
-
- pub fn execute_cli(&self) {
-@@ -753,13 +751,12 @@ impl<'a> Builder<'a> {
- cargo.env("RUST_CHECK", "1");
- }
-
-- let stage;
-- if compiler.stage == 0 && self.local_rebuild {
-+ let stage = if compiler.stage == 0 && self.local_rebuild {
- // Assume the local-rebuild rustc already has stage1 features.
-- stage = 1;
-+ 1
- } else {
-- stage = compiler.stage;
-- }
-+ compiler.stage
-+ };
-
- let mut rustflags = Rustflags::new(&target);
- if stage != 0 {
-@@ -1252,12 +1249,7 @@ impl<'a> Builder<'a> {
- };
-
- if self.config.print_step_timings && dur >
Duration::from_millis(100) {
-- println!(
-- "[TIMING] {:?} -- {}.{:03}",
-- step,
-- dur.as_secs(),
-- dur.subsec_nanos() / 1_000_000
-- );
-+ println!("[TIMING] {:?} -- {}.{:03}", step, dur.as_secs(),
dur.subsec_millis());
- }
-
- {
-@@ -1302,7 +1294,7 @@ impl Rustflags {
-
- fn arg(&mut self, arg: &str) -> &mut Self {
- assert_eq!(arg.split_whitespace().count(), 1);
-- if self.0.len() > 0 {
-+ if !self.0.is_empty() {
- self.0.push_str(" ");
- }
- self.0.push_str(arg);
-diff --git a/src/bootstrap/builder/tests.rs b/src/bootstrap/builder/tests.rs
-index 5fefb972866a..cca8ab80c93b 100644
---- a/src/bootstrap/builder/tests.rs
-+++ b/src/bootstrap/builder/tests.rs
-@@ -19,7 +19,6 @@ fn configure(host: &[&str], target: &[&str]) -> Config {
- config.out = dir;
- config.build = INTERNER.intern_str("A");
- config.hosts = vec![config.build]
-- .clone()
- .into_iter()
- .chain(host.iter().map(|s| INTERNER.intern_str(s)))
- .collect::<Vec<_>>();
-diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
-index eced03506ab9..7dded96e18ef 100644
---- a/src/bootstrap/compile.rs
-+++ b/src/bootstrap/compile.rs
-@@ -18,7 +18,6 @@ use std::str;
- use build_helper::{output, t, up_to_date};
- use filetime::FileTime;
- use serde::Deserialize;
--use serde_json;
-
- use crate::builder::Cargo;
- use crate::dist;
-@@ -149,7 +148,8 @@ fn copy_third_party_objects(
- // which is provided by std for this target.
- if target == "x86_64-fortanix-unknown-sgx" {
- let src_path_env = "X86_FORTANIX_SGX_LIBS";
-- let src = env::var(src_path_env).expect(&format!("{} not found in
env", src_path_env));
-+ let src =
-+ env::var(src_path_env).unwrap_or_else(|_| panic!("{} not found
in env", src_path_env));
- copy_and_stamp(Path::new(&src), "libunwind.a");
- }
-
-@@ -361,7 +361,7 @@ impl Step for StartupObjects {
- );
- }
-
-- let target = sysroot_dir.join(file.to_string() + ".o");
-+ let target = sysroot_dir.join((*file).to_string() + ".o");
- builder.copy(dst_file, &target);
- target_deps.push(target);
- }
-@@ -515,7 +515,7 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo:
&mut Cargo, target: Interne
- .env("CFG_VERSION", builder.rust_version())
- .env("CFG_PREFIX",
builder.config.prefix.clone().unwrap_or_default());
-
-- let libdir_relative =
builder.config.libdir_relative().unwrap_or(Path::new("lib"));
-+ let libdir_relative =
builder.config.libdir_relative().unwrap_or_else(|| Path::new("lib"));
- cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative);
-
- if let Some(ref ver_date) = builder.rust_info.commit_date() {
-@@ -843,11 +843,11 @@ pub fn run_cargo(
- };
- for filename in filenames {
- // Skip files like executables
-- if !filename.ends_with(".rlib")
-- && !filename.ends_with(".lib")
-- && !filename.ends_with(".a")
-- && !is_dylib(&filename)
-- && !(is_check && filename.ends_with(".rmeta"))
-+ if !(filename.ends_with(".rlib")
-+ || filename.ends_with(".lib")
-+ || filename.ends_with(".a")
-+ || is_dylib(&filename)
-+ || (is_check && filename.ends_with(".rmeta")))
- {
- continue;
- }
-@@ -905,7 +905,7 @@ pub fn run_cargo(
- for (prefix, extension, expected_len) in toplevel {
- let candidates = contents.iter().filter(|&&(_, ref filename, ref
meta)| {
- filename.starts_with(&prefix[..])
-- && filename[prefix.len()..].starts_with("-")
-+ && filename[prefix.len()..].starts_with('-')
- && filename.ends_with(&extension[..])
- && meta.len() == expected_len
- });
-diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
-index 110c8b844d54..709cf2908ead 100644
---- a/src/bootstrap/config.rs
-+++ b/src/bootstrap/config.rs
-@@ -16,7 +16,6 @@ use crate::flags::Flags;
- pub use crate::flags::Subcommand;
- use build_helper::t;
- use serde::Deserialize;
--use toml;
-
- /// Global configuration for the entire build and/or bootstrap.
- ///
-@@ -440,7 +439,7 @@ impl Config {
- }
- }
- })
-- .unwrap_or_else(|| TomlConfig::default());
-+ .unwrap_or_else(TomlConfig::default);
-
- let build = toml.build.clone().unwrap_or_default();
- // set by bootstrap.py
-@@ -539,7 +538,7 @@ impl Config {
- config.llvm_ldflags = llvm.ldflags.clone();
- set(&mut config.llvm_use_libcxx, llvm.use_libcxx);
- config.llvm_use_linker = llvm.use_linker.clone();
-- config.llvm_allow_old_toolchain =
llvm.allow_old_toolchain.clone();
-+ config.llvm_allow_old_toolchain = llvm.allow_old_toolchain;
- }
-
- if let Some(ref rust) = toml.rust {
-@@ -606,7 +605,7 @@ impl Config {
- target.ar = cfg.ar.clone().map(PathBuf::from);
- target.ranlib = cfg.ranlib.clone().map(PathBuf::from);
- target.linker = cfg.linker.clone().map(PathBuf::from);
-- target.crt_static = cfg.crt_static.clone();
-+ target.crt_static = cfg.crt_static;
- target.musl_root = cfg.musl_root.clone().map(PathBuf::from);
- target.wasi_root = cfg.wasi_root.clone().map(PathBuf::from);
- target.qemu_rootfs =
cfg.qemu_rootfs.clone().map(PathBuf::from);
-diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
-index 8d13df3ee21a..651506dbaa8a 100644
---- a/src/bootstrap/dist.rs
-+++ b/src/bootstrap/dist.rs
-@@ -827,7 +827,7 @@ impl Step for Analysis {
- assert!(builder.config.extended);
- let name = pkgname(builder, "rust-analysis");
-
-- if &compiler.host != builder.config.build {
-+ if compiler.host != builder.config.build {
- return distdir(builder).join(format!("{}-{}.tar.gz", name,
target));
- }
-
-@@ -876,7 +876,7 @@ fn copy_src_dirs(builder: &Builder<'_>, src_dirs:
&[&str], exclude_dirs: &[&str]
- Some(path) => path,
- None => return false,
- };
-- if spath.ends_with("~") || spath.ends_with(".pyc") {
-+ if spath.ends_with('~') || spath.ends_with(".pyc") {
- return false;
- }
-
-diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs
-index 204056598d90..b0d9a5b94641 100644
---- a/src/bootstrap/doc.rs
-+++ b/src/bootstrap/doc.rs
-@@ -560,7 +560,7 @@ impl Step for Rustdoc {
- builder.ensure(Rustc { stage, target });
-
- // Build rustdoc.
-- builder.ensure(tool::Rustdoc { compiler: compiler });
-+ builder.ensure(tool::Rustdoc { compiler });
-
- // Symlink compiler docs to the output directory of rustdoc
documentation.
- let out_dir = builder.stage_out(compiler,
Mode::ToolRustc).join(target).join("doc");
-diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs
-index 2101ef27f9d4..516be6a30c23 100644
---- a/src/bootstrap/flags.rs
-+++ b/src/bootstrap/flags.rs
-@@ -571,7 +571,7 @@ fn split(s: &[String]) -> Vec<String> {
- }
-
- fn parse_deny_warnings(matches: &getopts::Matches) -> Option<bool> {
-- match matches.opt_str("warnings").as_ref().map(|v| v.as_str()) {
-+ match matches.opt_str("warnings").as_deref() {
- Some("deny") => Some(true),
- Some("warn") => Some(false),
- Some(value) => {
-diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs
-index f8734ebdf425..6549262811b9 100644
---- a/src/bootstrap/install.rs
-+++ b/src/bootstrap/install.rs
-@@ -126,9 +126,8 @@ fn add_destdir(path: &Path, destdir: &Option<PathBuf>)
-> PathBuf {
- None => return path.to_path_buf(),
- };
- for part in path.components() {
-- match part {
-- Component::Normal(s) => ret.push(s),
-- _ => {}
-+ if let Component::Normal(s) = part {
-+ ret.push(s)
- }
- }
- ret
-diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
-index 1fee3fd9ac1d..0db4fb389010 100644
---- a/src/bootstrap/lib.rs
-+++ b/src/bootstrap/lib.rs
-@@ -444,7 +444,7 @@ impl Build {
- builder.execute_cli();
- } else {
- let builder = builder::Builder::new(&self);
-- let _ = builder.execute_cli();
-+ builder.execute_cli();
- }
-
- // Check for postponed failures from `test --no-fail-fast`.
-@@ -839,7 +839,7 @@ impl Build {
- .target_config
- .get(&target)
- .and_then(|t| t.musl_root.as_ref())
-- .or(self.config.musl_root.as_ref())
-+ .or_else(|| self.config.musl_root.as_ref())
- .map(|p| &**p)
- }
-
-@@ -1026,7 +1026,7 @@ impl Build {
- }
-
- fn llvm_link_tools_dynamically(&self, target: Interned<String>) -> bool
{
-- (target.contains("linux-gnu") || target.contains("apple-darwin"))
-+ target.contains("linux-gnu") || target.contains("apple-darwin")
- }
-
- /// Returns the `version` string associated with this compiler for Rust
-diff --git a/src/bootstrap/metadata.rs b/src/bootstrap/metadata.rs
-index 8a26adc7ed50..292aa3b1e24a 100644
---- a/src/bootstrap/metadata.rs
-+++ b/src/bootstrap/metadata.rs
-@@ -5,7 +5,6 @@ use std::process::Command;
-
- use build_helper::output;
- use serde::Deserialize;
--use serde_json;
-
- use crate::cache::INTERNER;
- use crate::{Build, Crate};
-diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
-index 5bbd9f47fc90..1cfb4b2f63b5 100644
---- a/src/bootstrap/native.rs
-+++ b/src/bootstrap/native.rs
-@@ -15,8 +15,6 @@ use std::path::{Path, PathBuf};
- use std::process::Command;
-
- use build_helper::{output, t};
--use cc;
--use cmake;
-
- use crate::builder::{Builder, RunConfig, ShouldRun, Step};
- use crate::cache::Interned;
-@@ -205,7 +203,7 @@ impl Step for Llvm {
- cfg.define("LLVM_ENABLE_LIBXML2", "OFF");
- }
-
-- if enabled_llvm_projects.len() > 0 {
-+ if !enabled_llvm_projects.is_empty() {
- enabled_llvm_projects.sort();
- enabled_llvm_projects.dedup();
- cfg.define("LLVM_ENABLE_PROJECTS",
enabled_llvm_projects.join(";"));
-diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
-index 6adf9ddaf343..8d9e62010015 100644
---- a/src/bootstrap/test.rs
-+++ b/src/bootstrap/test.rs
-@@ -1424,13 +1424,10 @@ impl Step for ErrorIndex {
- }
-
- fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown:
&Path) -> bool {
-- match fs::read_to_string(markdown) {
-- Ok(contents) => {
-- if !contents.contains("```") {
-- return true;
-- }
-+ if let Ok(contents) = fs::read_to_string(markdown) {
-+ if !contents.contains("```") {
-+ return true;
- }
-- Err(_) => {}
- }
-
- builder.info(&format!("doc tests for: {}", markdown.display()));
-diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
-index 7f24768a4f10..67e0ed5c5802 100644
---- a/src/bootstrap/tool.rs
-+++ b/src/bootstrap/tool.rs
-@@ -234,7 +234,7 @@ pub fn prepare_tool_cargo(
- cargo.env("RUSTC_EXTERNAL_TOOL", "1");
- }
-
-- let mut features = extra_features.iter().cloned().collect::<Vec<_>>();
-+ let mut features = extra_features.to_vec();
- if builder.build.config.cargo_native_static {
- if path.ends_with("cargo")
- || path.ends_with("rls")
-diff --git a/src/bootstrap/toolstate.rs b/src/bootstrap/toolstate.rs
-index b068c8200ace..bb012a388551 100644
---- a/src/bootstrap/toolstate.rs
-+++ b/src/bootstrap/toolstate.rs
-@@ -124,7 +124,7 @@ fn check_changed_files(toolstates: &HashMap<Box<str>,
ToolState>) {
- let output = t!(String::from_utf8(output.stdout));
-
- for (tool, submodule) in
STABLE_TOOLS.iter().chain(NIGHTLY_TOOLS.iter()) {
-- let changed = output.lines().any(|l| l.starts_with("M") &&
l.ends_with(submodule));
-+ let changed = output.lines().any(|l| l.starts_with('M') &&
l.ends_with(submodule));
- eprintln!("Verifying status of {}...", tool);
- if !changed {
- continue;
-diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs
-index 7d1efe4610f9..eac790fe504b 100644
---- a/src/bootstrap/util.rs
-+++ b/src/bootstrap/util.rs
-@@ -98,7 +98,7 @@ impl Drop for TimeIt {
- fn drop(&mut self) {
- let time = self.1.elapsed();
- if !self.0 {
-- println!("\tfinished in {}.{:03}", time.as_secs(),
time.subsec_nanos() / 1_000_000);
-+ println!("\tfinished in {}.{:03}", time.as_secs(),
time.subsec_millis());
- }
- }
- }



  • [SM-Commit] GIT changes to master grimoire by Ismael Luceno (3b2f5d901f449ba5366f09ef02a1aa07c906ffbf), Ismael Luceno, 07/09/2020

Archive powered by MHonArc 2.6.24.

Top of Page