Skip to content

Commit 393a8f3

Browse files
authored
Adopt new PIF builder in SwiftBuildSupport (#8454)
### Motivation: Switch from the legacy PIF builder in `SwiftBuildSupport` to the new one, introduced by PR #8405. The new PIF builder (i.e., `SwiftBuildSupport/PackagePIFBuilder*.swift`) is the exact same we use in Xcode. ### Modifications: Replaces the old PIF builder (i.e., `SwiftBuildSupport/PIF.swift` and `SwiftBuildSupport/PIFBuilder.swift` ) with the new one (i.e., `SwiftBuildSupport/PackagePIFBuilder*.swift`). ### Result: The new PIF builder now fully replaces the legacy PIF builder. In particular, all these Swift Build tests are passing (i.e., same as before this PR): * BuildPlanSwiftBuildTests * APIDiffSwiftBuildTests * BuildCommandSwiftBuildTests * PackageCommandSwiftBuildTests * RunCommandSwiftBuildTests * TestCommandSwiftBuildTests I also improved the PIF logging too. Try the `--very-verbose` option to see what I mean :-) Tracked by rdar://147527170.
1 parent f673bf6 commit 393a8f3

11 files changed

+599
-3101
lines changed

IntegrationTests/Tests/IntegrationTests/SwiftPMTests.swift

+12-7
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,15 @@ private struct SwiftPMTests {
7575
}
7676

7777
@Test(
78+
.requireHostOS(.windows, when: false),
7879
.requireThreadSafeWorkingDirectory,
7980
.bug(
8081
"https://github.com/swiftlang/swift-package-manager/issues/8416",
81-
"swift run using --build-system swiftbuild fails to run executable"
82+
"[Linux] swift run using --build-system swiftbuild fails to run executable"
83+
),
84+
.bug(
85+
"https://github.com/swiftlang/swift-package-manager/issues/8514",
86+
"[Windows] Integration test SwiftPMTests.packageInitExecutable with --build-system swiftbuild is skipped"
8287
),
8388
arguments: BuildSystemProvider.allCases
8489
)
@@ -119,12 +124,12 @@ private struct SwiftPMTests {
119124
try localFileSystem.createDirectory(packagePath)
120125
try sh(swiftPackage, "--package-path", packagePath, "init", "--type", "library")
121126
try withKnownIssue(
122-
"""
123-
Linux: /lib/x86_64-linux-gnu/Scrt1.o:function _start: error: undefined reference to 'main'
124-
Windows: lld-link: error: subsystem must be defined
125-
MacOS: Could not find or use auto-linked library 'Testing': library 'Testing' not found
126-
""",
127-
isIntermittent: true
127+
"""
128+
Linux: /lib/x86_64-linux-gnu/Scrt1.o:function _start: error: undefined reference to 'main'
129+
Windows: lld-link: error: subsystem must be defined
130+
MacOS: Could not find or use auto-linked library 'Testing': library 'Testing' not found
131+
""",
132+
isIntermittent: true
128133
) {
129134
try sh(swiftBuild, "--package-path", packagePath, "--build-system", buildSystemProvider.rawValue, "--vv")
130135
let (stdout, stderr) = try sh(

Sources/SwiftBuildSupport/BuildSystem.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extension BuildSubset {
1414
var pifTargetName: String {
1515
switch self {
1616
case .product(let name, _):
17-
_PackagePIFProjectBuilder.targetName(for: name)
17+
targetName(forProductName: name)
1818
case .target(let name, _):
1919
name
2020
case .allExcludingTests:

0 commit comments

Comments
 (0)