Boost logo

Boost-Build :

From: Khassapov, Alex (Alex.Khassapov_at_[hidden])
Date: 2008-02-11 19:34:36

Hi Jurko,

I'm not really experienced in bjam, so I really appreciate any help. So if you have *any* comments on my code, feel free...

Regarding what I'm doing - I was going to post another question, actually two questions.

I want bjam to automatically checkout missing dependancies. I created a wrapper rule for 'exe' and 'lib' which checks if sources include libraries from a list of our libs and then checks if the directory exists and if not - checks it out from cvs.

There are two problems:
1. The one I described already - after the directory is checked out, bjam tries to check it out again as path.exists still return false. To overcum this I keep a list of already checked out dirs $(chkout-dirs), but it's just a hack.
2. After checkout I want to call "use-project [ make-vname $(vname) ] : $(dirname) ;" to declare the new library but apparently it's too late at this atage - bjam still doesn't recognise the lib.

In both cases I need to restart bjam to continue build after directories are checked out.

I couldn't think of better way to automatically check out dependent libs as bjam needs to have Jamfiles to build the dependancy tree...

Do you have any advise on this? I'm sure many people have the same problems with source control but couldn't find any solution.



rule libg ( name : prefix ? : extra-sources * : files-to-exclude * : requirements * )
    local files = [ target-common $(prefix) : $(extra-sources) : $(files-to-exclude) ] ;
    lib $(name) : $(files) : $(requirements) ;

rule target-common ( prefix ? : extra-sources * : files-to-exclude * )
    myrules.check-dep-dirs $(extra-sources) : $(vlibs) ;

    local ext = .c .C .cpp .SC ;
    local wildcards ;
    if $(prefix)
        wildcards = $(prefix)* ;
        wildcards = * ;
    local .files-to-exclude = t_*$(ext) $(prefix)t_*$(ext) $(files-to-exclude) ;
    local files = [ glob $(wildcards)$(ext) : $(.files-to-exclude) ] $(extra-sources) ;
    return $(files) ;

rule check-dep-dirs ( sources * : vlibs + )
    # Check if lib dir is checkedout
    for local f in $(sources)
        vname = [ is-virt-lib $(f) : $(vlibs) ] ;
        if $(vname)
            dirname = [ get-dir-name $(vname) : $(vlibs) ] ;
            if ! [ dir-exists $(dirname) ] && ! $(dirname) in $(chkout-dirs)
                ECHO "###: " [ checkout $(dirname) ] ;

                # use-project doesn't work at this stage is it's too late
                # use-project [ make-vname $(vname) ] : $(dirname) ;
                chkout-dirs = $(chkout-dirs) $(dirname) ;

-----Original Message-----
From: boost-build-bounces_at_[hidden] [mailto:boost-build-bounces_at_[hidden]] On Behalf Of Jurko Gospodnetic
Sent: Tuesday, 12 February 2008 11:15 AM
To: boost-build_at_[hidden]
Subject: Re: [Boost-build] path.exists caching?

   Hi Alex.

> Hi, it looks like path.exists keeps file information cached, the
> following example proves it. Is there any way to refresh the
> information (clear cache) after creating the directory?

   The path.exists rule you called depends on Boost Jam's built-in
globbing support (builtin.c) and that in turn uses Boost Jam's file
binding (timestamp.c) which caches all information about all files it
detects on the system as a performance optimization.

   So the direct answer would be - no, as far as I know.

   Perhaps you could tell us more about what you're tring to achieve and
we could find a different solution?

   I do not see why you would want to create or delete files or folders
in the initial Boost Jam script scanning phase. Such modifications
should be made using actions and executed the same as any other build
action. I believe that was the reason why such caching was deemed OK in
the first place.

   Best regards,
     Jurko Gospodnetiæ

Unsubscribe & other changes:

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at