Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

darwin-amd64 Command Line Tools for Xcode 15 fails to compile on linux-amd64 #212

Open
Antiarchitect opened this issue Nov 8, 2023 · 5 comments

Comments

@Antiarchitect
Copy link

Antiarchitect commented Nov 8, 2023

Describe the bug:

darwin target won't compile on linux host

To Reproduce:

Steps to reproduce the behaviour:

  1. Download Command Line Tools: https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_15/Command_Line_Tools_for_Xcode_15.dmg
  2. Import it with darwin-sdk-extract
  3. fyne-cross darwin -macosx-sdk-path /path/to/extractd/SDKs/MacOSX14.0.sdk/ -name some.app ./cmd/someapp/

Device and debug info (please complete the following information):

Device info
  • OS: Linux homebook 6.6.0 #1-NixOS SMP PREEMPT_DYNAMIC Mon Oct 30 02:31:08 UTC 2023 x86_64 GNU/Linux
  • Go version: go version go1.20.8 linux/amd64
  • fyne-cross version: fyne-cross version (devel) f8b06cf33396ad174fa7169216560a9d63e6cd73
  • Fyne version: fyne.io/fyne/v2 v2.4.1 h1:Es100N6HIhJGg8H2ZAS2j5H/YibfxecXHs2V4A4hbq8=
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/native_darwin.go:7:
In file included from ./glfw/include/GLFW/glfw3native.h:108:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:13:
In file included from /sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:
/sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:402:114: error: function does not return string type
- (nullable instancetype)initWithCString:(const char *)nullTerminatedCString encoding:(NSStringEncoding)encoding NS_FORMAT_ARGUMENT(1);
                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                     ^                  ~
/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)))
                                                      ^          ~
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/native_darwin.go:7:
In file included from ./glfw/include/GLFW/glfw3native.h:108:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:13:
In file included from /sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:
/sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:403:97: error: function does not return string type
+ (nullable instancetype)stringWithCString:(const char *)cString encoding:(NSStringEncoding)enc NS_FORMAT_ARGUMENT(1);
                                                  ~~~~~~~~~~~~~~                                ^                  ~
/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)))
                                                      ^          ~
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/native_darwin.go:7:
In file included from ./glfw/include/GLFW/glfw3native.h:108:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:93:
In file included from /sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:23:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:87:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h:26:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:56:
In file included from /sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h:28:
In file included from /sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:49:
/sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h:81:49: error: expected ';' after top level declarator
typedef mach_vm_address_t       IOVirtualAddress __kernel_ptr_semantics;
                                                ^
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/native_darwin.go:7:
In file included from ./glfw/include/GLFW/glfw3native.h:108:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:93:
In file included from /sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:23:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:87:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h:26:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:56:
In file included from /sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h:28:
In file included from /sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:52:
/sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h:120:53: error: expected ';' after top level declarator
typedef natural_t OSAsyncReference[kOSAsyncRefCount] __kernel_ptr_semantics;
                                                    ^
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/native_darwin.go:7:
In file included from ./glfw/include/GLFW/glfw3native.h:108:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:56:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCIImageRep.h:11:
In file included from /sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:15:
In file included from /sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:29:
/sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h:238:167: error: expected ','
CV_EXPORT const CFStringRef CV_NONNULL kCVPixelBufferOpenGLESCompatibilityKey API_AVAILABLE(ios(6.0), tvos(9.0)) API_UNAVAILABLE(macosx) API_UNAVAILABLE(macCatalyst) API_UNAVAILABLE(visionos) __WATCHOS_PROHIBITED;       // CFBoolean
                                                                                                                                                                      ^
/usr/local/zig/lib/libc/include/any-macos-any/os/availability.h:102:190: note: expanded from macro 'API_UNAVAILABLE'
    #define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6, __API_UNAVAILABLE5, __API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1, 0)(__VA_ARGS__)
                                                                                                                                                                                             ^
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/native_darwin.go:7:
In file included from ./glfw/include/GLFW/glfw3native.h:108:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:56:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCIImageRep.h:11:
In file included from /sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:15:
In file included from /sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:29:
/sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h:241:179: error: expected ','
CV_EXPORT const CFStringRef CV_NONNULL kCVPixelBufferOpenGLESTextureCacheCompatibilityKey API_AVAILABLE(ios(9.0), tvos(9.0)) API_UNAVAILABLE(macosx) API_UNAVAILABLE(macCatalyst) API_UNAVAILABLE(visionos) __WATCHOS_PROHIBITED;
                                                                                                                                                                                  ^
/usr/local/zig/lib/libc/include/any-macos-any/os/availability.h:102:190: note: expanded from macro 'API_UNAVAILABLE'
    #define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6, __API_UNAVAILABLE5, __API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1, 0)(__VA_ARGS__)
                                                                                                                                                                                             ^
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/native_darwin.go:7:
In file included from ./glfw/include/GLFW/glfw3native.h:108:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:56:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCIImageRep.h:11:
In file included from /sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:15:
In file included from /sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:29:
In file included from /sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h:629:
/sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h:43:121: error: expected ','
CV_EXPORT const CFStringRef CV_NONNULL kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey API_AVAILABLE(macosx(10.6)) API_UNAVAILABLE(visionos) __IOS_PROHIBITED __TVOS_PROHIBITED __WATCHOS_PROHIBITED;      // CFBoolean
                                                                                                                        ^
/usr/local/zig/lib/libc/include/any-macos-any/os/availability.h:102:190: note: expanded from macro 'API_UNAVAILABLE'
    #define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6, __API_UNAVAILABLE5, __API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1, 0)(__VA_ARGS__)
                                                                                                                                                                                             ^
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/native_darwin.go:7:
In file included from ./glfw/include/GLFW/glfw3native.h:108:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:56:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCIImageRep.h:11:
In file included from /sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:15:
In file included from /sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:29:
In file included from /sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h:629:
/sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h:45:117: error: expected ','
CV_EXPORT const CFStringRef CV_NONNULL kCVPixelBufferIOSurfaceOpenGLFBOCompatibilityKey API_AVAILABLE(macosx(10.6)) API_UNAVAILABLE(visionos) __IOS_PROHIBITED __TVOS_PROHIBITED __WATCHOS_PROHIBITED;  // CFBoolean
                                                                                                                    ^
/usr/local/zig/lib/libc/include/any-macos-any/os/availability.h:102:190: note: expanded from macro 'API_UNAVAILABLE'
    #define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6, __API_UNAVAILABLE5, __API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1, 0)(__VA_ARGS__)
                                                                                                                                                                                             ^
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/native_darwin.go:7:
In file included from ./glfw/include/GLFW/glfw3native.h:108:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:56:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCIImageRep.h:11:
In file included from /sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:15:
In file included from /sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:29:
In file included from /sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h:629:
/sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h:50:183: error: expected ','
CV_EXPORT const CFStringRef CV_NONNULL kCVPixelBufferIOSurfaceOpenGLESTextureCompatibilityKey API_AVAILABLE(ios(5.0), tvos(9.0)) API_UNAVAILABLE(macosx) API_UNAVAILABLE(macCatalyst) API_UNAVAILABLE(visionos) __WATCHOS_PROHIBITED;   // CFBoolean
                                                                                                                                                                                      ^
/usr/local/zig/lib/libc/include/any-macos-any/os/availability.h:102:190: note: expanded from macro 'API_UNAVAILABLE'
    #define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6, __API_UNAVAILABLE5, __API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1, 0)(__VA_ARGS__)
                                                                                                                                                                                             ^
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/native_darwin.go:7:
In file included from ./glfw/include/GLFW/glfw3native.h:108:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:56:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCIImageRep.h:11:
In file included from /sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:15:
In file included from /sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:29:
In file included from /sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h:629:
/sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h:52:179: error: expected ','
CV_EXPORT const CFStringRef CV_NONNULL kCVPixelBufferIOSurfaceOpenGLESFBOCompatibilityKey API_AVAILABLE(ios(5.0), tvos(9.0)) API_UNAVAILABLE(macosx) API_UNAVAILABLE(macCatalyst) API_UNAVAILABLE(visionos) __WATCHOS_PROHIBITED;       // CFBoolean
                                                                                                                                                                                  ^
/usr/local/zig/lib/libc/include/any-macos-any/os/availability.h:102:190: note: expanded from macro 'API_UNAVAILABLE'
    #define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6, __API_UNAVAILABLE5, __API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1, 0)(__VA_ARGS__)
                                                                                                                                                                                             ^
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/native_darwin.go:7:
In file included from ./glfw/include/GLFW/glfw3native.h:108:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:56:
In file included from /sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCIImageRep.h:11:
In file included from /sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:15:
In file included from /sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:45:
/sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelFormatDescription.h:117:164: error: expected ','
CV_EXPORT const CFStringRef CV_NONNULL kCVPixelFormatOpenGLESCompatibility API_AVAILABLE(ios(5.0), tvos(9.0)) API_UNAVAILABLE(macosx) API_UNAVAILABLE(macCatalyst) API_UNAVAILABLE(visionos) __WATCHOS_PROHIBITED;
                                                                                                                                                                   ^
/usr/local/zig/lib/libc/include/any-macos-any/os/availability.h:102:190: note: expanded from macro 'API_UNAVAILABLE'
    #define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6, __API_UNAVAILABLE5, __API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1, 0)(__VA_ARGS__)
                                                                                                                                                                                             ^
15 errors generated.

error building application: exit status 1
@Antiarchitect Antiarchitect changed the title darwin-amd64 MacOSX14.0.sdk fails on linux host darwin-amd64 Command Line Tools for Xcode 15 fails to compile on linux-amd64 Nov 8, 2023
@Bluebugs
Copy link
Contributor

Bluebugs commented Nov 9, 2023

Yes, xcode 15 is causing trouble. This need to be addressed, but in the mean time you can use version 12, if I remember correctly.

@Antiarchitect
Copy link
Author

Thank you :)
I will try it.

@Antiarchitect
Copy link
Author

Antiarchitect commented Nov 9, 2023

With CLT for Xcode 12 I've successfully built an app for amd64 and arm64, but it seems like it won't run on the modern MacOSX.
Is there any backward compatibility caveats wih old CLT version vs newer OS version?

@andydotxyz
Copy link
Member

It should run. Can you be more specific about what way it won't work?

@Antiarchitect
Copy link
Author

I've investigated it further and it could be because of the MacOSX quarantine. It seems xattr -d com.apple.quarantine ./path/to/my.app does the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants