[Scons-users] Controlling display of a builder

Plunket, Tom tom.plunket at aristocrat-inc.com
Mon Nov 2 16:45:31 EST 2015


My reading of the OP suggests an answer something like what I am doing for a couple of my site_tools pipelines in their generate() functions:


def generate(env, **kw):

    action = Action(audioBuild, 'Creating OGG audio ${TARGETS.file}')

    builder = Builder(action = action)

    env.Append(BUILDERS = { 'Audio': builder })

This writes the text that I specify out for the user rather than the generated text.

‘audioBuild’ is a Python function that’s getting called; presumably the OP could just put his lambda object in place of that.

Sorry for all of the boilerplate noise that gets added to the end of this by my email gateway.

--

-Tom


From: Scons-users [mailto:scons-users-bounces at scons.org] On Behalf Of Bill Deegan
Sent: Tuesday, October 20, 2015 8:44 AM
To: Tom Tanner; SCons users mailing list
Subject: Re: [Scons-users] Controlling display of a builder

You can change SPAWN just for a single builder invocation..
env.MYBUILDER(target,sources,SPAWN=my_spawn_logic)


On Tue, Oct 20, 2015 at 1:50 AM, Tom Tanner (BLOOMBERG/ LONDON) <ttanner2 at bloomberg.net<mailto:ttanner2 at bloomberg.net>> wrote:
I did try once changing the default SPAWN to not invoke the commands with sh -c ...... It works mostly but occasionally there's code that gets very upset because it's carefully constructed a string and escaped it...

(posix fork code is somewhat of a mess at the moment).


You could change env['SPAWN'] and env['PSPAWN'] to point to your own code for that particular builder.



From: scons-users at scons.org<mailto:scons-users at scons.org> At: Oct 17 2015 19:57:21
To: scons-users at scons.org<mailto:scons-users at scons.org>
Subject: Re:[Scons-users] Controlling display of a builder
Hi

I have been using the possibility to pass extra arguments to Command
to have them used in a builder.  I am doing something like the following:

    scons_subprocess_call = (lambda target, source, env
                                    : subprocess.call(env['ARGS'], source[0]))

    data = env.Command(
      source = "foo.pl<http://foo.pl>",
      target = "bar.log",
      action = scons_subprocess_call,
      ARGS   = ['homo sapiens', 'Reference GRCh'])

The problem with this is that the output of SCons won't display anything
useful:

    $ scons
    [...]
    scons: Building targets ...
    <lambda>(["bar.log"], ["foo.pl<http://foo.pl>"])
    [...]

The main reason I am doing this is to avoid the shell since some of the
arguments have whitespace, single and double quotes, and even wildcards.
This makes generation of a command problematic.  I have tried to write my
own builder but the problem remains.  I create a Builder either by
setting a `action`, and continue with the problem of not having the actual
call made displayed, or by setting a `generator`, and face the problem of
escaping any weird stuff in the arguments.


Short of having the builder print() something, is there any way to create
a Builder that does not boil down to create a command line for the shell,
while still controlling what SCons displays?

(I am aware that this means that what gets displayed will not match
a command line.  However, it would still be more informative)

Thank you,
Carnë
_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users


_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users



IMPORTANT CONFIDENTIALITY NOTICE:

This E-mail(including any documents referred to in, or attached, to this E-mail) may contain information that is personal, confidential or the subject of copyright or other proprietary rights in favor of Aristocrat, its affiliates or third parties. This E-mail is intended only for the named addressee. Any privacy, confidence, copyright or other proprietary rights in favor of Aristocrat, its affiliates or third parties, is not lost because this E-mail was sent to you by mistake.

If you received this E-mail by mistake you should: (i) not copy, disclose, distribute or otherwise use it, or its contents, without the consent of Aristocrat or the owner of the relevant rights; (ii) let us know of the mistake by reply E-mail or by telephone (US 1-877-274-9661, or  AU +61 2 9013 6000); and (iii) delete it from your system and destroy all copies.

Any personal information contained in this E-mail must be handled in accordance with applicable privacy laws.

Electronic and internet communications can be interfered with or affected by viruses and other defects. As a result, such communications may not be successfully received or, if received, may cause interference with the integrity of receiving, processing or related systems (including hardware, software and data or information on, or using, that hardware or software). Aristocrat gives no assurances in relation to these matters.

If you have any doubts about the veracity or integrity of any electronic communication we appear to have sent you, please call (US 1-877-274-9661, or  AU +61 2 9013 6000) for clarification.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20151102/eadb0a7d/attachment-0001.html>


More information about the Scons-users mailing list