pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/rust rust: Set CARGO_BUILD_JOBS to MAKE_JOBS.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/17fc9cc2e62c
branches:  trunk
changeset: 310132:17fc9cc2e62c
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Fri Jul 06 08:22:53 2018 +0000

description:
rust: Set CARGO_BUILD_JOBS to MAKE_JOBS.

cargo defaults to using the number of CPUs detected on the host machine, which
is a terrible heuristic and can easily lead to DRAM exhaustion, especially in a
zones environment where you have access to the full number of CPUs but will be
limited to a portion of available DRAM.

Tidy up a SunOS section while here.

diffstat:

 lang/rust/Makefile |  17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diffs (43 lines):

diff -r d56361cb0a30 -r 17fc9cc2e62c lang/rust/Makefile
--- a/lang/rust/Makefile        Fri Jul 06 08:11:37 2018 +0000
+++ b/lang/rust/Makefile        Fri Jul 06 08:22:53 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.40 2018/07/04 13:40:22 jperkin Exp $
+# $NetBSD: Makefile,v 1.41 2018/07/06 08:22:53 jperkin Exp $
 
 DISTNAME=      rustc-1.27.0-src
 PKGNAME=       ${DISTNAME:S/rustc/rust/:S/-src//}
@@ -31,11 +31,15 @@
 CONFIGURE_ARGS+=       --disable-dist-src
 CONFIGURE_ARGS+=       --disable-llvm-static-stdcpp
 CONFIGURE_ARGS+=       --disable-ninja
+CONFIGURE_ARGS.SunOS+= --disable-jemalloc
 
 # This should allow us to perform "offline" builds (so cargo doesn't fetch
 # dependencies during the build stage) but this isn't hooked up yet.
 CONFIGURE_ARGS+=       --enable-vendor
 
+# cargo defaults to using the number of available CPUs
+MAKE_ENV+=             CARGO_BUILD_JOBS=${MAKE_JOBS:U1}
+
 UNLIMIT_RESOURCES+=    cputime
 
 PYTHON_VERSIONS_ACCEPTED=      27
@@ -57,17 +61,6 @@
 BUILDLINK_TRANSFORM.NetBSD+=   rm:-Wl,--enable-new-dtags
 
 #
-# Use bundled LLVM and libumem on SunOS.
-#
-.if ${OPSYS} == "SunOS"
-CONFIGURE_ARGS+=       --disable-jemalloc
-.else
-#CONFIGURE_ARGS+=      --llvm-root=${BUILDLINK_PREFIX.llvm}
-#BUILDLINK_API_DEPENDS.llvm+=  llvm>=4.0.1nb1
-#.include "../../lang/llvm/buildlink3.mk"
-.endif
-
-#
 # Rust unfortunately requires itself to build.  On platforms which aren't
 # supported by upstream (where they offer binary bootstraps), or where we do
 # not trust random binaries from the Internet, we need to build and provide our



Home | Main Index | Thread Index | Old Index