Issues in swiftpm test suite while building Apple Swift 5 toolchain on PowerPC64LE

Running the following tests for swiftpm test suite after building Apple Swift 5 toolchain on PowerPC64LE:-

[552/552] Testing WorkspaceTests.InitTests/testInitPackageExecutable

Test Suite 'Selected tests' started at 2019-02-19 12:55:59.632
Test Suite 'BuildPlanTests' started at 2019-02-19 12:55:59.634
Test Case 'BuildPlanTests.testBasicClangPackage' started at 2019-02-19 12:55:59.634
/home/sar/swift-source/swiftpm/Tests/BuildTests/BuildPlanTests.swift:301: error: BuildPlanTests.testBasicClangPackage : XCTAssertEqual failed: ("["-target", "powerpc64le-unknown-linux", "-g", "-O0", "-DSWIFT_PACKAGE=1", "-DDEBUG=1", "-fblocks", "-fmodules", "-fmodule-name=extlib", "-I", "/ExtPkg/Sources/extlib/include", "-fmodules-cache-path=/path/to/build/debug/ModuleCache"]") is not equal to ("["-target", "ppc64le-unknown-linux", "-g", "-O0", "-DSWIFT_PACKAGE=1", "-DDEBUG=1", "-fblocks", "-fmodules", "-fmodule-name=extlib", "-I", "/ExtPkg/Sources/extlib/include", "-fmodules-cache-path=/path/to/build/debug/ModuleCache"]") -
/home/sar/swift-source/swiftpm/Tests/BuildTests/BuildPlanTests.swift:318: error: BuildPlanTests.testBasicClangPackage : XCTAssertEqual failed: ("["-target", "powerpc64le-unknown-linux", "-g", "-O0", "-DSWIFT_PACKAGE=1", "-DDEBUG=1", "-fblocks", "-fmodules", "-fmodule-name=exe", "-I", "/Pkg/Sources/exe/include", "-I", "/Pkg/Sources/lib/include", "-I", "/ExtPkg/Sources/extlib/include", "-fmodules-cache-path=/path/to/build/debug/ModuleCache"]") is not equal to ("["-target", "ppc64le-unknown-linux", "-g", "-O0", "-DSWIFT_PACKAGE=1", "-DDEBUG=1", "-fblocks", "-fmodules", "-fmodule-name=exe", "-I", "/Pkg/Sources/exe/include", "-I", "/Pkg/Sources/lib/include", "-I", "/ExtPkg/Sources/extlib/include", "-fmodules-cache-path=/path/to/build/debug/ModuleCache"]") -
Test Case 'BuildPlanTests.testBasicClangPackage' failed (0.013 seconds)
Test Suite 'BuildPlanTests' failed at 2019-02-19 12:55:59.647
Executed 1 test, with 2 failures (0 unexpected) in 0.013 (0.013) seconds
Test Suite 'Selected tests' failed at 2019-02-19 12:55:59.647
Executed 1 test, with 2 failures (0 unexpected) in 0.013 (0.013) seconds

Test Suite 'Selected tests' started at 2019-02-19 12:55:59.660
Test Suite 'BuildPlanTests' started at 2019-02-19 12:55:59.662
Test Case 'BuildPlanTests.testClangTargets' started at 2019-02-19 12:55:59.662
/home/sar/swift-source/swiftpm/Tests/BuildTests/BuildPlanTests.swift:859: error: BuildPlanTests.testClangTargets : XCTAssertEqual failed: ("["-target", "powerpc64le-unknown-linux", "-g", "-O0", "-DSWIFT_PACKAGE=1", "-DDEBUG=1", "-fblocks", "-fmodules", "-fmodule-name=exe", "-I", "/Pkg/Sources/exe/include", "-fmodules-cache-path=/path/to/build/debug/ModuleCache"]") is not equal to ("["-target", "ppc64le-unknown-linux", "-g", "-O0", "-DSWIFT_PACKAGE=1", "-DDEBUG=1", "-fblocks", "-fmodules", "-fmodule-name=exe", "-I", "/Pkg/Sources/exe/include", "-fmodules-cache-path=/path/to/build/debug/ModuleCache"]") -
/home/sar/swift-source/swiftpm/Tests/BuildTests/BuildPlanTests.swift:868: error: BuildPlanTests.testClangTargets : XCTAssertEqual failed: ("["-target", "powerpc64le-unknown-linux", "-g", "-O0", "-DSWIFT_PACKAGE=1", "-DDEBUG=1", "-fblocks", "-fmodules", "-fmodule-name=lib", "-I", "/Pkg/Sources/lib/include", "-fmodules-cache-path=/path/to/build/debug/ModuleCache"]") is not equal to ("["-target", "ppc64le-unknown-linux", "-g", "-O0", "-DSWIFT_PACKAGE=1", "-DDEBUG=1", "-fblocks", "-fmodules", "-fmodule-name=lib", "-I", "/Pkg/Sources/lib/include", "-fmodules-cache-path=/path/to/build/debug/ModuleCache"]") -
Test Case 'BuildPlanTests.testClangTargets' failed (0.015 seconds)
Test Suite 'BuildPlanTests' failed at 2019-02-19 12:55:59.676
Executed 1 test, with 2 failures (0 unexpected) in 0.015 (0.015) seconds
Test Suite 'Selected tests' failed at 2019-02-19 12:55:59.676
Executed 1 test, with 2 failures (0 unexpected) in 0.015 (0.015) seconds

Test Suite 'Selected tests' started at 2019-02-19 12:55:59.835
Test Suite 'BuildPlanTests' started at 2019-02-19 12:55:59.836
Test Case 'BuildPlanTests.testPlatforms' started at 2019-02-19 12:55:59.836
/home/sar/swift-source/swiftpm/Tests/BuildTests/BuildPlanTests.swift:1178: error: BuildPlanTests.testPlatforms : XCTAssertTrue failed - unexpected failure matching '["-target", "powerpc64le-unknown-linux", "-swift-version", "5", "-enable-batch-mode", "-Onone", "-g", "-enable-testing", "-j7", "-DSWIFT_PACKAGE", "-DDEBUG", "-module-cache-path", "/path/to/build/debug/ModuleCache"]' against pattern [TestSupport.StringPattern.equal("-target"), TestSupport.StringPattern.equal("ppc64le-unknown-linux"), TestSupport.StringPattern.anySequence]
/home/sar/swift-source/swiftpm/Tests/BuildTests/BuildPlanTests.swift:1185: error: BuildPlanTests.testPlatforms : XCTAssertTrue failed - unexpected failure matching '["-target", "powerpc64le-unknown-linux", "-swift-version", "5", "-enable-batch-mode", "-Onone", "-g", "-enable-testing", "-j7", "-DSWIFT_PACKAGE", "-DDEBUG", "-module-cache-path", "/path/to/build/debug/ModuleCache"]' against pattern [TestSupport.StringPattern.equal("-target"), TestSupport.StringPattern.equal("ppc64le-unknown-linux"), TestSupport.StringPattern.anySequence]
Test Case 'BuildPlanTests.testPlatforms' failed (0.012 seconds)
Test Suite 'BuildPlanTests' failed at 2019-02-19 12:55:59.848
Executed 1 test, with 2 failures (0 unexpected) in 0.012 (0.012) seconds
Test Suite 'Selected tests' failed at 2019-02-19 12:55:59.848
Executed 1 test, with 2 failures (0 unexpected) in 0.012 (0.012) seconds

Test Suite 'Selected tests' started at 2019-02-19 12:55:59.855
Test Suite 'BuildPlanTests' started at 2019-02-19 12:55:59.857
Test Case 'BuildPlanTests.testSwiftCMixed' started at 2019-02-19 12:55:59.857
/home/sar/swift-source/swiftpm/Tests/BuildTests/BuildPlanTests.swift:442: error: BuildPlanTests.testSwiftCMixed : XCTAssertEqual failed: ("["-target", "powerpc64le-unknown-linux", "-g", "-O0", "-DSWIFT_PACKAGE=1", "-DDEBUG=1", "-fblocks", "-fmodules", "-fmodule-name=lib", "-I", "/Pkg/Sources/lib/include", "-fmodules-cache-path=/path/to/build/debug/ModuleCache"]") is not equal to ("["-target", "ppc64le-unknown-linux", "-g", "-O0", "-DSWIFT_PACKAGE=1", "-DDEBUG=1", "-fblocks", "-fmodules", "-fmodule-name=lib", "-I", "/Pkg/Sources/lib/include", "-fmodules-cache-path=/path/to/build/debug/ModuleCache"]") -
Test Case 'BuildPlanTests.testSwiftCMixed' failed (0.012 seconds)
Test Suite 'BuildPlanTests' failed at 2019-02-19 12:55:59.869
Executed 1 test, with 1 failure (0 unexpected) in 0.012 (0.012) seconds
Test Suite 'Selected tests' failed at 2019-02-19 12:55:59.869
Executed 1 test, with 1 failure (0 unexpected) in 0.012 (0.012) seconds
--- bootstrap: error: tests failed with exit status 1
Building the standard library for: swift-stdlib-linux-powerpc64le
Running Swift tests for: check-swift-all-linux-powerpc64le check-swift-all-optimize-linux-powerpc64le
./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

It looks like it’s generating the wrong triple to pass to the compiler. @Aciid?

Made following changes in the file "swift-source/swiftpm/Tests/BuildTests/BuildPlanTests.swift" to fix the failing swiftpm test cases:-

	diff --git a/Tests/BuildTests/BuildPlanTests.swift b/Tests/BuildTests/BuildPlanTests.swift
	index 1a08137..19f490f 100644
	— a/Tests/BuildTests/BuildPlanTests.swift
	+++ b/Tests/BuildTests/BuildPlanTests.swift
	@@ -28,7 +28,7 @@ import PackageLoading
		 #elseif arch(i386)
		   let defaultTargetTriple: String = "i386-unknown-linux"
		 #elseif arch(powerpc64le)
	-      let defaultTargetTriple: String = "ppc64le-unknown-linux"
	+      let defaultTargetTriple: String = "powerpc64le-unknown-linux"
		 #elseif arch(s390x)
		   let defaultTargetTriple: String = "s390x-unknown-linux"
		 #elseif arch(arm64)

However, errors are seen after downloading latest Swift master branch as mentioned in - Issues in latest lldb code while building Apple Swift 5 toolchain on PowerPC64LE

Terms of Service

Privacy Policy

Cookie Policy