Skip to content

Conversation

@artemcm
Copy link
Contributor

@artemcm artemcm commented Jul 9, 2024

  • Explanation: [Dependency Scanning] Collect emitted diagnostics per-scan-query #71907 was an important fix that moved the diagnostics collected during dependency scanning to be associated with an individual scan query, instead of scanner overall. This meant that multiple concurrent scans launched by libSwiftScan clients would have isolated diagnostic domains. However, upon query failure, either when constructing a scanning instance (e.g. un-recognized scanner argument) or upon encountering and diagnosing a dependency cycle, the new per-scan diagnostic state was lost and the scanner query returned an error.
    This means that scanner clients (SwiftDriver) would no longer see diagnostics from such failures. With this change, on dependency scan query failure, we ensure any diagnostics that the compiler has accumulated along the way are still produced to the client, by constructing a hollow output object that contains just enough state to also carry the diagnostic error payload.

  • Scope: This change primarily affects Explicit Module Builds (not default, opt-in with -explicit-module-build) which were already going to fail. On such failures the client would simply get an error from the dependency scanning query without additional context, and will now produce scanner-emitted diagnostics.

  • Risk: Low. Due to the scope of this change being largely limited to compilation tasks which were already going to fail, and only on opt-in Explicit Module Builds

  • Original PR: [Dependency Scanning] Emit diagnostics on scan query failure during initialization or cycle detection #75111

  • Issue/Radar: rdar://130897498

  • Reviewed By: @cachemeifyoucan

@artemcm artemcm added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Jul 9, 2024
@artemcm artemcm requested a review from a team as a code owner July 9, 2024 22:24
@artemcm
Copy link
Contributor Author

artemcm commented Jul 9, 2024

@swift-ci test

@artemcm artemcm force-pushed the 60ScannerFailureMinimalDiagnostics branch from 103c998 to f268844 Compare July 10, 2024 19:49
@artemcm
Copy link
Contributor Author

artemcm commented Jul 10, 2024

@artemcm artemcm force-pushed the 60ScannerFailureMinimalDiagnostics branch from f268844 to 9a06521 Compare July 11, 2024 16:09
@artemcm
Copy link
Contributor Author

artemcm commented Jul 11, 2024

@artemcm artemcm force-pushed the 60ScannerFailureMinimalDiagnostics branch from 9a06521 to c0a91ce Compare July 11, 2024 17:08
@artemcm
Copy link
Contributor Author

artemcm commented Jul 11, 2024

@artemcm artemcm force-pushed the 60ScannerFailureMinimalDiagnostics branch from c0a91ce to e1e2a4c Compare July 11, 2024 17:36
@artemcm
Copy link
Contributor Author

artemcm commented Jul 11, 2024

@artemcm artemcm force-pushed the 60ScannerFailureMinimalDiagnostics branch from e1e2a4c to f7f4e76 Compare July 11, 2024 18:09
@artemcm
Copy link
Contributor Author

artemcm commented Jul 11, 2024

@artemcm artemcm force-pushed the 60ScannerFailureMinimalDiagnostics branch from f7f4e76 to acd2da7 Compare July 11, 2024 18:50
@artemcm
Copy link
Contributor Author

artemcm commented Jul 11, 2024

@artemcm artemcm merged commit 4527d02 into swiftlang:release/6.0 Jul 12, 2024
@artemcm artemcm deleted the 60ScannerFailureMinimalDiagnostics branch July 12, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍒 release cherry pick Flag: Release branch cherry picks swift 6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants