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

Interactive mode and TEMPFILE don't get along #4595

Closed
mwichmann opened this issue Sep 11, 2024 · 0 comments · Fixed by #4597
Closed

Interactive mode and TEMPFILE don't get along #4595

mwichmann opened this issue Sep 11, 2024 · 0 comments · Fixed by #4597
Labels
interactive mode TEMPFILE Long-command-line handling with TEMPFILE

Comments

@mwichmann
Copy link
Collaborator

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:

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:

https://github.com/imuzzolini-vigrade/scons-interactive

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interactive mode TEMPFILE Long-command-line handling with TEMPFILE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant