summaryrefslogtreecommitdiffstats
path: root/source/d/rust
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2019-11-19 06:15:35 +0000
committer Eric Hameleers <alien@slackware.com>2019-11-19 17:59:50 +0100
commit7ee27456e2684ea8fc924497c44049dd1ad15925 (patch)
tree5db715363fb47527d22cceea2e75ce33cedc3924 /source/d/rust
parentfa3f92ac782f8531079bf9584fe6714fc3d7c5ed (diff)
downloadcurrent-7ee27456e2684ea8fc924497c44049dd1ad15925.tar.gz
current-7ee27456e2684ea8fc924497c44049dd1ad15925.tar.xz
Tue Nov 19 06:15:35 UTC 201920191119061535
d/rust-1.39.0-x86_64-1.txz: Upgraded.
Diffstat (limited to 'source/d/rust')
-rw-r--r--source/d/rust/0001-WIP-minimize-the-rust-std-component.patch55
-rw-r--r--source/d/rust/hack.diff29
-rwxr-xr-xsource/d/rust/rust.SlackBuild23
-rw-r--r--source/d/rust/rust.url14
4 files changed, 105 insertions, 16 deletions
diff --git a/source/d/rust/0001-WIP-minimize-the-rust-std-component.patch b/source/d/rust/0001-WIP-minimize-the-rust-std-component.patch
new file mode 100644
index 00000000..e46a7265
--- /dev/null
+++ b/source/d/rust/0001-WIP-minimize-the-rust-std-component.patch
@@ -0,0 +1,55 @@
+--- ./src/bootstrap/dist.rs.orig 2019-11-07 16:25:16.099477103 -0600
++++ ./src/bootstrap/dist.rs 2019-11-07 16:31:36.510445625 -0600
+@@ -675,36 +675,28 @@
+ 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 {
+- builder.ensure(compile::Std { compiler, target });
+- }
++ builder.ensure(compile::Std { compiler, target });
++ builder.ensure(compile::Rustc { 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::librustc_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")
diff --git a/source/d/rust/hack.diff b/source/d/rust/hack.diff
new file mode 100644
index 00000000..c5031fb0
--- /dev/null
+++ b/source/d/rust/hack.diff
@@ -0,0 +1,29 @@
+--- ./src/bootstrap/dist.rs.orig 2019-11-07 18:12:33.835944390 -0600
++++ ./src/bootstrap/dist.rs 2019-11-07 22:05:17.991788876 -0600
+@@ -676,7 +676,6 @@
+ }
+
+ builder.ensure(compile::Std { compiler, target });
+- builder.ensure(compile::Rustc { compiler, target });
+
+ let image = tmpdir(builder).join(format!("{}-{}-image", name, target));
+ let _ = fs::remove_dir_all(&image);
+@@ -691,12 +690,12 @@
+ builder.copy(&path, &dst.join(path.file_name().unwrap()));
+ }
+ }
+- let stamp = dbg!(compile::librustc_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 stamp = dbg!(compile::librustc_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")
diff --git a/source/d/rust/rust.SlackBuild b/source/d/rust/rust.SlackBuild
index 7e6b3dbc..2dee9b21 100755
--- a/source/d/rust/rust.SlackBuild
+++ b/source/d/rust/rust.SlackBuild
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 2017 Andrew Clemons, Wellington, New Zealand
-# Copyright 2017, 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2017, 2018, 2019 Patrick J. Volkerding, Sebeka, Minnesota, USA
# Copyright 2017 Stuart Winter
# All rights reserved.
#
@@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=rust
SRCNAM="${PKGNAM}c"
-VERSION=${VERSION:-1.37.0}
+VERSION=${VERSION:-1.39.0}
BUILD=${BUILD:-1}
# Set this to YES to build with the system LLVM, or NO to use the bundled LLVM.
@@ -34,9 +34,9 @@ BUILD=${BUILD:-1}
SYSTEM_LLVM=${SYSTEM_LLVM:-YES}
# Bootstrap variables (might not be kept updated for latest Rust):
-RSTAGE0_VERSION=${RSTAGE0_VERSION:-1.36.0}
-RSTAGE0_DIR=${RSTAGE0_DIR:-2019-07-04}
-CSTAGE0_VERSION=${CSTAGE0_VERSION:-0.37.0}
+RSTAGE0_VERSION=${RSTAGE0_VERSION:-1.38.0}
+RSTAGE0_DIR=${RSTAGE0_DIR:-2019-09-26}
+CSTAGE0_VERSION=${CSTAGE0_VERSION:-0.39.0}
CSTAGE0_DIR=${CSTAGE0_DIR:-$RSTAGE0_DIR}
# Automatically determine the architecture we're building on:
@@ -148,6 +148,10 @@ if [ "${SYSTEM_LLVM}" = "YES" ]; then
zcat $CWD/link_libffi.diff.gz | patch -p1 --verbose || exit 1
fi
+# Try to debloat the build:
+zcat $CWD/0001-WIP-minimize-the-rust-std-component.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/hack.diff.gz | patch -p1 --verbose || exit 1
+
if [ "$LOCAL_BOOTSTRAP" != "yes" ] ; then
# rust requires bootstrapping with the previous rust version.
# versions are defined in src/stage0.txt.
@@ -165,6 +169,7 @@ fi
cat << EOF > config.toml
[llvm]
ccache = "/usr/bin/ccache"
+link-shared = true
[build]
build = "$BARCH-unknown-linux-$BABI"
@@ -213,9 +218,9 @@ fi
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
+ -o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
export PKG_CONFIG_ALLOW_CROSS=1
@@ -263,7 +268,7 @@ sed -i "s,/tmp/package-rust/,/,g" $PKG/usr/lib$LIBDIRSUFFIX/rustlib/install.log
gzip -9 $PKG/usr/lib$LIBDIRSUFFIX/rustlib/manifest-*
# Correct permissions on shared libraries:
-find $PKG/usr/lib$LIBDIRSUFFIX -name "*.so" -exec chmod 755 "{}" \;
+find $PKG/usr/lib$LIBDIRSUFFIX -name "*.so" -exec chmod 755 "{}" \+
# Evidently there are a lot of duplicated libraries in this tree, so let's
# try to save some space:
@@ -280,7 +285,7 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
done
# Compress man pages:
-find $PKG/usr/man -type f -exec gzip -9 {} \;
+find $PKG/usr/man -type f -exec gzip -9 {} \+
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
# Add some documentation:
diff --git a/source/d/rust/rust.url b/source/d/rust/rust.url
index de0c3c01..a6838aff 100644
--- a/source/d/rust/rust.url
+++ b/source/d/rust/rust.url
@@ -1,5 +1,5 @@
# Source code (repacked to .tar.xz):
-lftpget https://static.rust-lang.org/dist/rustc-1.37.0-src.tar.gz
+lftpget https://static.rust-lang.org/dist/rustc-1.39.0-src.tar.gz
gzip -d rustc-*tar.gz
plzip -9 -v rustc-*tar
@@ -12,12 +12,12 @@ plzip -9 -v rustc-*tar
exit 0
# i686 bootstrap:
-lftpget https://static.rust-lang.org/dist/2019-07-04/cargo-0.37.0-i686-unknown-linux-gnu.tar.gz
-lftpget https://static.rust-lang.org/dist/2019-07-04/rust-std-1.36.0-i686-unknown-linux-gnu.tar.gz
-lftpget https://static.rust-lang.org/dist/2019-07-04/rustc-1.36.0-i686-unknown-linux-gnu.tar.gz
+lftpget https://static.rust-lang.org/dist/2019-09-26/cargo-0.39.0-i686-unknown-linux-gnu.tar.gz
+lftpget https://static.rust-lang.org/dist/2019-09-26/rust-std-1.38.0-i686-unknown-linux-gnu.tar.gz
+lftpget https://static.rust-lang.org/dist/2019-09-26/rustc-1.38.0-i686-unknown-linux-gnu.tar.gz
# x86_64 bootstrap:
-lftpget https://static.rust-lang.org/dist/2019-07-04/cargo-0.37.0-x86_64-unknown-linux-gnu.tar.gz
-lftpget https://static.rust-lang.org/dist/2019-07-04/rust-std-1.36.0-x86_64-unknown-linux-gnu.tar.gz
-lftpget https://static.rust-lang.org/dist/2019-07-04/rustc-1.36.0-x86_64-unknown-linux-gnu.tar.gz
+lftpget https://static.rust-lang.org/dist/2019-09-26/cargo-0.39.0-x86_64-unknown-linux-gnu.tar.gz
+lftpget https://static.rust-lang.org/dist/2019-09-26/rust-std-1.38.0-x86_64-unknown-linux-gnu.tar.gz
+lftpget https://static.rust-lang.org/dist/2019-09-26/rustc-1.38.0-x86_64-unknown-linux-gnu.tar.gz