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

Dont reuse tempfiles when a target is built with an ActionList. #3801

Merged
merged 10 commits into from
Sep 21, 2020

Conversation

bdbaddog
Copy link
Contributor

This is a better fix than dropping saving the tempfile cmdlist which was proposed in PR #3553 which replaced PR #3140
Crediting Simon Tegelid with the fix as he's pointed out the issue and a way to fix it.

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 read the README.rst)
  • I have updated the appropriate documentation

simontegelid and others added 5 commits September 20, 2020 14:21
Actions lists with more than one action using ${TEMPFILE("TEMP FILE CONTENT")}
should not use the same tempfile for different "TEMP FILE CONTENT".
Therefore we cannot store the cmd_list in niether the target nor the
source attributes since those are common for all actions.

Reusing the same tempfile causes the same command to be invoked
for all actions in the list. However, not resusing tempfiles will
create unneeded tempfiles on strfunction invocation. This is better
than producing incorrect results, but leaves the tempfile in a bad
state.
…TEMPFILE-actionlist's SConsctruct in fixture dir
… target.attributes.tempfile_cmdlist[self.cmd] where self.cmd is the string in ${TEMPFILE('MY STRING')}
@bdbaddog bdbaddog mentioned this pull request Sep 21, 2020
3 tasks
@bdbaddog bdbaddog requested a review from mwichmann September 21, 2020 00:26
@bdbaddog
Copy link
Contributor Author

Hold off on review.. a few issues to sort.

…tuple to hold it and using that as the key for tempfile_cmdlist
@bdbaddog
Copy link
Contributor Author

Ok.. that should do it, please review assuming appveyor and travis complet successfully.

@simontegelid
Copy link
Contributor

This seems like a more clever solution. Thanks for helping out with this!

if node is not None else None
cmdlist = None

if isinstance(self.cmd, list):
Copy link
Collaborator

Choose a reason for hiding this comment

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

isinstance rather than is_List? (consistency nit, nothing else). Other consistency nit is line 194 uses the = foo if bar else baz form and this bit doesn't. Neither are important to fix, just noting.

@mwichmann
Copy link
Collaborator

Looks okay to my tired eyes. +1

@bdbaddog bdbaddog merged commit b0b370d into SCons:master Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants