[Scons-users] Reusing tempfiles in TempFileMunge and action lists

Simon Tegelid simon at tegelid.se
Fri Jun 29 01:34:27 EDT 2018


Hi,

I noticed that using TEMPFILE in multiple actions in the same action
list is broken since the merge of the change mentioned here:
https://pairlist2.pair.net/pipermail/scons-dev/2014-November/002041.html.
The reason is that when doing subst on TEMPFILE, we don't know how and
where TEMPFILE is used and the source and target lists are common for
the entire action list. So, by storing the tempfile command list as an
attribute in the target list is causing all TEMPFILE's in the action
list to use the same tempfile, which is incorrect.

I added a test in the pull request
https://github.com/SCons/scons/pull/3140/commits/5cbb207eae23648f8da68cc6ca4fad91a2461154
to show this, and also removed the test that checks for this broken
target attribute to be set. With this pull request, the "duplicate
output and duplicated temporary file generation" is an issue again
since I removed its resolution. I'm not sure how to fix that. It feels
like bad practice to create tempfiles on the subst of TEMPFILE since
we don't know who invoked the subst, but I have no better idea.

I want to bring the topic up here to get more eyes on the issue, as
William Deegan proposed in the pull request.

-- 
Simon Tegelid
simon at tegelid.se
070-3593963


More information about the Scons-users mailing list