-
-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error if AddPostAction() on node with no action (e.g., Alias nodes) #2281
Comments
Does this one have a straightforward way of moving forward. Seems like it was decided to have this situation cause error/warn, but it never happened. |
Yes. I'll take a look. |
On Scons 4.8.1 output_file = File("output_file")
Command(output_file, [], Touch(output_file))
Alias("alias1", output_file, "@true")
AddPostAction("alias1", "@echo running post_action for $TARGET")
Alias("alias2", output_file)
AddPostAction("alias2", "@echo running post_action for $TARGET")
Default(None) Gives this result
gives this output which seems to show that the postactions are only run when the |
Aliases are a little funky in that they're their own node type, and So yes, it's inconsistent from an expectation sense; the docs say nothing about a limitation. Looks like we were going to look into at least letting you know this wasn't going to do what you expect, but it still hasn't happened. |
AddPostAction and AddPreAction apply to the action of the alias, which may not have been clear previously (see SCons#2281). Expanded the example for AddPostAction using a multi-step build. Signed-off-by: Mats Wichmann <[email protected]>
AddPostAction and AddPreAction apply to the action of the alias, which may not have been clear previously (see SCons#2281). Expanded the example for AddPreAction using a multi-step build. Signed-off-by: Mats Wichmann <[email protected]>
…ded to an Alias() node, if there was no action specified when that node was created
AddPostAction and AddPreAction apply to the action of the alias, which may not have been clear previously (see SCons#2281). Expanded the example for AddPreAction using a multi-step build. Signed-off-by: Mats Wichmann <[email protected]>
AddPostAction and AddPreAction apply to the action of the alias, which may not have been clear previously (see SCons#2281). Expanded the example for AddPreAction using a multi-step build. Signed-off-by: Mats Wichmann <[email protected]>
This issue was originally created at: 2008-12-21 07:18:51.
This issue was reported by:
rhl
.The following SConstruct file prints, "Hello"
I.e. the
AddPostAction
is accepted, but does nothing; if you comment theAlias
line you get the expected "Hello" and "Goodbye".IMHO, scons should either handle this case, or flag an error.
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.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.Should have been assigned to 2.1, not 2.0.
stevenknight => issues@scons
Change subject to reflect decision at bug party.
Bug party triage.
The text was updated successfully, but these errors were encountered: