cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

exclude prune patch


From: Doug Alcorn
Subject: exclude prune patch
Date: 18 Apr 2001 16:53:27 -0400
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Solid Vapor)

I've got a new build environment that I didn't know best how to
handle.  After re-reading the cons on-line manual, the pruning options
from the command line looked really close to what I wanted to do.
However, what I _really_ wanted to do was the opposite of prune: if a
Conscript matches this pattern _don't_ build it.  So, here's my patch
for cons 2.2.0.

As an asside, I'll describe my source tree.  If anyone has any
suggestions of how to do it better than what I've laid out I'll be
glad to hear of it.  With the attached patch, I can do something like
this from the command line:

$ cd root
$ cons +-product2   # build all modules for product 1
$ cons +-product2 product1/server # build only the server of product 1

You might think that the last example is really no different than just
calling

$ cons product1/server

since no Conscripts that would match the pattern "product2" would
contribute to the product1/server.  However, using the exclude pattern
should probably speed up execution of cons.  With some very brief
testing of cons when it has nothing to do except evaluate Conscripts I
saw some improvement.  For instance:

$ time cons product1
$ time cons
cons: "product1" is up-to-date.

real    0m11.452s
user    0m10.990s
sys     0m0.450s
$cons +-product2 +-common product1 # changing only server/product1
cons: "product1" is up-to-date.

real    0m3.948s
user    0m3.820s
sys     0m0.130s

Arguably, it may have taken me seven seconds to think about what
directories I didn't want to compile and then type in those 20
characters to invoke the exclusion.  Even still, it's the principle
that counts.

For those of you that used to use something like "+-pattern" where the
"-" is part of the pattern, I've accounted for that.  Just use
"+\-pattern" (note that you may need to escape the '\' on the shell to
get it passed into cons).

Anyway, here's the code tree I'm working with:

* root
** product1 - directory for all derived files for product 1
*** server - server module for product1
**** server - linked to root/server
**** common - linked to root/common
**** exports - has all built libs, includes, and final executables
***** lib
***** include
*** cgi - cgi client module for product1
**** cgi - linked to root/cgi
**** common - linked to root/common
**** exports - has all built libs, includes, and final executables
***** lib
***** include
** product2 - directory for all derived files for product 2
*** server - server module for product 2
**** server - linked to root/server
**** common - linked to root/common
**** exports - has all built libs, includes, and final executables
***** lib
***** include
*** cgi - cgi client module for product 2
**** common - linked to root/common
**** exports - has all built libs, includes, and final executables
***** lib
***** include
** common - has files that are truely common to all projects and modules
        Conscript
*** DataBase - has database access file common to all projects and modules
                Conscript
*** MIME - has MIME handling code common to all projects and modules
                Conscript
*** product1 - has files that are common to all modules of product 1
                Conscript
*** product2 - has files that are common to all modules of product 2
                Conscript
*** xerces - has xml handling code common to all products and modules
                Conscript
** server - all server module code for both projects
        Conscript
*** Unix - code specific to unix but common to servers of both products
                Conscript
*** Win - code specific to MS-Win but common to servers of both products
*** product1 - code specific to the server of product 1
                Conscript
**** Unix
                        Conscript
**** Win
*** product2 - code specific to the server of product 2
                Conscript
**** Unix
                        Conscript
**** Win

Attachment: exclude.patch
Description: Patch to allow for pruning by exclusion rather than inclusion

-- 
 (__) Doug Alcorn (mailto:address@hidden http://www.lathi.net)
 oo / PGP 02B3 1E26 BCF2 9AAF 93F1  61D7 450C B264 3E63 D543
 |_/  If you're a capitalist and you have the best goods and they're
      free, you don't have to proselytize, you just have to wait. 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]