Giphy / giphy-ios-sdk

Home of the GIPHY SDK iOS example app, along with iOS SDK documentation, issue tracking, & release notes.
https://developers.giphy.com/
Mozilla Public License 2.0
116 stars 52 forks source link

Can't use lldb po when the GiphySDK is included in the project. #256

Open aljux opened 1 month ago

aljux commented 1 month ago

🐛 Bug Report

When including the giphy SDK in a project, it's no longer possible to use the lldb to print any object description, which makes debugging rather difficult. Tested to include the SDK both via cocoapods and SPM.

po scrollView
Could not import Swift modules for translation unit: failed to get module "GiphyUISDK" from AST context:
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:9:19: underlying Objective-C module 'GiphyUISDK' not found
@_exported import GiphyUISDK
                  ^
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:1478:65: initializer does not override a designated initializer from its superclass
  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(image: UIKit.UIImage?)
                                        ~~~~~~~~                ^
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:1480:65: initializer does not override a designated initializer from its superclass
  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(image: UIKit.UIImage?, highlightedImage: UIKit.UIImage?)
                                        ~~~~~~~~                ^
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:1481:65: initializer does not override a designated initializer from its superclass
  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame: CoreFoundation.CGRect)
                                        ~~~~~~~~                ^
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:1464:125: no type named 'GiphyYYAnimatedImageView' in module 'GiphyUISDK'
@objc @_inheritsConvenienceInitializers @objcMembers @_Concurrency.MainActor(unsafe) public class GPHMediaView : GiphyUISDK.GiphyYYAnimatedImageView {
                                                                                                                            ^
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:1735:107: no type named 'GiphyYYImage' in module 'GiphyUISDK'
  public func downloadAsset(_ urlString: Swift.String, key: Swift.String? = nil, completion: ((GiphyUISDK.GiphyYYImage?, (any Swift.Error)?) -> Swift.Void)?) -> Foundation.URLSessionDataTask?

error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:2:1: failed to build module 'GiphyUISDK'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)', while this compiler is 'Apple Swift version 6.0 effective-5.10 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)'). Please select a toolchain which matches the SDK.
// swift-interface-format-version: 1.0

To Reproduce

(Write your steps here:)

  1. Download Xcode 16, create a project that includes the giphySDK via SPM
  2. Build, set a breakpoint
  3. Try to type "po {OBJECT_NAME}", see error

Expected behavior

We should be able to use the lldb as normal

(Write what you thought would happen.)

Actual Behavior

error message in description is shown

Your Environment

aljux commented 1 month ago

Saw that the version 2.2.11 uses the swift 6 toolchain, so switched to that version but still get some errors:

(lldb) po scrollView
Could not import Swift modules for translation unit: failed to get module "GiphyUISDK" from AST context:
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:10:19: underlying Objective-C module 'GiphyUISDK' not found
@_exported import GiphyUISDK
                  ^
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:1483:73: initializer does not override a designated initializer from its superclass
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public init(image: UIKit.UIImage?)
                                                ~~~~~~~~                ^
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:1485:73: initializer does not override a designated initializer from its superclass
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public init(image: UIKit.UIImage?, highlightedImage: UIKit.UIImage?)
                                                ~~~~~~~~                ^
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:1486:73: initializer does not override a designated initializer from its superclass
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public init(frame: CoreFoundation.CGRect)
                                                ~~~~~~~~                ^
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:1469:133: no type named 'GiphyYYAnimatedImageView' in module 'GiphyUISDK'
@objc @_inheritsConvenienceInitializers @objcMembers @_Concurrency.MainActor @preconcurrency public class GPHMediaView : GiphyUISDK.GiphyYYAnimatedImageView {
                                                                                                                                    ^
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:1744:107: no type named 'GiphyYYImage' in module 'GiphyUISDK'
  public func downloadAsset(_ urlString: Swift.String, key: Swift.String? = nil, completion: ((GiphyUISDK.GiphyYYImage?, (any Swift.Error)?) -> Swift.Void)?) -> Foundation.URLSessionDataTask?
                                                                                                          ^
error: .../Contents/Resources/Swift/aarch64/GiphyUISDK.swiftinterface:2:1: failed to build module 'GiphyUISDK' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
// swift-interface-format-version: 1.0
cgmaier commented 1 month ago

hey @aljux thanks for flagging this. by any chance, can you advise on a possible change we can make on our end that might address this issue?