not trying to rebuild failled ports ?

Joe Marcus Clarke marcus at marcuscom.com
Wed May 14 21:19:04 EDT 2008


[Re-adding the list]

On Wed, 2008-05-14 at 17:37 +0300, Ion-Mihai Tetcu wrote:
> On Tue, 13 May 2008 20:17:25 -0400
> Joe Marcus Clarke <marcus at marcuscom.com> wrote:
> 
> > On Tue, 2008-05-13 at 16:45 +0300, Ion-Mihai Tetcu wrote:
> > > On Tue, 13 May 2008 09:21:49 -0400
> > > Joe Marcus Clarke <marcus at marcuscom.com> wrote:
> > > 
> > > > On Tue, 2008-05-13 at 10:50 +0300, Ion-Mihai Tetcu wrote:
> > > > > Hi,
> > > > > 
> > > > > 
> > > > > I'm running an exp build on one of my tindys. I have to build all ports.
> > > > > 
> > > > > I'm building them like:
> > > > > ./tc addPort -b ${_build} -r -d ${PORT} -o
> > > > > ./tinderbuild -noduds  -nullfs -plistcheck -b ${_build} ${PORT}
> > > > > 
> > > > > I'd like two things:
> > > > > - not to rebuild ports already build OK (I guess I can check this from
> > > > > my build script be interrogating the database and skip the port if it
> > > > > was built OK)
> > > > > - have tindy not trying to rebuild ports that already failed: if the
> > > > > port was already tried before (either via ./tinderbuild or as a
> > > > > dependency of an other port) I don't want tindy to loose time trying to
> > > > > rebuild it since it will fail for sure.
> > > > > 
> > > > > Any way to achieve this ?
> > > > 
> > > > I assume if there were a getPortLastBuiltStatus function for tc, you
> > > > would have what you need?
> > > 
> > > That would be obviously OK for 1, but how would it help me for 2?
> > > 
> > > If A and B depends on X, it tried to build A and failed because of X,
> > > then I don't want it to try again for either ./tinderbuild X or when
> > > trying to build B. Am I missing something?
> > 
> > If port X failed, then the status of ports A and B will be DEPEND
> > indicating a dependency failed.  Port X's status will be FAIL.
> 
> I know it should be like that, but it's not what I'm seeing; maybe I
> read something wrong, but I'm pretty sure I saw it trying to rebuild
> the same port a few times (and it was one that was building for over 5
> hours). AFAIR this one:
> 
> mysql> select * from ports where Port_Name like 'ghc%';
> +---------+----------------+-----------+---------------------+------------------------------------------------+
> | Port_Id | Port_Directory | Port_Name | Port_Maintainer     | Port_Comment                                   |
> +---------+----------------+-----------+---------------------+------------------------------------------------+
> |    1743 | lang/ghc       | ghc       | haskell at FreeBSD.org | A Compiler for the functional language Haskell |
> +---------+----------------+-----------+---------------------+------------------------------------------------+
> 1 row in set (0.00 sec)
> 
> mysql> select * from build_ports where Build_Id = 5 and Port_Id = ghc \G
> ERROR 1054 (42S22): Unknown column 'ghc' in 'where clause'
> mysql> select * from build_ports where Build_Id = 5 and Port_Id = 1743 \G
> *************************** 1. row ***************************
>          Build_Port_Id: 2200
>               Build_Id: 5
>                Port_Id: 1743
>             Last_Built: 2008-05-14 00:14:24
>            Last_Status: FAIL
>       Last_Fail_Reason: mtree
>  Last_Successful_Built: NULL
>     Last_Built_Version: ghc-6.8.2_1
> Last_Failed_Dependency: NULL
>      Last_Run_Duration: 2743
>     Currently_Building: 0
> 
> 
> Now I'm seeing an other thing that I don't understand, please bear with
> me:
> 
> This is how I build the ports:
> 
> root(itetcu)@quark/_T >-SSH-> /home/itetcu [17:21:38] 0
>  # cat ~itetcu/bin/docstest.sh
> #!/bin/sh
> 
> TBROOT="/var/tinderbox"
> _build=7-STABLE-FTP
> 
> cd ${TBROOT}/portstrees/FreeBSD/ports/$1
> if [ ! -f Makefile ]; then
>         echo "No makefile in `pwd`"
>         exit 1
> fi
> 
> for _port in `cd ${TBROOT}/portstrees/FreeBSD/ports/$1 && make -V SUBDIR`; do
>         PORT=$1/${_port}
>         cd ${TBROOT}/portstrees/FreeBSD/ports/${PORT}
>         pkgname=`make -V PKGNAME`
>         echo "=============> ${PORT}"
>         rm -f ${TBROOT}/packages/${_build}/All/${pkgname}.t*
>         cd ${TBROOT}/scripts
>         ./tc addPort -b ${_build} -r -d ${PORT} -o
>         ./tinderbuild -noduds  -nullfs -plistcheck -b ${_build} ${PORT}
> done
> 
> echo | mail -s "NO* Tinderbuild for $1 done" itetcu
> 
> 
> Invoked as:
> root(itetcu)@quark/_T >-SSH-> /home/itetcu [17:23:36] 0
>  # ps axwww | grep docstest.sh
> 22574  p4  I+     0:01.11 /bin/sh /home/itetcu/bin/docstest.sh devel
> 
> 
> It's currently at:
> 
> =============> devel/nx
> mount_nullfs: /var/tinderbox/portstrees/FreeBSD/ports (/var/tinderbox/portstrees/FreeBSD/ports) and /var/tinderbox/portstrees/FreeBSD/ports are not distinct paths
> mount_nullfs: /var/tinderbox/jails/7 (/var/tinderbox/jails/7) and /var/tinderbox/jails/7/src are not distinct paths
> mount_nullfs: /var/tinderbox/portstrees/FreeBSD/ports (/var/tinderbox/portstrees/FreeBSD/ports) and /var/tinderbox/portstrees/FreeBSD/ports are not distinct paths
> mount_nullfs: /var/tinderbox/jails/7 (/var/tinderbox/jails/7) and /var/tinderbox/jails/7/src are not distinct paths
> INFO: Creating build directory for 7-STABLE-FTP from repository...
> ================================================
> building packages (phase 1)
> ================================================
> started at Wed May 14 16:37:00 EEST 2008
> 
> 
> An now it's rebuilding gcc:
> 
> Build		Port			Duration 	ETA
> 7-STABLE-FTP	gcc-4.2.4_20080430 	40:57		12:08
> 
> 
> mysql> select * from build_ports where Build_Id = 5 and Port_Id = 995 \G
> *************************** 1. row ***************************
>          Build_Port_Id: 2708
>               Build_Id: 5
>                Port_Id: 995
>             Last_Built: 2008-05-12 07:59:45
>            Last_Status: SUCCESS
>       Last_Fail_Reason: __nofail__
>  Last_Successful_Built: 2008-05-12 07:59:45
>     Last_Built_Version: gcc-4.2.4_20080430
> Last_Failed_Dependency: NULL
>      Last_Run_Duration: 3185
>     Currently_Building: 1
> 
> root(itetcu)@quark/_T >-SSH-> /home/itetcu [17:24:30] 0
>  # ll /usr/local/tinderbox/packages/7-STABLE-FTP/All/gcc-4.2.4_20080430.tbz
> -rw-r--r--  1 root  wheel  24230125 May 12 07:59 /usr/local/tinderbox/packages/7-STABLE-FTP/All/gcc-4.2.4_20080430.tbz
> 
> I _did_not_ update the PT nor the Jail for the Build since I started the
> docstes.sh script. I did rebuild an other Jail and built other ports on
> other Builds.
> 
> Why is it rebuilding it ?
> 
> 
> mysql> select * from config;
> +--------------------+---------------------------------------+---------+
> | Config_Option_Name | Config_Option_Value                   | Host_Id |
> +--------------------+---------------------------------------+---------+
> | CCACHE_DIR         |                                       |      -1 |
> | CCACHE_ENABLED     | 0                                     |      -1 |
> | CCACHE_JAIL        | 0                                     |      -1 |
> | CCACHE_LOGFILE     |                                       |      -1 |
> | CCACHE_MAX_SIZE    | 1G                                    |      -1 |
> | CCACHE_NOLINK      | 1                                     |      -1 |
> | DISTFILE_CACHE     | /var/ftp/pub/FreeBSD/ports/distfiles/ |      -1 |
> | JAIL_OBJDIR        |                                       |      -1 |
> | OPTIONS_DIR        | /options                              |      -1 |
> | OPTIONS_ENABLED    | 0                                     |      -1 |
> | TINDERD_SLEEPTIME  | 60                                    |      -1 |
> | __DSVERSION__      | 2.4.0                                 |      -1 |
> +--------------------+---------------------------------------+---------+
> 
> 
> root(itetcu)@quark/_T >-SSH-> /home/itetcu [17:34:08] 0
>  # ll /usr/local/ | grep tinder
> lrwxr-xr-x   1 root   wheel    14 May 14  2006 tinderbox -> /var/tinderbox

I think your two problems may be related.  Say A depends on X.  A comes
first, so it gets built.  In order to build A, you need to build X.  So
now A and X are built.  Except, your script has already determined it
needs to build X.  So, it feeds X to tinderbuild.  One of tinderbuild's
features is that it will rebuild the port passed to it on the command
line EVERY TIME (i.e. regardless of whether or not the package is
up-to-date; see line 176 in tinderbuild).  I'm willing to make this
configurable, though.

Therefore, I think you need to add another check as to whether or not
each port was built in this pass.  If so, skip it.

I don't know if you'll be at BSDCan this week, but if so, we can discuss
TB some more if you'd like.

Joe

-- 
PGP Key : http://www.marcuscom.com/pgp.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://marcuscom.com/pipermail/tinderbox-list/attachments/20080514/f0923887/attachment.bin 


More information about the tinderbox-list mailing list