pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Fix for slowness in lang/rustc build



On Thu, 7 Dec 2017, Paul Goyette wrote:

From openbsd...

https://github.com/openbsd/ports/blob/531b5386c37986fc51debc97a2cb9e651ba3fea5/lang/rust/patches/patch-src_bootstrap_lib_rs


With the recent inclusion of a "private" copy of llvm, it was being built with no optimization. This made the build very slow, by a factor between 4 and 10 depending on the build host. (On my machine, the time to build increased from about 1 hour to nearly 4.5 hours! Another user reported a 10x time increase.)

By allowing llvm to be build with default optimization, the build time on my system is back down to a more acceptable

[insert] 1 hour, the same as it was before using the built-in llvm.

NOTE that independent of the optimization stuff, I am seeing a discrepancy in the size and checksums of the distribution file

	rust-1.21.0-i686-unknown-linux-gnu.tar.gz

(It had to download this file when I did 'make distinfo' in order
to include the new patch file.)

You might want to investigate.


Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/lang/rust/distinfo,v
retrieving revision 1.11
diff -u -p -r1.11 distinfo
--- distinfo	28 Nov 2017 00:07:27 -0000	1.11
+++ distinfo	7 Dec 2017 11:27:43 -0000
@@ -53,6 +53,7 @@ RMD160 (rustc-1.22.1-src.tar.gz) = 1b2a3
SHA512 (rustc-1.22.1-src.tar.gz) = cb1f0f5643c5244225255030bef974eb8d642c9a9f04d3a1ba44157b3848ca2ee0c1b96160c19e6e0e110d0065836f99936f00678690840aa8f34e22ecece874
Size (rustc-1.22.1-src.tar.gz) = 54935620 bytes
SHA1 (patch-src_bootstrap_bin_rustc.rs) = 617cc7ae52d92fdf80af0aff169c17a9cec4d67c
+SHA1 (patch-src_bootstrap_lib_rs) = 3a98942f786c1153864bdcfa40919045a059d4ae
SHA1 (patch-src_libbacktrace_configure) = b2c1e9b93a99408aad42ab9f1af27704cc81bdd8
SHA1 (patch-src_libstd_build.rs) = 32dad8a474300f9f37bce8b92acca762cf8cc4ab
SHA1 (patch-src_llvm_cmake_modules_AddLLVM.cmake) = 282d97cce8d01cfefe565185d4999c2db9ccc13f
Index: patches/patch-src_bootstrap_lib_rs
===================================================================
RCS file: patches/patch-src_bootstrap_lib_rs
diff -N patches/patch-src_bootstrap_lib_rs
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_bootstrap_lib_rs	7 Dec 2017 11:27:43 -0000
@@ -0,0 +1,12 @@
+$NetBSD$
+Don't disable optimization
+--- src/bootstrap/lib.rs.orig 2017-11-23 05:33:00.000000000 +0800
++++ src/bootstrap/lib.rs      2017-12-07 18:56:15.094285343 +0800
+@@ -622,7 +622,6 @@
+ // cc-rs because the build scripts will determine that for themselves.
+         let mut base = self.cc[&target].0.args().iter()
+                            .map(|s| s.to_string_lossy().into_owned())
+- .filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))
+                            .collect::<Vec<_>>();
+ + // If we're compiling on macOS then we add a few unconditional flags



+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+


+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+


Home | Main Index | Thread Index | Old Index