[Scons-users] Problem with custom builder

Bill Deegan bill at baddogconsulting.com
Mon Jul 29 13:36:34 EDT 2013


Generally better to use files as source and destination.
Using directories implicitly makes them depend on the files in that
directory.
So you'll often see the multiple ways error and it can be a pain to track
it down.
-Bill


On Sun, Jul 28, 2013 at 11:01 PM, Michael Pock <mhp77 at gmx.at> wrote:


> On 26/07/13 23:36, Dirk Bächle wrote:

> > Hi Michael,

> >

> > it seems as if you're almost there.

> >

> > On 26.07.2013 22:52, Michael Pock wrote:

> >> Hi,

> >>

> >> I'd like to implement a builder that takes source directories dir.a,

> >> dir.b and dir.c, and pipes their contents to target files dir.a.list,

> >> dir.b.list and dir.c.list. I've already tried the following:

> >>

> >> env = Environment()

> >>

> >> env["BUILDERS"]["List"] = Builder(action="ls ${SOURCE} >${TARGET}",

> >> suffix="list" ,

> >> source_factory=Dir ,

> >> single_source=True )

> >>

> >> env.List(["dir.a", "dir.b", "dir.c"])

> >>

> >> Unfortunately, this doesn't work since the directory suffix is

> >> stripped when computing the target filename. Hence, the target

> >> filename is dir.list for all source directories dir.a, dir.b and dir.c.

> >>

> >> I hoped that passing source_suffix=None or source_suffix="" to the

> >> Builder function would solve my problem. But these options seem to

> >> make no difference.

> >

> > Please try

> >

> > suffix=".list"

> >

> > instead, and the correct name for the other parameter is "src_suffix".

> > You can find some more info about this in the MAN page (section

> > "Examples"/"Defining Your Own Builder Object").

> >

> > Does this help already?

> >

> > Best regards,

> >

> > Dirk

>

> Hi Dirk,

>

> thanks for your reply. I tried out your suggestions, but, unfortunately,

> SCons still terminates with the error message

>

> scons: *** Multiple ways to build the same target were specified for:

> dir.list (from ['dir.a'] and from ['dir.b'])

>

> It seems there is no way to prevent SCons from stripping source filename

> suffixes when computing target filenames.

>

> Best regards,

> Michael

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20130729/24089811/attachment.html


More information about the Scons-users mailing list