From 3c6623c53dac997cd9e7dd4038f9fc40953bcaa5 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 26 Sep 2019 12:33:47 -0700 Subject: [PATCH 1/2] Update to 1.38.0. --- .gitignore | 8 ++++++++ rust.spec | 21 ++++++++++++++++----- rustc-1.38.0-rebuild-bootstrap.patch | 10 ++++++++++ sources | 2 +- sources-bootstrap | 16 ++++++++-------- 5 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 rustc-1.38.0-rebuild-bootstrap.patch diff --git a/.gitignore b/.gitignore index 7cdfebc..2d12042 100644 --- a/.gitignore +++ b/.gitignore @@ -220,3 +220,11 @@ /rust-1.36.0-powerpc64-unknown-linux-gnu.tar.xz /rust-1.36.0-s390x-unknown-linux-gnu.tar.xz /rust-1.36.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.38.0-src.tar.xz +/rust-1.37.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.37.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.37.0-i686-unknown-linux-gnu.tar.xz +/rust-1.37.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.37.0-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.37.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.37.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/rust.spec b/rust.spec index 6b663d9..4787614 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,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.36.0 -%global bootstrap_cargo 1.36.0 -%global bootstrap_channel 1.36.0 -%global bootstrap_date 2019-07-04 +%global bootstrap_rust 1.37.0 +%global bootstrap_cargo 1.37.0 +%global bootstrap_channel 1.37.0 +%global bootstrap_date 2019-08-15 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -48,7 +48,7 @@ %endif Name: rust -Version: 1.37.0 +Version: 1.38.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -67,6 +67,9 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # We do have the necessary fix in our LLVM 7. Patch1: rust-pr57840-llvm7-debuginfo-variants.patch +# Mask a warning-as-error when rebuilding 1.38 with 1.38 +Patch2: rustc-1.38.0-rebuild-bootstrap.patch + # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -397,6 +400,7 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} %patch1 -p1 -R +%patch2 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -449,6 +453,10 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ find vendor -name .cargo-checksum.json \ -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' +# Sometimes Rust sources start with #![...] attributes, and "smart" editors think +# 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 @@ -700,6 +708,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Thu Sep 26 2019 Josh Stone - 1.38.0-1 +- Update to 1.38.0. + * Thu Aug 15 2019 Josh Stone - 1.37.0-1 - Update to 1.37.0. diff --git a/rustc-1.38.0-rebuild-bootstrap.patch b/rustc-1.38.0-rebuild-bootstrap.patch new file mode 100644 index 0000000..07f59a0 --- /dev/null +++ b/rustc-1.38.0-rebuild-bootstrap.patch @@ -0,0 +1,10 @@ +--- rustc-1.38.0-src/src/bootstrap/builder.rs 2019-09-23 14:15:52.000000000 -0700 ++++ rustc-1.38.0-src/src/bootstrap/builder.rs 2019-09-26 10:45:49.663995011 -0700 +@@ -140,6 +140,7 @@ + + impl StepDescription { + fn from() -> StepDescription { ++ #[allow(unused_unsafe)] // for rebuild bootstrapping + StepDescription { + default: S::DEFAULT, + only_hosts: S::ONLY_HOSTS, diff --git a/sources b/sources index d7fa41b..c280199 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.37.0-src.tar.xz) = bfee43f578e6d44ead950b870b9fd31087e1bd3f917611f5dce7ad56504b83185edf43e297e8d1304e9e97b9a580d1e6adf6608ab8ed6dee0dc8c5153cdbc5d4 +SHA512 (rustc-1.38.0-src.tar.xz) = b756d29a7a222bc7b5c7f42ff397346ab840f78e559f93e6e36b65e76eea525cf429899fe4de9fb8966623a2225b552feef9fa831bee50f9e25c976fa2af8c0a diff --git a/sources-bootstrap b/sources-bootstrap index 854a3f7..00b3ee0 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.37.0-src.tar.xz) = bfee43f578e6d44ead950b870b9fd31087e1bd3f917611f5dce7ad56504b83185edf43e297e8d1304e9e97b9a580d1e6adf6608ab8ed6dee0dc8c5153cdbc5d4 -SHA512 (rust-1.36.0-aarch64-unknown-linux-gnu.tar.xz) = 77ffd9aa0dfdbb886a51c8d17e3e348c777226e859a48374dad8be20b9a3c7130c7f46d9173753e4ac4a264b45610767ba2625df4192773913892a13a255d3d6 -SHA512 (rust-1.36.0-armv7-unknown-linux-gnueabihf.tar.xz) = b31e34f44df17d89f9f2a609a5b5b2320f43691e06ead257d893766abf8764a158adff0265dd60bf1f63dd98f0bf6bc64ae3b9e9f45200fbd7dfcaec3ba85d01 -SHA512 (rust-1.36.0-i686-unknown-linux-gnu.tar.xz) = 34bcb93ec7a313a28ac20cd853e37419c4607f4035a367015826bd797401a2ada20ee99ae9028b6115c9db8aa1d4f74b74fb08ed09ab528d5946bc26c754b182 -SHA512 (rust-1.36.0-powerpc64le-unknown-linux-gnu.tar.xz) = 02f32b544b0a55ba6f6fc4852f18766107bc0ce2c50488db11605e8a10e5965dd44e8332905c00080b08576370f2f0297ecbe12ba9fe01b4c24cdb9fd03ad64f -SHA512 (rust-1.36.0-powerpc64-unknown-linux-gnu.tar.xz) = 20bdd2b427549c866343962abefc4ffc356a1cb6965c754f28f19b05c234cb9c0abccbce036013deba1dc7699c2889ec954fff2b944953385624be54ee7a733e -SHA512 (rust-1.36.0-s390x-unknown-linux-gnu.tar.xz) = c637b8f50cbce3333280f43ce4b97d3f75ddae429ee34461837c3c3869e20aed8c5e76f7a58998f617dc0ffc2e6afd00908e5de05f4c7ed9a8c34d5dbc7ce916 -SHA512 (rust-1.36.0-x86_64-unknown-linux-gnu.tar.xz) = 3f14dda1e09ef8c8168600f4d70ba60cb2a1086ad9edb5eed708d0ffc16fdb9c582ce350a93afcd64b78f87737e37d4f099703835a1ec9837a5721c2335e17c7 +SHA512 (rustc-1.38.0-src.tar.xz) = b756d29a7a222bc7b5c7f42ff397346ab840f78e559f93e6e36b65e76eea525cf429899fe4de9fb8966623a2225b552feef9fa831bee50f9e25c976fa2af8c0a +SHA512 (rust-1.37.0-aarch64-unknown-linux-gnu.tar.xz) = c70054f589aa2aecfbd6a89f567306e0cf5d3eb56e5a544ced0a5d212f14033dab10559d22dd6b07945e45a25d8de14fc7897c9d24c0d8149548a06b404ca9d2 +SHA512 (rust-1.37.0-armv7-unknown-linux-gnueabihf.tar.xz) = 6d9e055f36a2e912f30bebb25afdd3188019a438f208d3db67b38078bd5c37633c38fd48da15ba80640399babf89221e727a2bf43990aee269fcc5c91cd412b4 +SHA512 (rust-1.37.0-i686-unknown-linux-gnu.tar.xz) = b59377350f82efd10c7afe0f7a28ecbd5355719d841d40c98bec0f01961233f7a19bed2581a111a76cde8dd8dc68a019fa7d3da66cb7ebcb002ba52a14a7e573 +SHA512 (rust-1.37.0-powerpc64le-unknown-linux-gnu.tar.xz) = 366c8920448000bfb4baa3a47588a1c7bc81e18afb8d40f0efc824e429e9e6900efbdb4c9003fb45b9d8595328bd612bd63f390a7d3dedbb30b7dc57fc12abf3 +SHA512 (rust-1.37.0-powerpc64-unknown-linux-gnu.tar.xz) = e8e5cf1c64bd3eec389cef022e1c7bae4618fb6966505d2e762d10e7f443fece43b8b95c989c020bdf739abaf9c3f036230df46f6477a2ccd517a7bdef2ba0d7 +SHA512 (rust-1.37.0-s390x-unknown-linux-gnu.tar.xz) = 14f403d3ce9df2a2baba1db13c9f039d7118d7e0c8285ca19ea0284c32e80c3f786660dedef4d1758b2227f91732b8e7deccbf3f38c2b3491738c1408d6bfd0e +SHA512 (rust-1.37.0-x86_64-unknown-linux-gnu.tar.xz) = c4d48aa12cb929d6600f9cce81bb612c504aa1b3b3f8e76352af3a76b737dcbe0d31e8d139c17884b11aef9f12a55c4908fb8f3ff63dfa92533e4bd0a729914f From 963b5186998ba2ba5cf292a8076e0bb9696239cd Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 27 Sep 2019 15:22:39 -0700 Subject: [PATCH 2/2] Filter the libraries included in rust-std (rhbz1756487) --- ...-WIP-minimize-the-rust-std-component.patch | 74 +++++++++++++++++++ rust.spec | 18 ++++- 2 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 0001-WIP-minimize-the-rust-std-component.patch diff --git a/0001-WIP-minimize-the-rust-std-component.patch b/0001-WIP-minimize-the-rust-std-component.patch new file mode 100644 index 0000000..04be717 --- /dev/null +++ b/0001-WIP-minimize-the-rust-std-component.patch @@ -0,0 +1,74 @@ +From 2bf05f208272cd58c57f4d7d8d0e10fdb22e8719 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 27 Sep 2019 12:33:08 -0700 +Subject: [PATCH] [WIP] minimize the rust-std component + +--- + src/bootstrap/dist.rs | 45 +++++++++++++++---------------------------- + 1 file changed, 16 insertions(+), 29 deletions(-) + +diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs +index 552965863d10..76fbd07f9fb5 100644 +--- a/src/bootstrap/dist.rs ++++ b/src/bootstrap/dist.rs +@@ -667,41 +667,28 @@ impl Step for Std { + return distdir(builder).join(format!("{}-{}.tar.gz", name, target)); + } + +- // We want to package up as many target libraries as possible +- // for the `rust-std` package, so if this is a host target we +- // depend on librustc and otherwise we just depend on libtest. +- if builder.hosts.iter().any(|t| t == target) { +- builder.ensure(compile::Rustc { compiler, target }); +- } else { +- if builder.no_std(target) == Some(true) { +- // the `test` doesn't compile for no-std targets +- builder.ensure(compile::Std { compiler, target }); +- } else { +- builder.ensure(compile::Test { compiler, target }); +- } +- } ++ builder.ensure(compile::Std { compiler, target }); ++ builder.ensure(compile::Test { compiler, target }); + + let image = tmpdir(builder).join(format!("{}-{}-image", name, target)); + let _ = fs::remove_dir_all(&image); + +- let dst = image.join("lib/rustlib").join(target); ++ let dst = image.join("lib/rustlib").join(target).join("lib"); + t!(fs::create_dir_all(&dst)); +- let mut src = builder.sysroot_libdir(compiler, target).to_path_buf(); +- src.pop(); // Remove the trailing /lib folder from the sysroot_libdir +- builder.cp_filtered(&src, &dst, &|path| { +- if let Some(name) = path.file_name().and_then(|s| s.to_str()) { +- if name == builder.config.rust_codegen_backends_dir.as_str() { +- return false +- } +- if name == "bin" { +- return false +- } +- if name.contains("LLVM") { +- return false +- } ++ ++ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target); ++ let stamp = dbg!(compile::libstd_stamp(builder, compiler_to_use, target)); ++ for (path, host) in builder.read_stamp_file(&stamp) { ++ if !host { ++ builder.copy(&path, &dst.join(path.file_name().unwrap())); + } +- true +- }); ++ } ++ let stamp = dbg!(compile::libtest_stamp(builder, compiler_to_use, target)); ++ for (path, host) in builder.read_stamp_file(&stamp) { ++ if !host { ++ builder.copy(&path, &dst.join(path.file_name().unwrap())); ++ } ++ } + + let mut cmd = rust_installer(builder); + cmd.arg("generate") +-- +2.21.0 + diff --git a/rust.spec b/rust.spec index 4787614..40faed3 100644 --- a/rust.spec +++ b/rust.spec @@ -49,7 +49,7 @@ Name: rust Version: 1.38.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -70,6 +70,10 @@ Patch1: rust-pr57840-llvm7-debuginfo-variants.patch # Mask a warning-as-error when rebuilding 1.38 with 1.38 Patch2: rustc-1.38.0-rebuild-bootstrap.patch +# Reduce the size of rust-std +# https://github.com/rust-lang/rust/pull/64823 +Patch3: 0001-WIP-minimize-the-rust-std-component.patch + # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -401,6 +405,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 -R %patch2 -p1 +%patch3 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -542,9 +547,11 @@ find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \ (cd "%{buildroot}%{rustlibdir}/%{rust_triple}/lib" && find ../../../../%{_lib} -maxdepth 1 -name '*.so' | while read lib; do - # make sure they're actually identical! - cmp "$lib" "${lib##*/}" - ln -v -f -s -t . "$lib" + if [ -f "${lib##*/}" ]; then + # make sure they're actually identical! + cmp "$lib" "${lib##*/}" + ln -v -f -s -t . "$lib" + fi done) # Remove installer artifacts (manifests, uninstall scripts, etc.) @@ -708,6 +715,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Fri Sep 27 2019 Josh Stone - 1.38.0-2 +- Filter the libraries included in rust-std (rhbz1756487) + * Thu Sep 26 2019 Josh Stone - 1.38.0-1 - Update to 1.38.0.