Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-03-10 04:38:29


On Tuesday 28 February 2006 23:00, Daniel Einspanjer wrote:

> >
> > csconfig.transform: CSCONFIG -> CUSTOMERINFO
> > customerinfo.transform: CUSTOMERINFO -> CUSTOMERINFO
>
> The CSCONFIG and CUSTOMERINFO generators are completely orthogonal. They
> are *only* related in the fact that their output file type should be a
> normal CPP file.

If they both produce CPP file, and you have

    cpp whatever : .......

then both will be tried.

> > For a simplified use case:

> > you really get two possible transformation chains:
> >
> > CSCONFIG -> CUSTOMERINFO
> > CSCONFIG -> CUSTOMERINFO -> CUSTOMERINFO
> >
> > In theory, the CUSTOMERINFO -> CUSTOMERINFO step can be applied N times
> > more,
> > but Boost.Build does not allow repating application of the same generator
> > for
> > obvious reasons.
>
> I would hope to be able to get a transformation chain that would be *only*
> CSCONFIG -> CPP.
> I created CSCONFIG to handle the case where we have these INI files (one
> which is always used and one selected based on the customer feature) which
> get merged into a single ini file that is then fed through a program that
> generates a standard CPP file which will follow the standard compilation
> process from that point forward (CPP -> OBJ -> LIB|EXE). The merge is
> necessary only because the generation tool handles a single ini file as
> input.
>
> cpp customerinfo.cpp
>
> : # sources
>
> # This cast is needed so the customerinfo generator
> # gets called instead of the standard CPP generator.
> [ cast _ customerinfo : defaultcustomerinfo.cpp ]
> ;
> I created CUSTOMERINFO to handle the (nasty) case where we have this CPP
> file "defaultcustomerinfo.cpp" that contains a string which must be
> replaced with the customer name. The output of this generation is a CPP
> file which from that point on should behave exactly as a normal CPP (as
> above). It would be bad (albeit hopefully a no-op) to run the CUSTOMERINFO
> generator more than once. Since I didn't know of a way to make a generator
> that could operate on a file that already has other registered generators,
> I registered a new type CUSTOMERINFO with no explicit extension that
> inherited from CPP.
>
> If CUSTOMERINFO is the source of all this trouble and there is no way
> around it, I'll just change defaultcustomerinfo.cpp to be
> defaultcustomerinfo_cpp.src and register CUSTOMERINFO with a src extension
> instead of using cast. I got into this mess because I thought that cast
> would allow me to port this portion without having to change any of our
> existing build.

I'm sorry, but I'm completely lost in all those transformation. Maybe we
should go back and you'll describe:

   1. What are new types of sources type you need in your project, what
      are extensions for those types.
   2. What are the transformations between those types. For each
      transforation, state:
      - which source types it takes, and what number of each type
      - what is the output

   3. Please specify overall sequence of transformation you want.

> > And as a closing remark, the explanation why you get the error with the
> > current code, where target type of generators is CPP. Here's the second
> > transformation chains that Boost.Build finds:
> >
> > 1. customerinfo.transform has CPP as target type so it's asked
> > to create CPP from CSCONFIG
>
> Why would customerinfo.transform ever be asked to create a CPP from
> CSCONFIG?

You're asking boost.build to produce CPP file. customerinfo.transform has CPP
as target type.

>
> > 2. Source type of customerinfo.transform is CUSTOMERINFO. There are
> > no generators for this type.
>
> Why wouldn't it just treat the casted defaultcustomerinfo.cpp file as the
> source it needs instead of looking for a generator to transform it into
> itself?

I don't understand this question. The generator search goes from the desired
target type. We've trying to find if customerinfo.transform can be used to
produce CPP from whatever sources. We see that source type for
customer.transform is CUSTOMERINFO so we try generators for this type.

> > 3. Boost.Build tries generators for base types of CUSTOMERINFO, in
> > this case -- CPP.
> > 4. It finds the csconfig.transform (CSCONFIG->CPP) generator.
>
> So at this point, it tries to run the defaultcustomerinfo.cpp file through
> the CSCONFIG -> CPP generator?? I don't think this could be happening
> because the makecppconfig tool that turns a CSCONFIG.ini file into a CPP
> would choke if passed in a CPP as its source.

This has nothing to do with defaultcustomerinfo.cpp. As I've said in the
previous email, the problem occures with this code:

 cpp csconfig-customer.cpp
       : # sources
          csconfig-base.ini
      ;

Again, I think you should list all the desired transformation and we'll should
try again. Please be as specific as possible.

- Volodya


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk