From owner-freebsd-ports@FreeBSD.ORG Fri Mar 27 01:03:38 2009 Return-Path: Delivered-To: ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3F3F1065673; Fri, 27 Mar 2009 01:03:37 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2C1FB8FC13; Fri, 27 Mar 2009 01:03:37 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Ln0Tw-0007Hc-8V; Fri, 27 Mar 2009 04:03:36 +0300 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id 9D0ACD8AE; Fri, 27 Mar 2009 04:01:49 +0300 (MSK) Received: by hades.panopticon (Postfix, from userid 1000) id ECA9910883C; Fri, 27 Mar 2009 04:02:23 +0300 (MSK) Date: Fri, 27 Mar 2009 04:02:23 +0300 From: Dmitry Marakasov To: Pav Lucistnik Message-ID: <20090327010223.GK1964@hades.panopticon> References: <1237901632.1849.19.camel@pav.hide.vol.cz> <20090326174632.GB19722@hades.panopticon> <1238108060.268.1.camel@hood.oook.cz> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1UWUbFP1cBYEclgG" Content-Disposition: inline In-Reply-To: <1238108060.268.1.camel@hood.oook.cz> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: ports@FreeBSD.org Subject: Re: HEADS UP multi processor compilations for everyone X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Mar 2009 01:03:38 -0000 --1UWUbFP1cBYEclgG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline * Pav Lucistnik (pav@FreeBSD.org) wrote: > > Btw, this change broke build failures. If vendor's make fails, > > .build_done.xxx._usr_local is still created in work and $? = 0 as if it > > have succeeded. > > Can you give me a hard example? Test port consisting of a sole Makefile attached. I've made two patches for bsd.port.mk. First one fixes this issue by adding some false's to do-build, second also improves MAKE_JOBS_* handling, shortening it a bit and exposing MAKE_JOBS_NUMBER to the ports, so it can be used for other build systems without having to parse out -j from _MAKE_JOBS (and defaults to 1 if jobs support is disabled). Also, [ x != x${BUILD_FAIL_MESSAGE} ] thing seems to be a bit unsafe, and inconsistent to IGNORE/BROKEN/... vars, in which we don't use quotes. --- root@hades:test# make ===> Extracting for test-1.0 ===> Patching for test-1.0 ===> Configuring for test-1.0 (echo "all:"; echo " false") > /usr/home/amdmi3/projects/ports/test/work/Makefile ===> Building for test-1.0 false *** Error code 1 Stop in /usr/home/amdmi3/projects/ports/test/work. root@hades:test# echo $? 0 root@hades:test# ls work .build_done.test._usr_local .configure_done.test._usr_local .extract_done.test._usr_local .patch_done.test._usr_local Makefile --- -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://www.amdmi3.ru --1UWUbFP1cBYEclgG Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=Makefile # New ports collection makefile for: test # Date created: 27 Mar 2009 # Whom: Dmitry Marakasov # # $FreeBSD$ # PORTNAME= test PORTVERSION= 1.0 CATEGORIES= sysutils MASTER_SITES= #none DISTFILES= #none MAINTAINER= amdmi3@FreeBSD.org COMMENT= Empty comment NO_WRKSUBDIR= yes do-configure: (echo "all:"; echo " false") > ${WRKSRC}/Makefile .include --1UWUbFP1cBYEclgG Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="port.mk.patch" Index: bsd.port.mk =================================================================== RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/Mk/bsd.port.mk,v retrieving revision 1.614 diff -u -r1.614 bsd.port.mk --- bsd.port.mk 22 Mar 2009 10:28:53 -0000 1.614 +++ bsd.port.mk 27 Mar 2009 00:40:57 -0000 @@ -3693,16 +3693,18 @@ @(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET}; then \ if [ x != x${BUILD_FAIL_MESSAGE} ] ; then \ ${ECHO_MSG} "===> Compilation failed unexpectedly."; \ - (${ECHO_CMD} ${BUILD_FAIL_MESSAGE}) | ${FMT} 75 79 ; \ + ${ECHO_CMD} ${BUILD_FAIL_MESSAGE} | ${FMT} 75 79 ; \ fi; \ - fi) + fi; \ + false) .else @(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET}; then \ if [ x != x${BUILD_FAIL_MESSAGE} ] ; then \ ${ECHO_MSG} "===> Compilation failed unexpectedly."; \ - (${ECHO_CMD} ${BUILD_FAIL_MESSAGE}) | ${FMT} 75 79 ; \ + ${ECHO_CMD} ${BUILD_FAIL_MESSAGE} | ${FMT} 75 79 ; \ fi; \ - fi) + fi; \ + false) .endif .endif --1UWUbFP1cBYEclgG Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="port.mk.patch.1" Index: bsd.port.mk =================================================================== RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/Mk/bsd.port.mk,v retrieving revision 1.614 diff -u -r1.614 bsd.port.mk --- bsd.port.mk 22 Mar 2009 10:28:53 -0000 1.614 +++ bsd.port.mk 27 Mar 2009 01:00:38 -0000 @@ -2177,18 +2177,17 @@ # Multiple make jobs support .if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE) _MAKE_JOBS= # -.else -.if defined(MAKE_JOBS_SAFE) || defined(FORCE_MAKE_JOBS) -.if defined(MAKE_JOBS_NUMBER) -_MAKE_JOBS= -j${MAKE_JOBS_NUMBER} -.else -_MAKE_JOBS= -j`${SYSCTL} -n kern.smp.cpus` +.elif defined(MAKE_JOBS_SAFE) || defined(FORCE_MAKE_JOBS) +.if !defined(MAKE_JOBS_NUMBER) +MAKE_JOBS_NUMBER!= ${SYSCTL} -n kern.smp.cpus .endif +_MAKE_JOBS= -j${MAKE_JOBS_NUMBER} .if defined(FORCE_MAKE_JOBS) BUILD_FAIL_MESSAGE+= "You have chosen to use multiple make jobs (parallelization) for all ports. This port was not tested for this setting. Please remove FORCE_MAKE_JOBS and retry the build before reporting the failure to the maintainer." .endif .endif -.endif + +MAKE_JOBS_NUMBER?= 1 PTHREAD_CFLAGS?= PTHREAD_LIBS?= -pthread @@ -3693,16 +3692,18 @@ @(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET}; then \ if [ x != x${BUILD_FAIL_MESSAGE} ] ; then \ ${ECHO_MSG} "===> Compilation failed unexpectedly."; \ - (${ECHO_CMD} ${BUILD_FAIL_MESSAGE}) | ${FMT} 75 79 ; \ + ${ECHO_CMD} ${BUILD_FAIL_MESSAGE} | ${FMT} 75 79 ; \ fi; \ - fi) + fi; \ + false) .else @(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET}; then \ if [ x != x${BUILD_FAIL_MESSAGE} ] ; then \ ${ECHO_MSG} "===> Compilation failed unexpectedly."; \ - (${ECHO_CMD} ${BUILD_FAIL_MESSAGE}) | ${FMT} 75 79 ; \ + ${ECHO_CMD} ${BUILD_FAIL_MESSAGE} | ${FMT} 75 79 ; \ fi; \ - fi) + fi; \ + false) .endif .endif --1UWUbFP1cBYEclgG--