gradle / gradle-native

The home of Gradle's support for natively compiled languages
https://blog.gradle.org/introducing-the-new-cpp-plugins
Apache License 2.0
91 stars 8 forks source link

Swift Package Manager exit with non-zero exit code when no buildable target #1006

Closed lacasseio closed 5 years ago

lacasseio commented 5 years ago

Expected Behavior

Verify this is correct and adjust test in SwiftPackageManagerExportIntegrationTest.produces manifest for build with no native components

Current Behavior

Swift Package Manager exit with non-zero exit code when no buildable target:

Condition failed with Exception:

swiftPmBuildSucceeds()
|
java.lang.AssertionError: Swift PM exited with non-zero exit code. Output:
error: the package does not contain a buildable target

    at org.gradle.swiftpm.SwiftPackageManagerExportIntegrationTest.produces manifest for build with no native components(SwiftPackageManagerExportIntegrationTest.groovy:48)
Caused by: java.lang.AssertionError: Swift PM exited with non-zero exit code. Output:
error: the package does not contain a buildable target

    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at org.gradle.language.swift.SwiftPmRunner.build(SwiftPmRunner.groovy:59)
    at org.gradle.swiftpm.AbstractSwiftPackageManagerExportIntegrationTest.swiftPmBuildSucceeds(AbstractSwiftPackageManagerExportIntegrationTest.groovy:35)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    ... 1 more

Context

Steps to Reproduce (for bugs)

Your Environment

lacasseio commented 5 years ago

It seems 4.2.1 is also affected by this change. I will just ignore the test for now.

lacasseio commented 5 years ago

The change should be limited to Swift PM 5.0+ according to this commit: https://github.com/apple/swift-package-manager/commit/601163968acc6882f0069fde26f2202e912d9940

lacasseio commented 5 years ago

PR https://github.com/gradle/gradle/pull/9189 should fix this issue.