cargo: NSInvalidArgumentException macOS 14.0

Problem

When preparing to build cargo-c under MacPorts I get the following error:

:debug:extract system -W /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_cargo-c/cargo-c/work/cargo-c-0.9.19: /opt/local/bin/cargo --offline update
:info:extract *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString stringByStandardizingPath]: unrecognized selector sent to instance 0x60000124c390'
:info:extract *** First throw call stack:
:info:extract (
:info:extract 	0   CoreFoundation                      0x000000018d5ac8c0 __exceptionPreprocess + 176
:info:extract 	1   libobjc.A.dylib                     0x000000018d0a5eb4 objc_exception_throw + 60
:info:extract 	2   CoreFoundation                      0x000000018d65e3dc -[NSObject(NSObject) __retain_OA] + 0
:info:extract 	3   CoreFoundation                      0x000000018d5169e4 ___forwarding___ + 1572
:info:extract 	4   CoreFoundation                      0x000000018d516300 _CF_forwarding_prep_0 + 96
:info:extract 	5   Foundation                          0x000000018e5eb4f0 -[NSProcessInfo arguments] + 188
:info:extract 	6   CoreFoundation                      0x000000018d627ff8 __getDefaultArguments_block_invoke + 96
:info:extract 	7   libdispatch.dylib                   0x000000018d2ad910 _dispatch_client_callout + 20
:info:extract 	8   libdispatch.dylib                   0x000000018d2af14c _dispatch_once_callout + 32
:info:extract 	9   CoreFoundation                      0x000000018d627994 _addBackstopValuesForIdentifierAndSource + 640
:info:extract 	10  CoreFoundation                      0x000000018d4e2254 __81-[_CFXPreferences(SourceAdditions) withNamedVolatileSourceForIdentifier:perform:]_block_invoke + 144
:info:extract 	11  CoreFoundation                      0x000000018d62763c -[_CFXPreferences withNamedVolatileSourceForIdentifier:perform:] + 272
:info:extract 	12  CoreFoundation                      0x000000018d4e85c4 -[CFPrefsSearchListSource addNamedVolatileSourceForIdentifier:] + 136
:info:extract 	13  CoreFoundation                      0x000000018d6668bc __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke.155 + 296
:info:extract 	14  CoreFoundation                      0x000000018d666564 -[_CFXPreferences withSearchLists:] + 84
:info:extract 	15  CoreFoundation                      0x000000018d4e3b18 __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 300
:info:extract 	16  CoreFoundation                      0x000000018d666710 -[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 384
:info:extract 	17  CoreFoundation                      0x000000018d4e3440 -[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:] + 156
:info:extract 	18  CoreFoundation                      0x000000018d4e3368 _CFPreferencesCopyAppValueWithContainerAndConfiguration + 112
:info:extract 	19  SystemConfiguration                 0x000000018e273478 SCDynamicStoreCopyProxiesWithOptions + 180
:info:extract 	20  libcurl.4.dylib                     0x0000000106045208 Curl_macos_init + 16
:info:extract 	21  libcurl.4.dylib                     0x000000010602c140 global_init + 172
:info:extract 	22  libcurl.4.dylib                     0x000000010602c084 curl_global_init + 68
:info:extract 	23  cargo                               0x0000000104eca8c8 _ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17h9969c74c6cd47fe4E + 36
:info:extract 	24  cargo                               0x0000000104fd828c _ZN3std10sys_common4once5queue4Once4call17hcf0ec3e1860a2be3E + 724
:info:extract 	25  cargo                               0x0000000104ecaaac _ZN4curl9INIT_CTOR9init_ctor17hcaba8dae76a2e3deE + 96
:info:extract 	26  dyld                                0x000000018d0fd5c8 ___ZZNK5dyld46Loader25findAndRunAllInitializersERNS_12RuntimeStateEENK3$_0clEv_block_invoke + 168
:info:extract 	27  dyld                                0x000000018d142920 ___ZNK5dyld313MachOAnalyzer18forEachInitializerER11DiagnosticsRKNS0_15VMAddrConverterEU13block_pointerFvjEPKv_block_invoke.209 + 340
:info:extract 	28  dyld                                0x000000018d135c60 ___ZNK5dyld39MachOFile14forEachSectionEU13block_pointerFvRKNS0_11SectionInfoEbRbE_block_invoke + 496
:info:extract 	29  dyld                                0x000000018d0dd2fc _ZNK5dyld39MachOFile18forEachLoadCommandER11DiagnosticsU13block_pointerFvPK12load_commandRbE + 300
:info:extract 	30  dyld                                0x000000018d134c98 _ZNK5dyld39MachOFile14forEachSectionEU13block_pointerFvRKNS0_11SectionInfoEbRbE + 192
:info:extract 	31  dyld                                0x000000018d142434 _ZNK5dyld313MachOAnalyzer18forEachInitializerER11DiagnosticsRKNS0_15VMAddrConverterEU13block_pointerFvjEPKv + 516
:info:extract 	32  dyld                                0x000000018d0f9798 _ZNK5dyld46Loader25findAndRunAllInitializersERNS_12RuntimeStateE + 448
:info:extract 	33  dyld                                0x000000018d0ffb14 _ZNK5dyld416JustInTimeLoader15runInitializersERNS_12RuntimeStateE + 36
:info:extract 	34  dyld                                0x000000018d0f9b4c _ZNK5dyld46Loader23runInitializersBottomUpERNS_12RuntimeStateERN5dyld35ArrayIPKS0_EE + 220
:info:extract 	35  dyld                                0x000000018d0fd654 _ZZNK5dyld46Loader38runInitializersBottomUpPlusUpwardLinksERNS_12RuntimeStateEENK3$_1clEv + 112
:info:extract 	36  dyld                                0x000000018d0f9ccc _ZNK5dyld46Loader38runInitializersBottomUpPlusUpwardLinksERNS_12RuntimeStateE + 304
:info:extract 	37  dyld                                0x000000018d11ead4 _ZN5dyld44APIs25runAllInitializersForMainEv + 464
:info:extract 	38  dyld                                0x000000018d0e1f34 _ZN5dyld4L7prepareERNS_4APIsEPKN5dyld313MachOAnalyzerE + 3192
:info:extract 	39  dyld                                0x000000018d0e0f44 start + 1948
:info:extract )
:info:extract libc++abi: terminating due to uncaught exception of type NSException
:info:extract Command failed: /opt/local/bin/cargo --offline update

Proposed Solution

Function correctly, as before.

Notes

I’m building against macOS 14.0 RC using Xcode 15.0 RC.

I had no problems with early code 15 betas, but later betas and the RC have caused this error.

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 16 (3 by maintainers)

Commits related to this issue

Most upvoted comments

update: this worked for me, for now (after upgrading to the latest curl from Homebrew

DYLD_INSERT_LIBRARIES=/opt/homebrew/opt/curl/lib/libcurl.dylib cargo install-update --all

Can anyone TL;DR what needs to be fixed so I can run cargo-install-update without a crash?

A: Set a dyld env variable like DYLD_INSERT_LIBRARIES=[libcurl.dylib path] ./cargo( or some executables) B: Compile executables with CoreServices C: Use patched curl

Choose an option in them.

My patch file is for curl. You need to build curl with CoreServices. It solves problems related to curl like this globally.

I can also reproduce 100% on macOS Sonoma by issuing cargo install-update -a

Building curl(or something crashing) with CoreServices is the best way to avoid crashes like this issue with macports in Sonoma. https://github.com/Ryu-ga/macports-ports/tree/main/net/curl