@@ -17,6 +17,7 @@ import PackageModel
17
17
import SPMBuildCore
18
18
import TSCBasic
19
19
20
+ import struct TSCUtility. SerializedDiagnostics
20
21
import struct TSCUtility. Triple
21
22
22
23
/// A plugin script runner that compiles the plugin source files as an executable binary for the host platform, and invokes it as a subprocess.
@@ -121,6 +122,8 @@ public struct DefaultPluginScriptRunner: PluginScriptRunner, Cancellable {
121
122
122
123
// We use the toolchain's Swift compiler for compiling the plugin.
123
124
var commandLine = [ self . toolchain. swiftCompilerPathForManifests. pathString]
125
+
126
+ observabilityScope. emit ( debug: " Using compiler \( self . toolchain. swiftCompilerPathForManifests. pathString) " )
124
127
125
128
// Get access to the path containing the PackagePlugin module and library.
126
129
let pluginLibraryPath = self . toolchain. swiftPMLibrariesLocation. pluginLibraryPath
@@ -208,6 +211,8 @@ public struct DefaultPluginScriptRunner: PluginScriptRunner, Cancellable {
208
211
if ( verboseOutput) {
209
212
commandLine. append ( " -v " )
210
213
}
214
+
215
+ observabilityScope. emit ( debug: " Using command line \( commandLine) " )
211
216
212
217
// Pass through the compilation environment.
213
218
let environment = toolchain. swiftCompilerEnvironment
@@ -363,6 +368,10 @@ public struct DefaultPluginScriptRunner: PluginScriptRunner, Cancellable {
363
368
compilerOutput: compilerOutput,
364
369
cached: false )
365
370
371
+ let diaFileContents = try localFileSystem. readFileContents ( result. diagnosticsFile)
372
+ let diagnosticsSet = try SerializedDiagnostics ( bytes: diaFileContents)
373
+ observabilityScope. emit ( debug: " Got serialized diagnostics: \( diagnosticsSet. diagnostics) from \( result. diagnosticsFile) " )
374
+
366
375
// Tell the delegate that we're done compiling the plugin, passing it the result.
367
376
delegate. didCompilePlugin ( result: result)
368
377
0 commit comments