weixin_39936086
weixin_39936086
2020-12-28 05:58

Symbol not found: _dispatch_assert_queue$V2

Mac OS X 10.11.6 Xcode 8.2.1 Build version 8C1002

Following the build instructions leads to a build failure at Scripts/build.py build release


** BUILD FAILED **


The following build commands failed:
    CompileC /Users/___/Library/Developer/Xcode/DerivedData/GitX-gqxvxkcsmkjciifypfrjnswantwf/Build/Intermediates/GitX.build/Release/GitX.build/Objects-normal/x86_64/NSAppearance+PBDarkMode.o Classes/NSAppearance+PBDarkMode.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
error: Command '['xcrun', 'xcodebuild', '-workspace', 'GitX.xcworkspace', '-scheme', 'GitX', '-configuration', 'Release', 'build', 'BUILD_DIR=/Users/___/code/gitx/build']' returned non-zero exit status 65.

Running that xcrun command gave more details:


/Users/___/code/gitx/Classes/NSAppearance+PBDarkMode.m:14:6: error: unexpected '@' in program
        if ((macOS 10.14, *)) {
            ^
/Users/___/code/gitx/Classes/NSAppearance+PBDarkMode.m:15:13: error: no visible  for 'NSAppearance'
      declares the selector 'bestMatchFromAppearancesWithNames:'
                if ([self bestMatchFromAppearancesWithNames:@[NSAppearanceNameDarkAqua, NSAppearanceName...
                     ~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/___/code/gitx/Classes/NSAppearance+PBDarkMode.m:15:101: error: use of undeclared identifier
      'NSAppearanceNameDarkAqua'; did you mean 'NSAppearanceNameAqua'?
  ...NSAppearanceNameAqua]] == NSAppearanceNameDarkAqua)
                               ^~~~~~~~~~~~~~~~~~~~~~~~
                               NSAppearanceNameAqua
In file included from /Users/___/code/gitx/Classes/NSAppearance+PBDarkMode.m:1:
In file included from /Users/___/code/gitx/Resources/GitX_Prefix.pch:4:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:15:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSActionCell.h:8:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCell.h:11:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSText.h:8:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSView.h:19:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAppearance.h:59:32: note:
      'NSAppearanceNameAqua' declared here
APPKIT_EXTERN NSString * const NSAppearanceNameAqua NS_AVAILABLE_MAC(10_9);
                               ^
/Users/___/code/gitx/Classes/NSAppearance+PBDarkMode.m:29:14: error: property 'effectiveAppearance' not found
      on object of type 'NSApplication *'
        return self.effectiveAppearance.isDarkMode;
                    ^
4 errors generated.

So I commented out a few things...

diff
diff --git a/Classes/NSAppearance+PBDarkMode.m b/Classes/NSAppearance+PBDarkMode.m
index bd93c39d..13390726 100644
--- a/Classes/NSAppearance+PBDarkMode.m
+++ b/Classes/NSAppearance+PBDarkMode.m
@@ -11,13 +11,13 @@  NSAppearance (PBDarkMode)

 - (BOOL)isDarkMode
 {
-       if ((macOS 10.14, *)) {
+/*     if ((macOS 10.14, *)) {
                if ([self bestMatchFromAppearancesWithNames:@[NSAppearanceNameDarkAqua, NSAppearanceNameAqua]] >
                        return YES;
                return NO;
-       } else {
+       } else { */
                return NO;
-       }
+/*     }*/
 }


@@ -26,7 +26,7 @@  NSApplication (PBDarkMode)

 - (BOOL)isDarkMode
 {
-       return self.effectiveAppearance.isDarkMode;
+       return NO; //return self.effectiveAppearance.isDarkMode;
 }


which allowed the build to succeed, although GitX crashes immediately on launch with


Dyld Error Message:
  Symbol not found: _dispatch_assert_queue$V2
  Referenced from: /Users/*/GitX.app/Contents/MacOS/GitX
  Expected in: /usr/lib/libSystem.B.dylib

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   dyld                            0x00007fff6ec31075 dyld_fatal_error + 1
1   dyld                            0x00007fff6ec34094 dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 139
2   libdyld.dylib                   0x00007fff9eb48262 dyld_stub_binder + 282
3   ???                             0x0000000103982008 0 + 4355268616
4   net.phere.GitX                  0x000000010391ecf4 __38-[PBGitSidebarController awakeFromNib]_block_invoke + 239 (PBGitSidebarController.m:77)
5   net.phere.GitX                  0x0000000103910934 -[_MAKVONotificationHelper observeValueForKeyPath:ofObject:change:context:] + 277 (MAKVONotificationCenter.m:147)
6   com.apple.Foundation            0x00007fff9c445a8b NSKeyValueNotifyObserver + 379
7   com.apple.Foundation            0x00007fff9c4452fb NSKeyValueDidChange + 457
8   com.apple.Foundation            0x00007fff9c4066f8 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 1148
9   com.apple.Foundation            0x00007fff9c473849 _NSSetObjectValueAndNotify + 274
10  net.phere.GitX                  0x0000000103944558 -[PBGitRepository readCurrentBranch] + 85 (PBGitRepository.m:498)
11  net.phere.GitX                  0x000000010391f7e0 -[PBGitSidebarController selectCurrentBranch] + 389 (PBGitSidebarController.m:161)
12  net.phere.GitX                  0x000000010391eb2d -[PBGitSidebarController awakeFromNib] + 483 (PBGitSidebarController.m:117)
13  com.apple.AppKit                0x00007fff95091e67 -[NSIBObjectData nibInstantiateWithOwner:options:topLevelObjects:] + 1252
14  com.apple.AppKit                0x00007fff951a25a7 -[NSNib _instantiateNibWithExternalNameTable:options:] + 677
15  com.apple.AppKit                0x00007fff951a21f7 -[NSNib _instantiateWithOwner:options:topLevelObjects:] + 143
16  com.apple.AppKit                0x00007fff951a148c -[NSViewController loadView] + 270
17  com.apple.AppKit                0x00007fff9510e9a6 -[NSViewController _loadViewIfRequired] + 75
18  com.apple.AppKit                0x00007fff9510e911 -[NSViewController view] + 30
19  net.phere.GitX                  0x0000000103922a86 -[PBGitWindowController windowDidLoad] + 528 (PBGitWindowController.m:137)
20  com.apple.AppKit                0x00007fff95139927 -[NSWindowController _windowDidLoad] + 592
21  com.apple.AppKit                0x00007fff950d643e -[NSWindowController window] + 110
22  com.apple.AppKit                0x00007fff959defe7 -[NSDocument(NSPersistentUISupport) restoreDocumentWindowWithIdentifier:state:completionHandler:] + 162
23  com.apple.AppKit                0x00007fff95618724 -[NSDocumentControllerPersistentRestoration loadedDocument:forAutoID:] + 165
24  com.apple.AppKit                0x00007fff9561d566 __89-[NSDocumentController reopenDocumentForURL:withContentsOfURL:display:completionHandler:]_block_invoke_2 + 203
25  com.apple.CoreFoundation        0x00007fff8bee640c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
26  com.apple.CoreFoundation        0x00007fff8bec5c55 __CFRunLoopDoBlocks + 341
27  com.apple.CoreFoundation        0x00007fff8bec5444 __CFRunLoopRun + 948
28  com.apple.CoreFoundation        0x00007fff8bec4e28 CFRunLoopRunSpecific + 296
29  com.apple.HIToolbox             0x00007fff96001935 RunCurrentEventLoopInMode + 235
30  com.apple.HIToolbox             0x00007fff96001677 ReceiveNextEventCommon + 184
31  com.apple.HIToolbox             0x00007fff960015af _BlockUntilNextEventMatchingListInModeWithFilter + 71
32  com.apple.AppKit                0x00007fff950c5df6 _DPSNextEvent + 1067
33  com.apple.AppKit                0x00007fff950c5226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
34  com.apple.AppKit                0x00007fff950b9d80 -[NSApplication run] + 682
35  com.apple.AppKit                0x00007fff95083368 NSApplicationMain + 1176
36  net.phere.GitX                  0x0000000103952734 main + 33 (main.m:15)
37  libdyld.dylib                   0x00007fff9eb4a5ad start + 1

该提问来源于开源项目:gitx/gitx

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

8条回答

  • weixin_39936086 weixin_39936086 4月前

    That one works.

    Unrelated to the original issue, but spacing in the tree is wacky

    image

    after clicking a different branch in the sidebar it got even worse

    image

    点赞 评论 复制链接分享
  • weixin_39852647 weixin_39852647 4月前

    I'm glad it still runs on 10.11, so I'm going to close this, but many thanks for the help ! If you're willing to take a look at the layout issue (I suspect it's around PBGitRevisionCell) and do a PR, that would be much appreciated as well. AFAICT, you'd just have to comment out the `` code blocks and it should build.

    点赞 评论 复制链接分享
  • weixin_39936086 weixin_39936086 4月前

    I was able to set that dependency to the correct path with a little install_name_tool hackery, and the app now launches successfully. However, when I load a repo the window is blank except for a thin gray line along the sidebar border:

    image

    点赞 评论 复制链接分享
  • weixin_39852647 weixin_39852647 4月前

    I wrote a dylib packager for Objective-Git, but forgot to update the link path between packaged dependencies, so as you found out, it needs a manual fixup.

    It looks like something should be logged to the Console when that happens. Can you check ?

    点赞 评论 复制链接分享
  • weixin_39936086 weixin_39936086 4月前
    
    11/20/18 10:40:21.988 AM GitX[7982]: -[NSApplication effectiveAppearance]: unrecognized selector sent to instance 0x7fa8c1c05d80
    11/20/18 10:40:21.991 AM GitX[7982]: -[NSApplication effectiveAppearance]: unrecognized selector sent to instance 0x7fa8c1c05d80
    11/20/18 10:40:21.997 AM GitX[7982]: (
        0   CoreFoundation                      0x00007fff8bf51452 __exceptionPreprocess + 178
        1   libobjc.A.dylib                     0x00007fff9056c73c objc_exception_throw + 48
        2   CoreFoundation                      0x00007fff8bfbb18d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
        3   CoreFoundation                      0x00007fff8bec14c1 ___forwarding___ + 1009
        4   CoreFoundation                      0x00007fff8bec1048 _CF_forwarding_prep_0 + 120
        5   GitX                                0x0000000102cb977a -[NSApplication(PBDarkMode) isDarkMode] + 24
        6   GitX                                0x0000000102cba0e7 -[PBGitGradientBarView drawRect:] + 39
        7   AppKit                              0x00007fff9522e7be -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:] + 1331
        8   AppKit                              0x00007fff9522e156 __46-[NSView(NSLayerKitGlue) drawLayer:inContext:]_block_invoke + 242
        9   AppKit                              0x00007fff9522dcaf -[NSView(NSLayerKitGlue) _drawViewBackingLayer:inContext:drawingHandler:] + 2403
        10  AppKit                              0x00007fff9522d341 -[NSView(NSLayerKitGlue) drawLayer:inContext:] + 108
        11  QuartzCore                          0x00007fff9d101b15 CABackingStoreUpdate_ + 3494
        12  QuartzCore                          0x00007fff9d100d69 ___ZN2CA5Layer8display_Ev_block_invoke + 59
        13  QuartzCore                          0x00007fff9d100755 _ZN2CA5Layer8display_Ev + 1565
        14  AppKit                              0x00007fff9522c318 _NSBackingLayerDisplay + 641
        15  AppKit                              0x00007fff9521e878 -[_NSViewBackingLayer display] + 818
        16  QuartzCore                          0x00007fff9d0f249d _ZN2CA5Layer17display_if_neededEPNS_11TransactionE + 603
        17  QuartzCore                          0x00007fff9d0f1fc5 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 35
        18  QuartzCore                          0x00007fff9d0f1499 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
        19  QuartzCore                          0x00007fff9d0f10e4 _ZN2CA11Transaction6commitEv + 508
        20  QuartzCore                          0x00007fff9d0fc973 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 71
        21  CoreFoundation                      0x00007fff8bee5fc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
        22  CoreFoundation                      0x00007fff8bee5f37 __CFRunLoopDoObservers + 391
        23  CoreFoundation                      0x00007fff8bec4e48 CFRunLoopRunSpecific + 328
        24  HIToolbox                           0x00007fff96001935 RunCurrentEventLoopInMode + 235
        25  HIToolbox                           0x00007fff96001677 ReceiveNextEventCommon + 184
        26  HIToolbox                           0x00007fff960015af _BlockUntilNextEventMatchingListInModeWithFilter + 71
        27  AppKit                              0x00007fff950c5df6 _DPSNextEvent + 1067
        28  AppKit                              0x00007fff950c5226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
        29  AppKit                              0x00007fff950b9d80 -[NSApplication run] + 682
        30  AppKit                              0x00007fff95083368 NSApplicationMain + 1176
        31  GitX                                0x0000000102cb02c4 main + 33
        32  libdyld.dylib                       0x00007fff9eb4a5ad start + 1
        33  ???                                 0x0000000000000001 0x0 + 1
    )
    11/20/18 10:40:29.639 AM GitX[7982]: Layout still needs update after calling -[PBGitRevisionCell layout].  PBGitRevisionCell or one of its superclasses may have overridden -layout without calling super. Or, something may have dirtied layout in the middle of updating it.  Both are programming errors in Cocoa Autolayout.  The former is pretty likely to arise if some pre-Cocoa Autolayout class had a method called layout, but it should be fixed.
    
    点赞 评论 复制链接分享
  • weixin_39852647 weixin_39852647 4月前

    2nd try. I've hacked the packager to fix the dyld issue, and wrapped the missing selector in an [at]available. This build runs here using its own packaged dylibs so 🤞.

    GitX.zip

    点赞 评论 复制链接分享
  • weixin_39852647 weixin_39852647 4月前

    It looks like I broke building with macOS < 10.12 (because of [at]available, and Dark Mode). Can you try running this ? It's straight from master, and I need a 10.11 guinea pig now 😉. I'll do a proper release if this works for you.

    GitX.zip

    点赞 评论 复制链接分享
  • weixin_39936086 weixin_39936086 4月前

    Different error, guessing because I don't have homebrew installed at the same place you do.

    
    Dyld Error Message:
      Library not loaded: /usr/local/Cellar/openssl/1.0.2p/lib/libcrypto.1.0.0.dylib
      Referenced from: /Users/*/GitX.app/Contents/Frameworks/ObjectiveGit.framework/Versions/A/Frameworks/libssl.1.0.0.dylib
      Reason: image not found
    
    点赞 评论 复制链接分享

相关推荐