On 2019/12/04 14:29, Marc Espie wrote:
> On Wed, Dec 04, 2019 at 12:55:33PM +0000, Stuart Henderson wrote:
> > On 2019/12/04 12:43, Christian Weisgerber wrote:
> > > On 2019-12-03, Antoine Jacoutot <ajacoutot@bsdfrog.org> wrote:
> > >
> > > >> # XXX libreoffice has its own way to build things in parallel
> > > >> USES_PARALLEL_MAKE = No
> > > >>
> > > >> ?
> > > >
> > > > +1
> > >
> > > Like USES_GMAKE, USES_GROFF, USES_LIBTOOL, ...?
> >
> > hmm, fair point.
> >
> > Perhaps we could do something like this instead, and set PARALLEL_MAKE_FLAGS
> > to nothing in libreoffice etc.
> >
> > (I'm unsure about ALL_FAKE_FLAGS, I don't think anything currently
> > uses PARALLEL_INSTALL=No, but there have been cases before where
> > parallel-build is OK but parallel-install isn't).
>
> None of them uses DPB_PROPERTIES=parallel
>
> dpb thinks there are n jobs per machine during fake, only package becomes
> single job.
>
> I'm okay with your version.
>
> Let's get this in before it turns into the bike-shed from hell
>
So here's a diff with the various parts for ports, including removing
the pseudo flavour for libreoffice, I've quickly edited README.internals
but not manpages.
I'm not sure about the change in default behaviour though, it means
that unless you set PARALLEL_MAKE_JOBS explicitly, it will now build
with hw.ncpuonline by default for all DPB_PROPERTIES=parallel ports.
This won't get well on smaller-memory machines.
Index: devel/jdk/1.8/Makefile
===================================================================
RCS file: /cvs/ports/devel/jdk/1.8/Makefile,v
retrieving revision 1.48
diff -u -p -r1.48 Makefile
--- devel/jdk/1.8/Makefile 21 Nov 2019 17:39:08 -0000 1.48
+++ devel/jdk/1.8/Makefile 4 Dec 2019 16:15:38 -0000
@@ -84,7 +84,7 @@ USE_GMAKE= Yes
GMAKE= ${LOCALBASE}/bin/gmake
# Don't call make -jN, instead pass MAKE_JOBS to --with-jobs
-PARALLEL_BUILD= No
+PARALLEL_MAKE_FLAGS=
CONFIGURE_STYLE=gnu
CONFIGURE_ARGS= --disable-option-checking \
Index: devel/jdk/11/Makefile
===================================================================
RCS file: /cvs/ports/devel/jdk/11/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- devel/jdk/11/Makefile 26 Oct 2019 17:04:15 -0000 1.11
+++ devel/jdk/11/Makefile 4 Dec 2019 16:15:38 -0000
@@ -84,7 +84,7 @@ USE_GMAKE= Yes
GMAKE= ${LOCALBASE}/bin/gmake
# Don't call make -jN, instead pass MAKE_JOBS to --with-jobs
-PARALLEL_BUILD= No
+PARALLEL_MAKE_FLAGS=
CONFIGURE_STYLE=gnu
CONFIGURE_ENV+= AUTOCONF_VERSION=${AUTOCONF_VERSION} \
Index: editors/libreoffice/Makefile
===================================================================
RCS file: /cvs/ports/editors/libreoffice/Makefile,v
retrieving revision 1.221
diff -u -p -r1.221 Makefile
--- editors/libreoffice/Makefile 6 Nov 2019 12:21:06 -0000 1.221
+++ editors/libreoffice/Makefile 4 Dec 2019 16:15:38 -0000
@@ -136,7 +136,7 @@ PERMIT_PACKAGE= Yes
MULTI_PACKAGES= -main -java -kde
-PSEUDO_FLAVORS= parallel no_lang
+PSEUDO_FLAVORS= no_lang
FLAVORS= debug no_java
FLAVOR?=
@@ -354,15 +354,8 @@ CONFIGURE_ARGS+=--without-java
.endif
# XXX libreoffice has its own way to build things in parallel
-PARALLEL_BUILD = No
-.if defined(MAKE_JOBS)
-NCPU= ${MAKE_JOBS}
-.elif ${FLAVOR:Mparallel}
-NCPU!= echo $$((`sysctl -n hw.ncpuonline` + 1))
-.else
-NCPU= 1
-.endif
-CONFIGURE_ARGS+=--with-parallelism=${NCPU}
+PARALLEL_MAKE_FLAGS =
+CONFIGURE_ARGS+=--with-parallelism=${MAKE_JOBS}
.if ${FLAVOR:Mdebug}
CONFIGURE_ARGS+=--enable-debug
Index: infrastructure/mk/bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1509
diff -u -p -r1.1509 bsd.port.mk
--- infrastructure/mk/bsd.port.mk 2 Dec 2019 18:59:03 -0000 1.1509
+++ infrastructure/mk/bsd.port.mk 4 Dec 2019 16:15:38 -0000
@@ -454,21 +454,23 @@ ALL_FAKE_FLAGS= ${MAKE_FLAGS:N-j[0-9]*}
_PKG_ADD += -L ${LOCALBASE}
.endif
-# XXX this stuff is not production-ready, because there are too many bugs in
-# parallel make yet. MAKE_JOBS>1 is known to work on a few ports and used
-# sparingly by dpb (DPB_PROPERTIES=parallel) for obvious gains.
+# XXX there are still many bugs in parallel make.
+# so MAKE_JOBS is used sparingly by dpb for obvious gains.
#
-PARALLEL_BUILD ?= Yes
-PARALLEL_INSTALL ?= ${PARALLEL_BUILD}
+PARALLEL_MAKE_FLAGS ?= -j${MAKE_JOBS}
+
+.if !defined(MAKE_JOBS) && ${DPB_PROPERTIES:Mparallel})
+. if defined(PARALLEL_MAKE_JOBS)
+MAKE_JOBS = ${PARALLEL_MAKE_JOBS}
+. else
+MAKE_JOBS !!= sysctl -n hw.ncpuonline
+. endif
+.endif
MAKE_JOBS ?= 1
.if ${MAKE_JOBS} != 1
-. if ${PARALLEL_BUILD:L} == "yes"
-MAKE_FLAGS += -j${MAKE_JOBS}
-. endif
-. if ${PARALLEL_INSTALL:L} == "yes"
-ALL_FAKE_FLAGS += -j${MAKE_JOBS}
-. endif
+MAKE_FLAGS += ${PARALLEL_MAKE_FLAGS}
+ALL_FAKE_FLAGS += ${PARALLEL_MAKE_FLAGS}
.endif
# Here comes the part that sets BUILD_PACKAGES and various IGNORE* up.
Index: infrastructure/mk/README.internals
===================================================================
RCS file: /cvs/ports/infrastructure/mk/README.internals,v
retrieving revision 1.16
diff -u -p -r1.16 README.internals
--- infrastructure/mk/README.internals 1 Dec 2019 09:36:29 -0000 1.16
+++ infrastructure/mk/README.internals 4 Dec 2019 16:15:39 -0000
@@ -437,15 +437,16 @@ _PERL_FIX_SHAR make visible ?
TODO fully document:
MAKE_JOBS
PARALLEL_BUILD
- PARALLEL_INSTALL
XAUTHORITY for interactive tests
-MAKE_JOBS is set by dpb based on DPB_PROPERTIES=parallel
-PARALLEL_BUILD is currently used to control passing MAKE_JOBS as make -j.
-(some ports do MAKE_JOBS differently: libreoffice, jdk)
+MAKE_JOBS is set by dpb based on DPB_PROPERTIES=parallel or can be set
+by the user. When MAKE_JOBS is >1, PARALLEL_MAKE_FLAGS is added to
+MAKE_FLAGS, by default this contains -j${MAKE_JOBS} which works for
+most ports. Some ports do MAKE_JOBS differently (libreoffice, jdk),
+in those cases "make -j" is not wanted, so PARALLEL_MAKE_FLAGS
+should be explicitly cleared.
Probably time to rename that and really document it.
-PARALLEL_INSTALL is unused.
fishy: FLAVORS tests ?
fishy: TEST_STATUS_IGNORE
No comments:
Post a Comment