Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions Sources/SwiftBuildSupport/PIFBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -359,22 +359,20 @@ public final class PIFBuilder {
buildCommands: result.buildCommands.map( { buildCommand in
var newEnv: Environment = buildCommand.configuration.environment

if let runtimeLibPaths = try? buildParameters.toolchain.runtimeLibraryPaths {
for libPath in runtimeLibPaths {
newEnv.appendPath(key: .libraryPath, value: libPath.pathString)
}
}
let runtimeLibPaths = buildParameters.toolchain.runtimeLibraryPaths

let workingDir = buildCommand.configuration.workingDirectory
for libPath in runtimeLibPaths {
newEnv.appendPath(key: .libraryPath, value: libPath.pathString)
}

let writableDirectories: [AbsolutePath] = buildCommand.outputFiles
let writableDirectories: [AbsolutePath] = [pluginOutputDir]

return PackagePIFBuilder.CustomBuildCommand(
displayName: buildCommand.configuration.displayName,
executable: buildCommand.configuration.executable.pathString,
arguments: buildCommand.configuration.arguments,
environment: .init(newEnv),
workingDir: workingDir,
workingDir: package.path,
inputPaths: buildCommand.inputFiles,
outputPaths: buildCommand.outputFiles.map(\.pathString),
sandboxProfile:
Expand Down
12 changes: 12 additions & 0 deletions Sources/_InternalTestSupport/Observability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ public func XCTAssertNoDiagnostics(
XCTFail("Found unexpected diagnostics: \n\(description)", file: file, line: line)
}

public func expectNoDiagnostics(
_ diagnostics: [Basics.Diagnostic],
problemsOnly: Bool = true,
sourceLocation: SourceLocation = #_sourceLocation
) {
let diagnostics = problemsOnly ? diagnostics.filter { $0.severity >= .warning } : diagnostics
if diagnostics.isEmpty { return }

let description = diagnostics.map { "- " + $0.description }.joined(separator: "\n")
Issue.record("Found unexpected diagnostics: \n\(description)", sourceLocation: sourceLocation)
}

public func testDiagnostics(
_ diagnostics: [Basics.Diagnostic],
problemsOnly: Bool = true,
Expand Down
Loading