Skip to content

Interactive mode and TEMPFILE don't get along #4595

Closed

Description

@mwichmann

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.

Activity

  1. added
    TEMPFILE
    on Sep 11, 2024
  2. added a commit that references this issue on Sep 14, 2024
    f72ce39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TEMPFILEinteractive mode

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions