xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.44k stars 510 forks source link

Objective Sharpie fails to generate - stuck on parsing Foundation #17330

Closed entdark closed 1 year ago

entdark commented 1 year ago

Steps to Reproduce

  1. Download https://github.com/devtodev-analytics/ios-sdk/tree/master/devtodev-ios%201.16.0/devtodev.framework
  2. Try to bind with command sharpie bind -sdk iphoneos16.2 -framework devtodev.framework

Expected Behavior

  1. We get generated ApiDefinitions.cs and StructsAndEnums.cs.

Actual Behavior

  1. It fails while processing Foundation build-in package. It used to generate ApiDefinitions.cs and StructsAndEnums.cs with that exact framework. The output log:
    
    sharpie bind -sdk iphoneos16.2 -framework devtodev.framework
    Parsing 1 header files...
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:371:81: error: 
      function does not return string type
    ...char *)nullTerminatedCString NS_FORMAT_ARGUMENT(1);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                  ~
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: 
      expanded from macro 'NS_FORMAT_ARGUMENT'
        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
                                                      ^          ~
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:372:52: error: 
      function does not return NSString
    - (instancetype)initWithString:(NSString *)aString NS_FORMAT_ARGUMENT(1);
                                ~~~~~~~~~~~~~~~~~~ ^                  ~
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: 
      expanded from macro 'NS_FORMAT_ARGUMENT'
        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
                                                      ^          ~
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:387:53: error: 
      function does not return NSString
    + (instancetype)stringWithString:(NSString *)string NS_FORMAT_ARGUMENT(1);
                                  ~~~~~~~~~~~~~~~~~ ^                  ~
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: 
      expanded from macro 'NS_FORMAT_ARGUMENT'
        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
                                                      ^          ~
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:389:83: error: 
      function does not return string type
    ...char *)nullTerminatedCString NS_FORMAT_ARGUMENT(1);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                  ~
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: 
      expanded from macro 'NS_FORMAT_ARGUMENT'
        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
                                                      ^          ~
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:395:114: error: 
      function does not return string type
    ...char *)nullTerminatedCString encoding:(NSStringEncoding)encoding NS_FORMAT_ARGUMENT(1);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                     ^                  ~
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: 
      expanded from macro 'NS_FORMAT_ARGUMENT'
        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
                                                      ^          ~
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:396:97: error: 
      function does not return string type
    ...char *)cString encoding:(NSStringEncoding)enc NS_FORMAT_ARGUMENT(1);
     ~~~~~~~~~~~~~~                                ^                  ~
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: 
      expanded from macro 'NS_FORMAT_ARGUMENT'
        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
                                                      ^          ~
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: 
      function does not return NSString
    ...NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1...
     ~~~~~~~~~~~~~~                                                                       ^                  ~
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: 
      expanded from macro 'NS_FORMAT_ARGUMENT'
        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
                                                      ^          ~
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:130:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLSession.h:505:186: error: 
      expected ')'
    ...(NS_SWIFT_SENDABLE ^) (NSData * _Nullable_result data, BOOL atEOF, NSErr...
                                                      ^
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLSession.h:505:159: note: 
      to match this '('
    ...completionHandler:(void (NS_SWIFT_SENDABLE ^) (NSData * _Nullable_resul...
                                                   ^
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    In file included from <module-includes>:1:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:9: fatal error: 
      could not build module 'Foundation'
    #import <Foundation/Foundation.h>
    ~~~~~~~^
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h:13:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.h:9:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImageDefines.h:19:9: fatal error: 
      could not build module 'Foundation'
    #import <Foundation/Foundation.h>
    ~~~~~~~^
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h:13:
    While building module 'CoreVideo' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:15:
    While building module 'IOSurface' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h:26:
    In file included from <module-includes>:3:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceObjC.h:15:9: fatal error: 
      could not build module 'Foundation'
    #import <Foundation/Foundation.h>
    ~~~~~~~^
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h:13:
    While building module 'CoreVideo' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:15:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:29:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h:628:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h:26:10: fatal error: 
      could not build module 'IOSurface'
    #include <IOSurface/IOSurfaceRef.h>
    ~~~~~~~~^
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h:13:
    While building module 'CoreVideo' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:15:
    While building module 'OpenGLES' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVOpenGLESTexture.h:23:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGLDrawable.h:8:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGL.h:8:10: fatal error: 
      could not build module 'Foundation'
    #include <Foundation/Foundation.h>
    ~~~~~~~~^
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h:13:
    While building module 'CoreVideo' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:15:
    While building module 'Metal' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalTextureCache.h:41:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.h:9:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h:8:9: fatal error: 
      could not build module 'Foundation'
    #import <Foundation/Foundation.h>
    ~~~~~~~^
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'QuartzCore' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:10:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:10:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h:12:9: fatal error: 
      could not build module 'Foundation'
    #import <Foundation/NSValue.h>
    ~~~~~~~^
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'FileProvider' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSFileProviderExtension.h:15:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/FileProvider.h:16:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h:8:9: fatal error: 
      could not build module 'Foundation'
    #import <Foundation/Foundation.h>
    ~~~~~~~^
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'UIKit' imported from ./devtodev.framework/Headers/devtodev.h:1:
    While building module 'UserNotifications' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UNNotificationResponse+UIKitAdditions.h:10:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.h:8:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/NSString+UserNotifications.h:8:9: fatal error: 
      could not build module 'Foundation'
    #import <Foundation/Foundation.h>
    ~~~~~~~^
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    In file included from <module-includes>:1:
    ./devtodev.framework/Headers/devtodev.h:1:9: fatal error: could not build module
      'UIKit'
    #import <UIKit/UIKit.h>
    ~~~~~~~^
    While building module 'devtodev' imported from /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:
    While building module 'StoreKit' imported from ./devtodev.framework/Headers/DevToDevCheat.h:2:
    In file included from <module-includes>:1:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/StoreKit.framework/Headers/StoreKit.h:8:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/StoreKit.framework/Headers/SKAdImpression.h:8:9: fatal error: 
      could not build module 'Foundation'
    #import <Foundation/Foundation.h>
    ~~~~~~~^
    /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h:1:9: fatal error: 
      could not build module 'devtodev'
    @import devtodev;
    ~~~~~~~^~~~~~~~

Binding... System.BadImageFormatException: File name: '/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll' at (wrapper managed-to-native) System.Reflection.Assembly:LoadFrom (string,bool) at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/Assembly.cs:536 at Sharpie.Bind.Massagers.XamarinApiMappingMassager.Initialize () [0x0002c] in /Users/builder/vsts/_work/2/s/Sharpie.Bind/Massagers/XamarinApiMappingMassager.cs:50 20 errors generated. Error while processing /private/var/folders/n0/ydqhfx7j4pb5thzcdw07fqn00000gn/T/com.xamarin.ObjectiveSharpie/866f25ea3e6b4386bfee345ebd436ca3.h.

Done. Exiting with error code 1. error: Clang failed to parse input and exited with code 1


### Environment

Visual Studio Community 2022 for Mac Version 17.4.2 (build 17) Installation UUID: a12bc15b-ea7b-4355-be72-5acb24a856f8

Runtime .NET 6.0.12 (64-bit) Architecture: Arm64

Roslyn (Language Service) 4.4.0-6.22578.12+3c6ab8e1715e5b080fb7bb77070810ab71e09387

NuGet Version: 6.3.1.1

.NET SDK (Arm64) SDK: /usr/local/share/dotnet/sdk/7.0.101/Sdks SDK Versions: 7.0.101 6.0.404 MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET Runtime (Arm64) Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 7.0.1 6.0.12

Xamarin.Profiler Version: 1.8.0.19 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater Version: 11

Xamarin.Android Version: 13.1.0.1 (Visual Studio Community) Commit: xamarin-android/d17-4/13ba222 Android SDK: /Users/vladimir/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 12.0 (API level 31) 11.0 (API level 30) 13.0 (API level 33)

SDK Command-line Tools Version: 7.0 SDK Platform Tools Version: 33.0.2 SDK Build Tools Version: 32.0.0

Build Information: Mono: a96bde9 Java.Interop: xamarin/java.interop/d17-4@fcc33ce2 SQLite: xamarin/sqlite/3.39.3@23e1ae7 Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a

Microsoft Build of OpenJDK Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk 11.0.12 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL

Eclipse Temurin JDK Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk 1.8.0.302 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager Version: 17.4.0.54 Hash: 6eabb9e Branch: remotes/origin/d17-4 Build date: 2022-12-13 00:02:50 UTC

Android Device Manager Version: 0.0.0.1206 Hash: 886af39 Branch: 886af39 Build date: 2022-12-13 00:02:50 UTC

Xamarin Designer Version: 17.4.0.136 Hash: d49c9ff6d3 Branch: remotes/origin/d17-4 Build date: 2022-12-13 00:02:45 UTC

Apple Developer Tools Xcode 14.2 (21534) Build 14C18

Xamarin.Mac Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

Xamarin.iOS Version: 16.1.1.27 (Visual Studio Community) Hash: 933c6c2c9 Branch: xcode14.1 Build date: 2022-11-22 02:00:37-0500

Build Information Release ID: 1704020017 Git revision: 7ef5413f2eec3351ce648085f619fc29fd8cb647 Build date: 2022-12-13 00:00:15+00 Build branch: release-17.4 Build lane: release-17.4

Operating System Mac OS X 13.0.1 Darwin 22.1.0 Darwin Kernel Version 22.1.0 Sun Oct 9 20:14:30 PDT 2022 root:xnu-8792.41.9~2/RELEASE_ARM64_T8103 arm64

rolfbjarne commented 1 year ago

What does sharpie --version return?

ghost commented 1 year ago

Hi @entdark. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost commented 1 year ago

Hi @entdark. Due to inactivity, we will be closing this issue. Please feel free to re-open this issue if the issue persists. For enhanced visibility, if over 7 days have passed, please open a new issue and link this issue there. Thank you.

entdark commented 1 year ago

Sorry for the inactivity. That was my mistake. I used an old sharpie version 3.4.0 from Releases: https://learn.microsoft.com/en-us/xamarin/cross-platform/macios/binding/objective-sharpie/releases?context=xamarin%2Fios Latest version could be found here: https://aka.ms/objective-sharpie from: https://learn.microsoft.com/en-us/xamarin/cross-platform/macios/binding/objective-sharpie/

dalexsoto commented 1 year ago

Can you try doing sharpie bind -sdk iphoneos16.2 -framework ./devtodev.framework notice the ./

entdark commented 1 year ago

Sorry, I did not make it clear. After updating to the latest version I managed to generate ApiDefinitions.cs and StructsAndEnums.cs with almost identical command (besides the file path). The issue is resolved.