Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Mar 2018 09:37:39 +0000 (UTC)
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r465789 - in head/devel/boost-jam: . files
Message-ID:  <201803280937.w2S9bdgD049991@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tijl
Date: Wed Mar 28 09:37:38 2018
New Revision: 465789
URL: https://svnweb.freebsd.org/changeset/ports/465789

Log:
  - Add a patch to make bjam call poll with timeout -1 instead of 0 so it
    doesn't use so much CPU time.  This cuts the build time of boost-libs
    in half for non-parallel builds.
  - Add support for WITH_DEBUG.

Added:
  head/devel/boost-jam/files/
  head/devel/boost-jam/files/patch-debugger.c   (contents, props changed)
  head/devel/boost-jam/files/patch-execunix.c   (contents, props changed)
Modified:
  head/devel/boost-jam/Makefile

Modified: head/devel/boost-jam/Makefile
==============================================================================
--- head/devel/boost-jam/Makefile	Wed Mar 28 09:33:24 2018	(r465788)
+++ head/devel/boost-jam/Makefile	Wed Mar 28 09:37:38 2018	(r465789)
@@ -2,13 +2,14 @@
 # $FreeBSD$
 
 PORTNAME=	boost-jam
+PORTREVISION=	1
 COMMENT=	Build tool from the boost.org
 
 PLIST_FILES=	bin/bjam
 
 EXTRACT_AFTER_ARGS=	${DISTNAME}/${WRKSRC_SUBDIR}
 MAKE_CMD=	./build.sh
-ALL_TARGET=	cc
+ALL_TARGET=	cc ${WITH_DEBUG:D--debug}
 MAKE_FLAGS=	#
 _MAKE_JOBS=	#
 MAKEFILE=	#

Added: head/devel/boost-jam/files/patch-debugger.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/boost-jam/files/patch-debugger.c	Wed Mar 28 09:37:38 2018	(r465789)
@@ -0,0 +1,20 @@
+--- debugger.c.orig	2017-12-13 23:56:50 UTC
++++ debugger.c
+@@ -1102,7 +1102,7 @@ static void debug_start_child( int argc, const char * 
+     PROCESS_INFORMATION pi = { NULL, NULL, 0, 0 };
+     STARTUPINFO si = { sizeof( STARTUPINFO ), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+         0, 0, 0, 0, 0, 0 };
+-    assert( DEBUG_STATE == DEBUG_NO_CHILD );
++    assert( debug_state == DEBUG_NO_CHILD );
+     if ( ! CreatePipe( &pipe1[ 0 ], &pipe1[ 1 ], &sa, 0 ) )
+     {
+         printf("internal error\n");
+@@ -1189,7 +1189,7 @@ static void debug_start_child( int argc, const char * 
+     int read_fd;
+     int pid;
+     int i;
+-    assert( DEBUG_STATE == DEBUG_NO_CHILD );
++    assert( debug_state == DEBUG_NO_CHILD );
+     pipe(pipe1);
+     pipe(pipe2);
+     pid = fork();

Added: head/devel/boost-jam/files/patch-execunix.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/boost-jam/files/patch-execunix.c	Wed Mar 28 09:37:38 2018	(r465789)
@@ -0,0 +1,56 @@
+--- execunix.c.orig	2017-12-13 23:56:50 UTC
++++ execunix.c
+@@ -445,9 +445,7 @@ void exec_wait()
+     while ( !finished )
+     {
+         int i;
+-        struct timeval tv;
+-        struct timeval * ptv = NULL;
+-        int select_timeout = globs.timeout;
++        int poll_timeout = -1;
+ 
+         /* Check for timeouts:
+          *   - kill children that already timed out
+@@ -457,6 +455,7 @@ void exec_wait()
+         {
+             struct tms buf;
+             clock_t const current = times( &buf );
++            poll_timeout = globs.timeout;
+             for ( i = 0; i < globs.jobs; ++i )
+                 if ( cmdtab[ i ].pid )
+                 {
+@@ -467,28 +466,21 @@ void exec_wait()
+                         killpg( cmdtab[ i ].pid, SIGKILL );
+                         cmdtab[ i ].exit_reason = EXIT_TIMEOUT;
+                     }
+-                    else if ( globs.timeout - consumed < select_timeout )
+-                        select_timeout = globs.timeout - consumed;
++                    else if ( globs.timeout - consumed < poll_timeout )
++                        poll_timeout = globs.timeout - consumed;
+                 }
+-
+-            /* If nothing else causes our select() call to exit, force it after
+-             * however long it takes for the next one of our child processes to
+-             * crossed its alloted processing time so we can terminate it.
+-             */
+-            tv.tv_sec = select_timeout;
+-            tv.tv_usec = 0;
+-            ptv = &tv;
++            poll_timeout *= 1000;
+         }
+ 
+-        /* select() will wait for I/O on a descriptor, a signal, or timeout. */
++        /* poll() will wait for I/O on a descriptor, a signal, or timeout. */
+         {
+-            /* disable child termination signals while in select */
++            /* disable child termination signals while in poll */
+             int ret;
+             sigset_t sigmask;
+             sigemptyset(&sigmask);
+             sigaddset(&sigmask, SIGCHLD);
+             sigprocmask(SIG_BLOCK, &sigmask, NULL);
+-            while ( ( ret = poll( wait_fds, WAIT_FDS_SIZE, select_timeout * 1000 ) ) == -1 )
++            while ( ( ret = poll( wait_fds, WAIT_FDS_SIZE, poll_timeout ) ) == -1 )
+                 if ( errno != EINTR )
+                     break;
+             /* restore original signal mask by unblocking sigchld */



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