readium / r2-testapp-swift

BSD 3-Clause "New" or "Revised" License
146 stars 38 forks source link

r2-lcp-swift fails in Carthage update #378

Closed cbaltzer closed 3 years ago

cbaltzer commented 3 years ago

The content of your Cartfile

github "onevcat/Kingfisher" == 5.15.8
github "weichsel/ZIPFoundation" == 0.9.11
github "jdg/MBProgressHUD" == 1.2.0
github "stephencelis/SQLite.swift" == 0.12.2
github "edrlab/GCDWebServer" == 3.6.3
github "krzyzanowskim/CryptoSwift" == 1.3.8
github "cezheng/Fuzi" == 3.1.3
github "dexman/Minizip" == 1.4.0
github "scinfu/SwiftSoup" == 2.3.2

github "readium/r2-shared-swift" "develop"
github "readium/r2-streamer-swift" "develop"
github "readium/r2-navigator-swift" "develop"
github "readium/readium-opds-swift" "develop"

github "readium/r2-lcp-swift" "develop"

How your project is organized (submodules or Carthage dependencies)

Carthage dependencies. This is a fresh clone of r2-testapp-swift on the develop branch.

In which folder did you run carthage update --use-xcframeworks --platform iOS

The repo root. ~/r2-testapp-swift

The output of carthage update --use-xcframeworks --platform iOS

<snip>
*** xcodebuild output can be found in /var/folders/p1/kjqxj3_d6t34zxjmlzh381m40000gp/T/carthage-xcodebuild.ImNwym.log
*** Downloading CryptoSwift.framework binary at "Back to Sources"
*** Building scheme "CryptoSwift" in CryptoSwift.xcodeproj
*** Building scheme "Fuzi" in Fuzi.xcworkspace
*** Building scheme "Minizip-iOS" in Minizip.xcodeproj
*** Building scheme "r2-shared-swift" in r2-shared-swift.xcodeproj
*** Building scheme "SQLite iOS" in SQLite.xcodeproj
*** Building scheme "ZIPFoundation" in ZIPFoundation.xcodeproj
*** Building scheme "readium-lcp-swift" in r2-lcp-swift.xcodeproj
Build Failed
    Task failed with exit code 65:
    /usr/bin/xcrun xcodebuild -project /Users/cbaltzer/r2-testapp-swift/Carthage/Checkouts/r2-lcp-swift/r2-lcp-swift.xcodeproj -scheme readium-lcp-swift -configuration Release -derivedDataPath /Users/cbaltzer/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/r2-lcp-swift/c685700532c1d4d60c852946e225902d36c97690 -sdk iphonesimulator -destination platform=iOS\ Simulator,id=E25D813C-3BBF-40B1-A3CE-632CA5524B72 -destination-timeout 3 ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES build VALIDATE_WORKSPACE=NO FRAMEWORK_SEARCH_PATHS=$(inherited)\ /var/folders/p1/kjqxj3_d6t34zxjmlzh381m40000gp/T/carthage-xcframework-fdIU (launched in /Users/cbaltzer/r2-testapp-swift/Carthage/Checkouts/r2-lcp-swift)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/p1/kjqxj3_d6t34zxjmlzh381m40000gp/T/carthage-xcodebuild.ImNwym.log

And the tail of the log:

/Users/cbaltzer/r2-testapp-swift/Carthage/Checkouts/r2-lcp-swift/readium-lcp-swift/License/LicenseValidation.swift:13:8: error: failed to build module 'R2LCPClient' from its module interface; the compiler that produced it, 'Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)'
import R2LCPClient
       ^
<unknown>:0: error: unable to load standard library for target 'arm64-apple-ios9.0'
<unknown>:0: error: unable to load standard library for target 'arm64-apple-ios9.0'

** BUILD FAILED **

The following build commands failed:
    CompileSwift normal x86_64
    CompileSwift normal i386
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
    CompileSwift normal arm64
(4 failures)

The output of ls r2-testapp-swift/Carthage/Build

Didn't grab this, see below.

Partial Resolution

I was able to get the build working using the carthage.sh script from here. However, still opening this issue since a custom script shouldn't be needed. Or should be much more visible, at least.

mickael-menu commented 3 years ago

The problem is probably caused by having github "readium/r2-lcp-swift" "develop" in the Cartfile. It's not present in r2-testapp-swift's Cartfile.

r2-lcp-swift used to not be really compatible with Carthage, because you needed to modify its Cartfile file to add the R2LCPClient dependency. I fixed this recently in a yet to be merged PR by removing the dependency to R2LCPClient: https://github.com/readium/r2-lcp-swift/pull/112

However until it is merged (soon), you need to integrate r2-lcp-swift as a submodule, as showcased in r2-testapp-swift.

mickael-menu commented 3 years ago

I merged the aforementioned PRs, it should work now with github "readium/r2-lcp-swift" "develop" in your Cartfile.