darlinghq / darling

Darwin/macOS emulation layer for Linux
http://www.darlinghq.org
GNU General Public License v3.0
11.45k stars 445 forks source link

Xcode 9 and 10 need some stubs #445

Closed woachk closed 5 years ago

woachk commented 6 years ago

This prevents running Xcode 9 CLI tools or any other recent Swift version.

PhilipDeegan commented 5 years ago

seconded

Darling [/Volumes/SystemRoot/home/philix/tmp/darling/autoconf-2.69]$ make
dyld: Symbol not found: _NSAffectedObjectsErrorKey
  Referenced from: /Volumes/SystemRoot/opt/chain/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/../../../../Frameworks/libswiftCoreData.dylib (which was built for Mac OS X 10.9)
  Expected in: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
 in /Volumes/SystemRoot/opt/chain/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/../../../../Frameworks/libswiftCoreData.dylib
Abort trap: 6
PhilipDeegan commented 5 years ago

XCode comes with a version of make, so I just replaced the "system" one with that.

PhilipDeegan commented 5 years ago

There's more

NSAffectedObjectsErrorKey
NSPersistentStoreSaveConflictsErrorKey
NSValidationKeyErrorKey
NSValidationObjectErrorKey
NSValidationPredicateErrorKey
NSValidationValueErrorKey

and now also


dyld: Symbol not found: _OBJC_CLASS_$_NSMergeConflict```
ahyattdev commented 5 years ago

Next ones needed:

dyld: Symbol not found: __xpc_event_key_name
  Referenced from: /Volumes/SystemRoot/media/sf_Applications/Xcode.app/Contents/MacOS/../Frameworks/libswiftXPC.dylib (which was built for Mac OS X 10.9)
  Expected in: /usr/lib/libSystem.B.dylib
 in /Volumes/SystemRoot/media/sf_Applications/Xcode.app/Contents/MacOS/../Frameworks/libswiftXPC.dylib
PhilipDeegan commented 5 years ago

I'm quite ignorant to the internals of all this, but I recall using the same version of XCode previously and not having such problems - maybe I'm mistaken/confused

thanks for your time @ahyattdev

ahyattdev commented 5 years ago

Hi Dekken,

I am going off of all the symbols that the main 'Xcode' application executable relies on here. I'm not sure exactly which program is being run that creates this issue but hopefully this also fixes that.

ahyattdev commented 5 years ago

Next is _kSecAttrAccess.

ahyattdev commented 5 years ago

Next is _NSAccessibilityActivationPointAttribute, in AppKit.

ahyattdev commented 5 years ago

Next is _NSAccessibilitySupportsMainThreadIdleNotificationAttribute, in AppKit

ahyattdev commented 5 years ago

Next is _kCGWindowAlpha, in CoreGraphics. I will be away for a few days, will pick up later.

ahyattdev commented 5 years ago

Next is _OBJC_CLASS_$_NSScriptCommand in Foundation.

ahyattdev commented 5 years ago

Next is _OBJC_CLASS_$_CAReplicatorLayer in QuartzCore.

ahyattdev commented 5 years ago

Next is _NSAnimateBinding in AppKit.

ahyattdev commented 5 years ago

Xcode 10 finally has all the symbols it wants before it starts executing any code. It of course does not work yet, but that is outside of the scope of this issue.

For those who are curious, this is what happens when it is run:

objc[23]: Class CIAffineTransform is implemented in both /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage (0x7ffff01a3b20) and /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (0x7ffff36e4860). One of the two will be used. Which one is undefined.
Assertion failed: (isRealized()), function isMetaClass, file /home/andrewhyatt/darling/src/external/objc4/runtime/objc-runtime-new.h, line 1221.
Abort trap: 6 (core dumped)
ahyattdev commented 5 years ago

Related is #488.