Skip to content

Re-enable more plugin related tests for non-macOS platforms #8558

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

Merged
merged 12 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from 11 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
6 changes: 3 additions & 3 deletions Sources/SwiftBuildSupport/PackagePIFBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,9 @@ extension PackagePIFBuilder.LinkedPackageBinary {

init?(dependency: ResolvedModule.Dependency, package: ResolvedPackage) {
switch dependency {
case .product(let producutDependency, _):
guard producutDependency.hasSourceTargets else { return nil }
self.init(name: producutDependency.name, packageName: package.name, type: .product)
case .product(let productDependency, _):
guard productDependency.hasSourceTargets else { return nil }
self.init(name: productDependency.name, packageName: package.name, type: .product)

case .module(let moduleDependency, _):
self.init(module: moduleDependency, package: package)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,20 +504,14 @@ extension PackagePIFProjectBuilder {
}

// Additional settings for the linker.
let baselineOTHER_LDFLAGS: [String]
let enableDuplicateLinkageCulling = UserDefaults.standard.bool(
forKey: "IDESwiftPackagesEnableDuplicateLinkageCulling",
defaultValue: true
)
if enableDuplicateLinkageCulling {
baselineOTHER_LDFLAGS = [
"-Wl,-no_warn_duplicate_libraries",
"$(inherited)"
]
} else {
baselineOTHER_LDFLAGS = ["$(inherited)"]
impartedSettings[.LD_WARN_DUPLICATE_LIBRARIES] = "NO"
}
impartedSettings[.OTHER_LDFLAGS] = (sourceModule.isCxx ? ["-lc++"] : []) + baselineOTHER_LDFLAGS
impartedSettings[.OTHER_LDFLAGS] = (sourceModule.isCxx ? ["-lc++"] : []) + ["$(inherited)"]
impartedSettings[.OTHER_LDRFLAGS] = []
log(
.debug,
Expand Down
9 changes: 0 additions & 9 deletions Tests/CommandsTests/BuildCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -956,13 +956,4 @@ class BuildCommandSwiftBuildTests: BuildCommandTestCases {

try await super.testBuildSystemDefaultSettings()
}

override func testBuildCompleteMessage() async throws {
#if os(Linux)
throw XCTSkip("SWBINTTODO: Need to properly set LD_LIBRARY_PATH on linux")
#else
try await super.testBuildCompleteMessage()
#endif
}

}
10 changes: 8 additions & 2 deletions Tests/CommandsTests/PackageCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3898,15 +3898,21 @@ class PackageCommandSwiftBuildTests: PackageCommandTestCase {
}

override func testCommandPluginBuildingCallbacks() async throws {
throw XCTSkip("SWBINTTODO: Test fails as plugins are not currenty supported")
throw XCTSkip("SWBINTTODO: Test fails because plugin is not producing expected output to stdout.")
}
override func testCommandPluginBuildTestability() async throws {
throw XCTSkip("SWBINTTODO: Test fails as plugins are not currenty supported")
}

#if !os(macOS)
override func testCommandPluginTestingCallbacks() async throws {
throw XCTSkip("SWBINTTODO: Test fails on inability to find libclang on Linux. Also, plugins are not currently supported")
#if os(Linux)
if FileManager.default.contents(atPath: "/etc/system-release").map { String(decoding: $0, as: UTF8.self) == "Amazon Linux release 2 (Karoo)\n" } ?? false {
throw XCTSkip("Skipping Swift Build testing on Amazon Linux because of platform issues.")
}
#endif
try await super.testCommandPluginTestingCallbacks()
}
#endif

}
16 changes: 8 additions & 8 deletions Tests/CommandsTests/TestCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -701,35 +701,35 @@ class TestCommandSwiftBuildTests: TestCommandTestCase {

#if !os(macOS)
override func testSwiftTestXMLOutputVerifySingleTestFailureMessageWithFlagDisabledXCTest() async throws {
throw XCTSkip("Result XML could not be found. The build fails due to an LD_LIBRARY_PATH issue finding swift core libraries. https://github.com/swiftlang/swift-package-manager/issues/8416")
throw XCTSkip("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms: https://github.com/swiftlang/swift-package-manager/issues/8479")
}

override func testSwiftTestXMLOutputVerifyMultipleTestFailureMessageWithFlagEnabledXCTest() async throws {
throw XCTSkip("Result XML could not be found. The build fails due to an LD_LIBRARY_PATH issue finding swift core libraries. https://github.com/swiftlang/swift-package-manager/issues/8416")
throw XCTSkip("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms: https://github.com/swiftlang/swift-package-manager/issues/8479")
}

override func testSwiftTestXMLOutputVerifySingleTestFailureMessageWithFlagEnabledXCTest() async throws {
throw XCTSkip("Result XML could not be found. The build fails due to an LD_LIBRARY_PATH issue finding swift core libraries. https://github.com/swiftlang/swift-package-manager/issues/8416")
throw XCTSkip("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms: https://github.com/swiftlang/swift-package-manager/issues/8479")
}

override func testSwiftTestXMLOutputVerifyMultipleTestFailureMessageWithFlagDisabledXCTest() async throws {
throw XCTSkip("Result XML could not be found. The build fails due to an LD_LIBRARY_PATH issue finding swift core libraries. https://github.com/swiftlang/swift-package-manager/issues/8416")
throw XCTSkip("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms: https://github.com/swiftlang/swift-package-manager/issues/8479")
}

override func testSwiftTestSkip() async throws {
throw XCTSkip("This fails due to a linker error on Linux. https://github.com/swiftlang/swift-package-manager/issues/8439")
throw XCTSkip("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms: https://github.com/swiftlang/swift-package-manager/issues/8479")
}

override func testSwiftTestXMLOutputWhenEmpty() async throws {
throw XCTSkip("This fails due to a linker error on Linux. https://github.com/swiftlang/swift-package-manager/issues/8439")
throw XCTSkip("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms: https://github.com/swiftlang/swift-package-manager/issues/8479")
}

override func testSwiftTestFilter() async throws {
throw XCTSkip("This fails due to an unknown linker error on Linux. https://github.com/swiftlang/swift-package-manager/issues/8439")
throw XCTSkip("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms: https://github.com/swiftlang/swift-package-manager/issues/8479")
}

override func testSwiftTestParallel() async throws {
throw XCTSkip("This fails due to an unknown linker error on Linux. https://github.com/swiftlang/swift-package-manager/issues/8439")
throw XCTSkip("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms: https://github.com/swiftlang/swift-package-manager/issues/8479")
}
#endif
}