-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Non-darwin test discovery with Swift Build #8722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -362,6 +362,7 @@ public final class PackagePIFBuilder { | |
case framework | ||
case executable | ||
case unitTest | ||
case unitTestRunner | ||
case bundle | ||
case resourceBundle | ||
case packageProduct | ||
|
@@ -385,6 +386,7 @@ public final class PackagePIFBuilder { | |
case .framework: .framework | ||
case .executable: .executable | ||
case .unitTest: .unitTest | ||
case .swiftpmTestRunner: .unitTestRunner | ||
case .bundle: .bundle | ||
case .packageProduct: .packageProduct | ||
case .hostBuildTool: fatalError("Unexpected hostBuildTool type") | ||
|
@@ -520,7 +522,15 @@ public final class PackagePIFBuilder { | |
settings[.WATCHOS_DEPLOYMENT_TARGET] = builder.deploymentTargets[.watchOS] ?? nil | ||
settings[.DRIVERKIT_DEPLOYMENT_TARGET] = builder.deploymentTargets[.driverKit] ?? nil | ||
settings[.XROS_DEPLOYMENT_TARGET] = builder.deploymentTargets[.visionOS] ?? nil | ||
settings[.DYLIB_INSTALL_NAME_BASE] = "@rpath" | ||
|
||
owenv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
for machoPlatform in [ProjectModel.BuildSettings.Platform.macOS, .macCatalyst, .iOS, .watchOS, .tvOS, .xrOS, .driverKit] { | ||
settings.platformSpecificSettings[machoPlatform]![.DYLIB_INSTALL_NAME_BASE]! = ["@rpath"] | ||
} | ||
for elfPlatform in [ProjectModel.BuildSettings.Platform.linux, .android, .openbsd, .freebsd] { | ||
// FIXME: Treating $ORIGIN as part of the soname is not really the right thing to do here | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can just not set it at all. The soname on ELF platforms should just be the leaf name. $ORIGIN is only used in rpaths. I realize I might've misled you in my previous comment, I was misremembering what the conventions were before. (Referencing Qbs, that's what we did there -- libraries set cpp.sonamePrefix (DYLIB_INSTALL_NAME_BASE equivalent) to @rpath on Darwin and nothing elsewhere, while cpp.rpaths (LD_RUNPATH_SEARCH_PATHS equivalent) referenced cpp.rpathOrigin, a helper variable which is @loader_path on Darwin and $ORIGIN on ELF) |
||
settings.platformSpecificSettings[elfPlatform]![.DYLIB_INSTALL_NAME_BASE]! = ["$ORIGIN"] | ||
} | ||
|
||
settings[.USE_HEADERMAP] = "NO" | ||
settings[.OTHER_SWIFT_FLAGS].lazilyInitializeAndMutate(initialValue: ["$(inherited)"]) { $0.append("-DXcode") } | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4106,11 +4106,12 @@ class PackageCommandSwiftBuildTests: PackageCommandTestCase { | |
throw XCTSkip("SWBINTTODO: Build plan is not currently supported") | ||
} | ||
|
||
#if !os(macOS) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: why are we not executing this test on macOS? |
||
override func testCommandPluginTestingCallbacks() async throws { | ||
throw XCTSkip("SWBINTTODO: Requires PIF generation to adopt new test runner product type") | ||
try XCTSkipOnWindows(because: "TSCBasic/Path.swift:969: Assertion failed, https://github.com/swiftlang/swift-package-manager/issues/8602") | ||
try await super.testCommandPluginTestingCallbacks() | ||
} | ||
#endif | ||
|
||
override func testCommandPluginTargetBuilds() async throws { | ||
try XCTSkipOnWindows(because: "TSCBasic/Path.swift:969: Assertion failed, https://github.com/swiftlang/swift-package-manager/issues/8602") | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could do if-macOS
"\(base)/Contents/MacOS/\(product.name)"
else-if-Darwin "(base)/(product.name)" so it'll support makingswift test
work for simulator targets (acknowledging that would need additional changes elsewhere for that to be fully working)