Skip to content
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

Fix 2281 aliases ignore pre post add actions #4674

Merged

Conversation

bdbaddog
Copy link
Contributor

If an Alias node was being created with no action specified, any actions added with AddPreAction() or AddPostAction() were being ignored because the Alias nodes build() method didn't do anything.

Now we'll check if there are any pre or post actions on the executor and if so call the real build() method from Node.Node.

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt and RELEASE.txt (and read the README.rst).
  • I have updated the appropriate documentation

…ded to an Alias() node, if there was no action specified when that node was created
@bdbaddog bdbaddog requested a review from mwichmann January 20, 2025 22:17
if len(self.executor.post_actions) + len(self.executor.pre_actions) > 0:
# Only actually call Node's build() if there are any
# pre or post actions.
# Alias node's will get 1 action and Alias.build()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no apostrophe on line 112, plural not possessive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed..

@mwichmann
Copy link
Collaborator

Looks okay to me. I will revise #4672 after this merges.

@bdbaddog bdbaddog merged commit 144af4a into SCons:master Jan 21, 2025
@bdbaddog bdbaddog deleted the fix_2281_Aliases_ignore_pre_post_add_actions branch January 21, 2025 17:20
@mwichmann mwichmann added this to the 4.9 milestone Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

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