Boost logo

Boost Users :

From: Drumheller, Michael (michael.drumheller_at_[hidden])
Date: 2006-09-13 15:46:55


Hello:

I am trying to write some Jamfiles and I am finding that bjam tends to
run my rules twice.
Here is a tiny demo (using Boost 1.31.1 on Windows XP, with zsh/cygwin,
bjam version
"3.1.13. OS=NT".).

% export BOOST_ROOT=c:/boost_1_33_1; cd c:/; rm -rf deleteme; mkdir
deleteme; cd deleteme; echo 'Echo Hello Twice ;' > Jamfile; bjam
Hello Twice
Hello Twice
...found 8 targets...

(Note: If the first statement is "export BOOST_ROOT=;" instead, I get
the error "Unable to
load Boost.Build: could not find "boost-build.jam...Attempted search
from c:\deleteme up to
the root...etc.")

Notice the double-execution.

Here is some potentially useful extra information. I ran it with -d5,
and noticed that 'Echo Hello Twice ;'
was getting executed at lines 1785 and 1797 of allyourbase.jam. Here is
a snippet of the -d5 output:

---------------------------------------------------------output with
-d5----------------------------------------------------------
<snip>
c:\boost_1_33_1\tools/build/v1\allyourbase.jam:1784:>>>>|> set
gINCLUDED_AS_DEPENDANT(Jamfile) = TRUE
c:\boost_1_33_1\tools/build/v1\allyourbase.jam:1785:>>>>|> include
Jamfile
Jamfile:1:>>>>|> Echo Hello Twice
Hello Twice
c:\boost_1_33_1\tools/build/v1\allyourbase.jam:1791:>>>>|> set
gIN_LIB_INCLUDE =
c:\boost_1_33_1\tools/build/v1\allyourbase.jam:1796:>>>>|> set
gINCLUDED(Jamfile) = TRUE
c:\boost_1_33_1\tools/build/v1\allyourbase.jam:1797:>>>>|> include
Jamfile
Jamfile:1:>>>>|> Echo Hello Twice
Hello Twice
make -- all
make -- all
<snip>
--------------------------------------------------------end output with
-d5------------------------------------------------------

The file allyourbase.jam is too big for this email, but I'm including
the relevant snippet here,
with key lines marked with "<<<<<" :

------------------------------------------------------allyourbase.jam---
---------------------------------------------
<snip>
# Load a user's Jamfile(s).
#
rule load-jamfiles ( jamfiles * )
{
    # First we load the Jamfiles without generation of main targets so
that
    # dependencies are preloaded. Then we reload the files with target
    # generation enabled.
    
    local jamfile ;
    local as-dependant = $(gIN_LIB_INCLUDE) ;
    local gIN_LIB_INCLUDE ;
    
    gIN_LIB_INCLUDE = TRUE ;
    for jamfile-path in $(jamfiles)
    {
        if ! $(gINCLUDED_AS_DEPENDANT($(jamfile-path)))
        {
            gINCLUDED_AS_DEPENDANT($(jamfile-path)) = TRUE ;
            include $(jamfile-path) ; <<<<< line 1785
        }
    }
    
    if ! $(as-dependant)
    {
        gIN_LIB_INCLUDE = ;
        for jamfile-path in $(jamfiles)
        {
            if ! $(gINCLUDED($(jamfile-path)))
            {
                gINCLUDED($(jamfile-path)) = TRUE ;
                include $(jamfile-path) ; <<<<< line 1797
            }
        }
    }
}
<snip>
------------------------------------------------------end
allyourbase.jam------------------------------------------------

Can anyone reproduce and/or explain this?

Thank you.

Michael Drumheller
Boeing Phantom Works
Mathematics and Engineering Analysis
425.373.2703 michael.drumheller_at_[hidden]
This email may contain proprietary information. If you are not the
intended recipient please delete it and notify the sender that you
received it in error.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net