Skip to content

Error if AddPostAction() on node with no action (e.g., Alias nodes) #2281

@bdbaddog

Description

@bdbaddog

This issue was originally created at: 2008-12-21 07:18:51.
This issue was reported by: rhl.

rhl said at 2008-12-21 07:18:51

The following SConstruct file prints, "Hello"

show = Command("show",  "", "@echo Hello")
show = Alias("foo", show)
AddPostAction(show,  "@echo Goodbye")

I.e. the AddPostAction is accepted, but does nothing; if you comment the Alias line you get the expected "Hello" and "Goodbye".

IMHO, scons should either handle this case, or flag an error.

gregnoel said at 2008-12-26 15:25:19

What's happening is that the AddPostAction() is being applied to the alias Node, not the file Node, where it is ignored. I believe the only possible place that an action can be validly extended is on a file Node (with a non-Null Executor?), so it ought to be possible to detect when it is not and generate an error.

In the case here, the workaround is to use different variable names for the file Node and the alias Node and use AddPostAction() on the file Node.

stevenknight said at 2009-01-07 19:03:57

Bug party triage: Decided that SCons should issue an error (or perhaps a warning?) if you issue AddPostAction() on a Node that has no existing action.

gregnoel said at 2009-01-08 12:07:58

Should have been assigned to 2.1, not 2.0.

stevenknight said at 2009-11-10 18:00:19

stevenknight => issues@scons

gregnoel said at 2010-06-24 14:21:49

Change subject to reflect decision at bug party.

gregnoel said at 2010-07-21 17:10:33

Bug party triage.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions