Boost logo

Boost-Build :

Subject: [Boost-build] Changed behaviour of custom generators?
From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2014-04-01 08:14:19


I ran into problem with boost-build when upgrading from 1.53 to 1.55:

In my project I am using a custom generator like described in the
extender section of the manual.

The definition of my generator (producing a CPP and a HPP file) goes
like so:

type.register PKGSPEC : psp ;

class pkgspec-generator-cpp : generator
{
     import property-set ;

     rule __init__ (
         id composing ?
         : source-types *
         : target-types-and-names +
         : requirements * )
     {
         generator.__init__
             $(id) $(composing)
             : $(source-types)
             : $(target-types-and-names)
             : $(requirements)
             ;
     }

     rule generated-targets ( sources + : propset : project name ? )
     {
         # remove irrelevant features, i.e. all, since pkgspec does not
         # generate code that is dependant on any of those
         return [ generator.generated-targets
                 $(sources)
                 : [ property-set.empty ]
                 : $(project) $(name)
             ] ;
     }
}

generators.register [ new pkgspec-generator-cpp pkgspec.generate-cpp :
PKGSPEC : CPP HPP ] ;

I was able to use the generator in my files like so:

cpp detail/dataspec
     : dataspec.psp
     ;

lib blocklib
     : main.cpp
       detail/dataspec
     : <dependency>detail/dataspec
       <implicit-dependency>detail/dataspec
       <link>static
      :
      : <dependency>detail/dataspec
        <implicit-dependency>detail/dataspec
;

Now is where my problem comes: when the build tree initially is empty I
get errors:

don't know how to make
<pbuild\bb\software\blocklib-object(c-scanner)@2752>detail\dataspec.cpp
don't know how to make
<pbuild\bb\software\blocklib-object(c-scanner)@2752>detail\dataspec.hpp
don't know how to make
<pbuild\bb\software\blocklib-object(c-scanner)@2758>detail\dataspec.cpp
don't know how to make
<pbuild\bb\software\blocklib-object(c-scanner)@2758>detail\dataspec.hpp
...
(repeats total of 6)

and later failed builds due to lack of the datapspec files.

Now the interseting part: During the failed build my generator runs and
creates the missing files, where on second build invocation no "don't
knows" and missing files any more.

I hope someone (who changed the code) will be able to help!

Regards and thank you,
Roland


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