Repository navigation
Description
Opened from discord thread starting at https://discord.com/channels/571796279483564041/571796280146133047/1280915150005604394
In the platform code, a tempfile used for linking (or other usage, for that matter) is deleted immediately upon use - it's built in to the command generated to use the tempfile:
scons/SCons/Platform/__init__.py
Line 312 in b2a103b
| cmdlist = [cmd[0], prefix + native_tmp + '\n' + rm, native_tmp] |
(the exact contents of rm is determined a bit earlier).
The problem is in interactive mode, you want to be able to repeat commands, and that command is cached in a node, so it's just reissued, except the tempfile no longer exists, having been removed on first use. This simple reproducer was provided in the original thread:
I've confirmed this with some investigation. The node caching does take place; Interactive knows it has to do some work to prepare for a future build, as seen in:
# Clean up so that we can perform the next build correctly.
...
SCons.Script.Main.progress_display("scons: Clearing cached node information ...")When we re-execute, it appears this command line is still there's in the node.attibutes.tempfile_cmdlist, where it was put for a reasonbly good reason:
# Store the temporary file command list into the target Node.attributes
# to avoid creating two temporary files one for print and one for execute. See PR #3801 (and referenced earlier ones) which also touch on this area - originally proposed not caching, but then evolved to a different solution.
Activity
Update docs and usage of TEMPFILE/TempFileMunge