Skip to content

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

Merged
bdbaddog merged 10 commits into
SCons:masterfrom
bdbaddog:dont_reuse_tempfiles
Sep 21, 2020
Merged

bdbaddog merged 10 commits into
SCons:masterfrom
bdbaddog:dont_reuse_tempfiles

Conversation

@bdbaddog

Copy link
Copy Markdown
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 done
@bdbaddog
bdbaddog requested a review from mwichmann September 21, 2020 00:26
@bdbaddog

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@simontegelid

Copy link
Copy Markdown
Contributor

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

Comment thread test/long-lines/signature.py Resolved
Comment thread SCons/Platform/__init__.py Outdated
if node is not None else None
cmdlist = None

if isinstance(self.cmd, list):

Copy link
Copy Markdown
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
Copy Markdown
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