Skip to content

Commit e7ceafd

Browse files
committed
Change symlink error to warning
Cherrypicked from swiftlang#3490
1 parent 8a9102a commit e7ceafd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Sources/Build/BuildOperation.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,18 @@ public final class BuildOperation: PackageStructureDelegate, SPMBuildCore.BuildS
125125
component: buildParameters.configuration.dirname
126126
)
127127
if localFileSystem.exists(oldBuildPath) {
128-
try localFileSystem.removeFileTree(oldBuildPath)
128+
do { try localFileSystem.removeFileTree(oldBuildPath) }
129+
catch {
130+
diagnostics.emit(warning: "unable to delete \(oldBuildPath), skip creating symbolic link: \(error)")
131+
return
132+
}
133+
}
134+
135+
do {
136+
try localFileSystem.createSymbolicLink(oldBuildPath, pointingAt: buildParameters.buildPath, relative: true)
137+
} catch {
138+
diagnostics.emit(warning: "unable to create symbolic link at \(oldBuildPath): \(error)")
129139
}
130-
try localFileSystem.createSymbolicLink(oldBuildPath, pointingAt: buildParameters.buildPath, relative: true)
131140
}
132141

133142
/// Compute the llbuild target name using the given subset.

0 commit comments

Comments
 (0)