Skip to content

Commit 167287c

Browse files
author
David Ungar
committed
remove priors
1 parent e5a38dd commit 167287c

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

Sources/SwiftDriver/IncrementalCompilation/IncrementalCompilationState.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ extension IncrementalCompilationState {
500500
}
501501
}
502502
}
503+
503504
@_spi(Testing) public func writeDependencyGraph() throws {
504505
// If the cross-module build is not enabled, the status quo dictates we
505506
// not emit this file.
@@ -515,6 +516,12 @@ extension IncrementalCompilationState {
515516
on: self.driver.fileSystem,
516517
compilerVersion: recordInfo.actualSwiftVersion)
517518
}
519+
520+
@_spi(Testing) public static func removeDependencyGraphFile(_ driver: Driver) {
521+
if let path = driver.buildRecordInfo?.dependencyGraphPath {
522+
try? driver.fileSystem.removeFileTree(path)
523+
}
524+
}
518525
}
519526

520527
// MARK: - OutputFileMap

Sources/SwiftDriver/IncrementalCompilation/IncrementalDependencyAndInputSetup.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ extension IncrementalCompilationState {
5959
driver.diagnosticEngine
6060
).compute()
6161
else {
62+
Self.removeDependencyGraphFile(driver)
6263
return nil
6364
}
6465

Sources/SwiftDriver/Utilities/VirtualPath.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,12 @@ extension TSCBasic.FileSystem {
707707
}
708708
}
709709

710+
func removeFileTree(_ path: VirtualPath) throws {
711+
try resolvingVirtualPath(path) { absolutePath in
712+
try self.removeFileTree(absolutePath)
713+
}
714+
}
715+
710716
func getFileInfo(_ path: VirtualPath) throws -> TSCBasic.FileInfo {
711717
try resolvingVirtualPath(path, apply: getFileInfo)
712718
}

0 commit comments

Comments
 (0)