You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Workspace/Workspace.swift
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1857,7 +1857,11 @@ extension Workspace {
1857
1857
)
1858
1858
1859
1859
if precomputationResult.isRequired {
1860
-
diagnostics.emit(error:"cannot update Package.resolved file because automatic resolution is disabled")
1860
+
if !fileSystem.exists(resolvedFile){
1861
+
diagnostics.emit(error:"a resolved file is required when automatic dependency resolution is disabled and should be placed at \(resolvedFile.pathString)")
1862
+
}else{
1863
+
diagnostics.emit(error:"an out-of-date resolved file was detected at \(resolvedFile.pathString), which is not allowed when automatic dependency resolution is disabled; please make sure to update the file to reflect the changes in dependencies")
Copy file name to clipboardExpand all lines: Tests/WorkspaceTests/WorkspaceTests.swift
+52-1Lines changed: 52 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3690,7 +3690,7 @@ final class WorkspaceTests: XCTestCase {
3690
3690
// Check force resolve. This should produce an error because the resolved file is out-of-date.
3691
3691
workspace.checkPackageGraphFailure(roots:["Root"], forceResolvedVersions:true){ diagnostics in
3692
3692
DiagnosticsEngineTester(diagnostics){ result in
3693
-
result.check(diagnostic:"cannot update Package.resolved file because automatic resolution is disabled", checkContains:true, behavior:.error)
3693
+
result.check(diagnostic:"an out-of-date resolved file was detected at /tmp/ws/Package.resolved, which is not allowed when automatic dependency resolution is disabled; please make sure to update the file to reflect the changes in dependencies", checkContains:true, behavior:.error)
3694
3694
}
3695
3695
}
3696
3696
workspace.checkManagedDependencies{ result in
@@ -3729,6 +3729,57 @@ final class WorkspaceTests: XCTestCase {
workspace.checkPackageGraphFailure(roots:["Root"], forceResolvedVersions:true){ diagnostics in
3777
+
DiagnosticsEngineTester(diagnostics){ result in
3778
+
result.check(diagnostic:"a resolved file is required when automatic dependency resolution is disabled and should be placed at /tmp/ws/Package.resolved", checkContains:true, behavior:.error)
0 commit comments