[Scons-users] Overriding build output string for built-in actions

Jonathon Reinhart jonathon.reinhart at gmail.com
Tue May 26 15:25:14 EDT 2015


Hello all,

I've got a builder that looks like this:

    _builder = Builder(
       action = [
           Delete('$TARGET'),
           Action('$FOO $FOOOPTS -i $SOURCE -o $TARGET', '$FOOCOMSTR'),
           Chmod('$TARGET', 0755),
       ],
    )

It's written this way because $FOO doesn't like the output file being
there, and it loses the permissions of the input file.

Now I am already overriding $FOOCOMSTR so I can have a "pretty" build
output, and that is working. However, the Delete() and Chmod() actions
also get printed which ruins the pretty output.

I tried putting them in the same Action() object, but that didn't
change anything:

    _builder = Builder(
        action = Action( [
              Delete('$TARGET'),
              '$FOO $FOOOPTS -i $SOURCE -o $TARGET',
              Chmod('$TARGET', 0755),
          ], '$FOOCOMSTR')
    )


You cannot change their output like this:

    Action(Delete('$TARGET'), 'Hi I am deleting $TARGET')

because the first thing _do_create_action() does is:

    if isinstance(act, ActionBase):
        return act


Is there any way to change the build output string for the "built-in" actions?
OR, is there a way to "bundle" multiple actions under one build output line?

Thank you!

Jonathon Reinhart


More information about the Scons-users mailing list