diff --git a/Sources/Build/BuildOperationBuildSystemDelegateHandler.swift b/Sources/Build/BuildOperationBuildSystemDelegateHandler.swift index b42a407dc19..4f362eefee9 100644 --- a/Sources/Build/BuildOperationBuildSystemDelegateHandler.swift +++ b/Sources/Build/BuildOperationBuildSystemDelegateHandler.swift @@ -517,7 +517,7 @@ final class WriteAuxiliaryFileCommand: CustomLLBuildCommand { } do { - try self.context.fileSystem.writeFileContents(outputFilePath, string: getFileContents(tool: tool)) + try self.context.fileSystem.writeIfChanged(path: outputFilePath, string: getFileContents(tool: tool)) return true } catch { self.context.observabilityScope.emit(error: "failed to write auxiliary file '\(outputFilePath.pathString)': \(error.interpolationDescription)") diff --git a/Sources/Workspace/Workspace+State.swift b/Sources/Workspace/Workspace+State.swift index b54ab25cb71..338c556c8c8 100644 --- a/Sources/Workspace/Workspace+State.swift +++ b/Sources/Workspace/Workspace+State.swift @@ -135,7 +135,7 @@ fileprivate struct WorkspaceStateStorage { let storage = V6(dependencies: dependencies, artifacts: artifacts) let data = try self.encoder.encode(storage) - try self.fileSystem.writeFileContents(self.path, data: data) + try self.fileSystem.writeIfChanged(path: self.path, bytes: .init(data)) } }