Skip to content

Commit ca94d24

Browse files
committed
Minor update
1 parent 49482eb commit ca94d24

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

Sources/PackageLoading/ManifestLoader.swift

+12-14
Original file line numberDiff line numberDiff line change
@@ -290,28 +290,26 @@ public final class ManifestLoader: ManifestLoaderProtocol {
290290
// We might have some non-fatal output (warnings/notes) from the compiler even when
291291
// we were able to parse the manifest successfully.
292292
if let compilerOutput = result.compilerOutput {
293-
// FIXME: Isn't the judgement too naive?
293+
// FIXME: Isn't the strategy too naive?
294294
var outputSeverity: Basics.Diagnostic.Severity = .warning
295-
#if os(Windows)
296-
// Filter out link.exe note when creating manifest executable.
295+
#if os(Windows)
296+
// Filter out `LINK` note for creating manifest executable.
297297
if let compiledManifestName = result.compiledManifestFile?.basenameWithoutExt,
298298
!compilerOutput.contains(where: \.isNewline) {
299299
if compilerOutput.contains("\(compiledManifestName).lib") && compilerOutput.contains("\(compiledManifestName).exp") {
300300
outputSeverity = .debug
301301
}
302302
}
303-
#endif
304-
if !compilerOutput.isEmpty {
305-
let metadata = result.diagnosticFile.map { diagnosticFile -> ObservabilityMetadata in
306-
var metadata = ObservabilityMetadata()
307-
metadata.manifestLoadingDiagnosticFile = diagnosticFile
308-
return metadata
309-
}
310-
observabilityScope.emit(severity: outputSeverity, message: compilerOutput, metadata: metadata)
311-
312-
// FIXME: (diagnostics) deprecate in favor of the metadata version ^^ when transitioning manifest loader to Observability APIs
313-
//observabilityScope.emit(.warning(ManifestLoadingDiagnostic(output: compilerOutput, diagnosticFile: result.diagnosticFile)))
303+
#endif
304+
let metadata = result.diagnosticFile.map { diagnosticFile -> ObservabilityMetadata in
305+
var metadata = ObservabilityMetadata()
306+
metadata.manifestLoadingDiagnosticFile = diagnosticFile
307+
return metadata
314308
}
309+
observabilityScope.emit(severity: outputSeverity, message: compilerOutput, metadata: metadata)
310+
311+
// FIXME: (diagnostics) deprecate in favor of the metadata version ^^ when transitioning manifest loader to Observability APIs
312+
//observabilityScope.emit(.warning(ManifestLoadingDiagnostic(output: compilerOutput, diagnosticFile: result.diagnosticFile)))
315313
}
316314

317315
return try ManifestJSONParser.parse(

0 commit comments

Comments
 (0)