Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Mar 2009 04:02:23 +0300
From:      Dmitry Marakasov <amdmi3@amdmi3.ru>
To:        Pav Lucistnik <pav@FreeBSD.org>
Cc:        ports@FreeBSD.org
Subject:   Re: HEADS UP multi processor compilations for everyone
Message-ID:  <20090327010223.GK1964@hades.panopticon>
In-Reply-To: <1238108060.268.1.camel@hood.oook.cz>
References:  <1237901632.1849.19.camel@pav.hide.vol.cz> <20090326174632.GB19722@hades.panopticon> <1238108060.268.1.camel@hood.oook.cz>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <amdmi3@FreeBSD.org>
#
# $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 <bsd.port.mk>

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090327010223.GK1964>