From a14d883d70536981305323754831e7aa5515b706 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 9 Oct 2020 11:55:38 +0300 Subject: [PATCH] rust: 1.47.0 --- extra/rust/build | 40 +++++----- extra/rust/checksums | 11 ++- extra/rust/patches/libressl-3.1.X.patch | 17 ---- .../rust/patches/libressl.patch | 0 extra/rust/patches/musl.patch | 78 ------------------- extra/rust/sources | 11 ++- extra/rust/version | 2 +- testing/rust/build | 68 ---------------- testing/rust/checksums | 6 -- testing/rust/depends | 8 -- testing/rust/patches/musl.patch | 78 ------------------- testing/rust/sources | 6 -- testing/rust/version | 1 - 13 files changed, 31 insertions(+), 295 deletions(-) delete mode 100644 extra/rust/patches/libressl-3.1.X.patch rename testing/rust/patches/libressl-3.1.X.patch => extra/rust/patches/libressl.patch (100%) delete mode 100644 extra/rust/patches/musl.patch delete mode 100755 testing/rust/build delete mode 100644 testing/rust/checksums delete mode 100644 testing/rust/depends delete mode 100644 testing/rust/patches/musl.patch delete mode 100644 testing/rust/sources delete mode 100644 testing/rust/version diff --git a/extra/rust/build b/extra/rust/build index ef4327e6..4a2472ef 100755 --- a/extra/rust/build +++ b/extra/rust/build @@ -1,33 +1,33 @@ #!/bin/sh -e -for patch in *.patch; do - patch -p1 < "$patch" -done +patch -p1 < libressl.patch # This package mimics the download process of rust's 'x.py' # bootstrap library to allow for the removal of the internet # connection requirement per build. { - mkdir -p "${cache_dir:=build/cache/2020-08-03}" + mkdir -p "${cache_dir:=build/cache/2020-08-27}" for tarball in *.tar.xz\?no-extract; do mv -f "$tarball" "$cache_dir/${tarball%%\?no-extract}" done } -# 'rust' checksums files in 'vendor/', but we patch a few. -for vendor in libc openssl-sys; do - sed -i 's/\("files":{\)[^}]*/\1/' "vendor/$vendor/.cargo-checksum.json" -done +# We modified openssl-sys. +sed -i 's/\("files":{\)[^}]*/\1/' \ + vendor/openssl-sys/.cargo-checksum.json + +sed -i 's/crt_static_default = true/crt_static_default = false/' \ + src/librustc_target/spec/linux_musl_base.rs cat > config.toml < ('3', '0', '0'), - (3, 0, 1) => ('3', '0', '1'), - (3, 0, _) => ('3', '0', 'x'), -+ (3, 1, 0) => ('3', '1', '0'), -+ (3, 1, 1) => ('3', '1', '0'), -+ (3, 1, _) => ('3', '1', 'x'), -+ (3, 2, 0) => ('3', '2', '0'), -+ (3, 2, 1) => ('3', '2', '1'), -+ (3, 2, _) => ('3', '2', 'x'), - _ => version_error(), - }; - diff --git a/testing/rust/patches/libressl-3.1.X.patch b/extra/rust/patches/libressl.patch similarity index 100% rename from testing/rust/patches/libressl-3.1.X.patch rename to extra/rust/patches/libressl.patch diff --git a/extra/rust/patches/musl.patch b/extra/rust/patches/musl.patch deleted file mode 100644 index 54c35153..00000000 --- a/extra/rust/patches/musl.patch +++ /dev/null @@ -1,78 +0,0 @@ -diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 9b4926f28..8555d904b 100644 ---- a/src/bootstrap/compile.rs -+++ b/src/bootstrap/compile.rs -@@ -176,7 +176,7 @@ fn copy_self_contained_objects( - // to using gcc from a glibc-targeting toolchain for linking. - // To do that we have to distribute musl startup objects as a part of Rust toolchain - // and link with them manually in the self-contained mode. -- if target.contains("musl") { -+ if target.contains("noop") { - let srcdir = builder.musl_libdir(target).unwrap(); - for &obj in &["crt1.o", "Scrt1.o", "rcrt1.o", "crti.o", "crtn.o"] { - copy_and_stamp( -diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs -index 3301d41cf..1c9e0083a 100644 ---- a/src/bootstrap/sanity.rs -+++ b/src/bootstrap/sanity.rs -@@ -192,7 +192,7 @@ pub fn check(build: &mut Build) { - } - - // Make sure musl-root is valid -- if target.contains("musl") { -+ if target.contains("noop") { - // If this is a native target (host is also musl) and no musl-root is given, - // fall back to the system toolchain in /usr before giving up - if build.musl_root(*target).is_none() && build.config.build == *target { -diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs -index b90e91d29..ad098a47e 100644 ---- a/src/librustc_target/spec/linux_musl_base.rs -+++ b/src/librustc_target/spec/linux_musl_base.rs -@@ -9,7 +9,7 @@ pub fn opts() -> TargetOptions { - base.crt_objects_fallback = Some(CrtObjectsFallback::Musl); - - // 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; - -diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs -index 31d235cf6..1ebec47ed 100644 ---- a/src/libunwind/build.rs -+++ b/src/libunwind/build.rs -@@ -12,7 +12,7 @@ fn main() { - } else if target.contains("x86_64-fortanix-unknown-sgx") { - llvm_libunwind::compile(); - } else if target.contains("linux") { -- if target.contains("musl") { -+ if target.contains("noop") { - // linking for musl is handled in lib.rs - llvm_libunwind::compile(); - } else if !target.contains("android") { -diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs -index cc025da1a..0506db514 100644 ---- a/src/libunwind/lib.rs -+++ b/src/libunwind/lib.rs -@@ -18,7 +18,7 @@ cfg_if::cfg_if! { - } - } - --#[cfg(target_env = "musl")] -+#[cfg(target_env = "noop")] - #[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))] - #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] - extern "C" {} -diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs -index 55b892f7e..e03ce90e2 100644 ---- a/vendor/libc/src/unix/mod.rs -+++ b/vendor/libc/src/unix/mod.rs -@@ -298,7 +298,7 @@ cfg_if! { - } else if #[cfg(feature = "std")] { - // cargo build, don't pull in anything extra as the libstd dep - // already pulls in all libs. -- } else if #[cfg(target_env = "musl")] { -+ } else if #[cfg(target_env = "noop")] { - #[cfg_attr(feature = "rustc-dep-of-std", - link(name = "c", kind = "static", - cfg(target_feature = "crt-static")))] diff --git a/extra/rust/sources b/extra/rust/sources index d31f1956..fd2b4968 100644 --- a/extra/rust/sources +++ b/extra/rust/sources @@ -1,6 +1,5 @@ -https://static.rust-lang.org/dist/rustc-1.46.0-src.tar.xz -https://static.rust-lang.org/dist/2020-08-03/rust-std-1.45.2-x86_64-unknown-linux-musl.tar.xz?no-extract -https://static.rust-lang.org/dist/2020-08-03/rustc-1.45.2-x86_64-unknown-linux-musl.tar.xz?no-extract -https://static.rust-lang.org/dist/2020-08-03/cargo-0.46.1-x86_64-unknown-linux-musl.tar.xz?no-extract -patches/musl.patch -patches/libressl-3.1.X.patch +https://static.rust-lang.org/dist/rustc-1.47.0-src.tar.xz +https://static.rust-lang.org/dist/2020-08-27/rust-std-1.46.0-x86_64-unknown-linux-musl.tar.xz?no-extract +https://static.rust-lang.org/dist/2020-08-27/rustc-1.46.0-x86_64-unknown-linux-musl.tar.xz?no-extract +https://static.rust-lang.org/dist/2020-08-27/cargo-0.47.0-x86_64-unknown-linux-musl.tar.xz?no-extract +patches/libressl.patch diff --git a/extra/rust/version b/extra/rust/version index 8c3df8ce..50c78713 100644 --- a/extra/rust/version +++ b/extra/rust/version @@ -1 +1 @@ -1.46.0 1 +1.47.0 1 diff --git a/testing/rust/build b/testing/rust/build deleted file mode 100755 index 54265b6f..00000000 --- a/testing/rust/build +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -e - -for patch in *.patch; do - patch -p1 < "$patch" -done - -# This package mimics the download process of rust's 'x.py' -# bootstrap library to allow for the removal of the internet -# connection requirement per build. -{ - mkdir -p "${cache_dir:=build/cache/2020-08-27}" - - for tarball in *.tar.xz\?no-extract; do - mv -f "$tarball" "$cache_dir/${tarball%%\?no-extract}" - done -} - -# 'rust' checksums files in 'vendor/', but we patch a few. -for vendor in libc openssl-sys; do - sed -i 's/\("files":{\)[^}]*/\1/' "vendor/$vendor/.cargo-checksum.json" -done - -cat > config.toml < TargetOptions { - base.crt_objects_fallback = Some(CrtObjectsFallback::Musl); - - // 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; - -diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs -index 55b892f7e..e03ce90e2 100644 ---- a/vendor/libc/src/unix/mod.rs -+++ b/vendor/libc/src/unix/mod.rs -@@ -298,7 +298,7 @@ cfg_if! { - } else if #[cfg(feature = "std")] { - // cargo build, don't pull in anything extra as the libstd dep - // already pulls in all libs. -- } else if #[cfg(target_env = "musl")] { -+ } else if #[cfg(target_env = "noop")] { - #[cfg_attr(feature = "rustc-dep-of-std", - link(name = "c", kind = "static", - cfg(target_feature = "crt-static")))] -diff --git a/library/unwind/build.rs b/library/unwind/build.rs -index ab09a6e32..316ecadf4 100644 ---- a/library/unwind/build.rs -+++ b/library/unwind/build.rs -@@ -12,7 +12,7 @@ fn main() { - } else if target.contains("x86_64-fortanix-unknown-sgx") { - llvm_libunwind::compile(); - } else if target.contains("linux") { -- if target.contains("musl") { -+ if target.contains("noop") { - // linking for musl is handled in lib.rs - llvm_libunwind::compile(); - } else if !target.contains("android") { -diff --git a/library/unwind/src/lib.rs b/library/unwind/src/lib.rs -index 20a2ca984..3bd5a14a7 100644 ---- a/library/unwind/src/lib.rs -+++ b/library/unwind/src/lib.rs -@@ -37,7 +37,7 @@ cfg_if::cfg_if! { - } - } - --#[cfg(target_env = "musl")] -+#[cfg(target_env = "noop")] - #[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))] - #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] - extern "C" {} diff --git a/testing/rust/sources b/testing/rust/sources deleted file mode 100644 index 72614b9d..00000000 --- a/testing/rust/sources +++ /dev/null @@ -1,6 +0,0 @@ -https://static.rust-lang.org/dist/rustc-1.47.0-src.tar.xz -https://static.rust-lang.org/dist/2020-08-27/rust-std-1.46.0-x86_64-unknown-linux-musl.tar.xz?no-extract -https://static.rust-lang.org/dist/2020-08-27/rustc-1.46.0-x86_64-unknown-linux-musl.tar.xz?no-extract -https://static.rust-lang.org/dist/2020-08-27/cargo-0.47.0-x86_64-unknown-linux-musl.tar.xz?no-extract -patches/musl.patch -patches/libressl-3.1.X.patch diff --git a/testing/rust/version b/testing/rust/version deleted file mode 100644 index 50c78713..00000000 --- a/testing/rust/version +++ /dev/null @@ -1 +0,0 @@ -1.47.0 1