Uploaded image for project: 'Swift'
  1. Swift
  2. SR-8707

Write out swiftdeps files atomically

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Component/s: Compiler
    • Labels:

      Description

      ReferenceDependenciesEmitter::emit in ReferenceDependencies.cpp writes the output directly to the specified path, instead of writing to a temporary file and then "atomically" renaming it into place. This can lead to truncated files if the compiler job is killed at exactly the wrong time.

      Since ReferenceDependenciesEmitter::emit was implemented, a helper function was added to do exactly this kind of atomic rename: atomicallyWritingToFile in swift/Basic/FileSystem.h. This can replace the ReferenceDependenciesEmitter::openFile helper completely.

      [split off from rdar://problem/25095498, which is mostly covered by SR-8706]

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              owenvoorhees Owen Voorhees
              Reporter:
              jrose Jordan Rose
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: