robbiehanson / CocoaAsyncSocket

Asynchronous socket networking library for Mac and iOS
Other
12.45k stars 3k forks source link

Bump up MACOSX_DEPLOYMENT_TARGET to 10.13 #830

Closed xr1337 closed 1 year ago

xr1337 commented 1 year ago

When building macos framework, XCode 14.3 throws the following error :

ld: file not found: /Applications/Xcode-14.3.1-Release.Candidate.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)

XCode 14 seems to have dropped support for older OS version and removed libarclite. Resource: https://developer.apple.com/forums//thread/728021

Note: This error only affects building with carthage and cocoapods since they rely on the xcodeproj file. Swift Package Manager does not seem to be impacted.

Edit:

This PR shouldn't be merged due to the following:

  1. CocoaAsyncSocket is great for legacy macOS development where Xcode 14.3 is not available. Thus bumping up the version would impact older Xcode versions.
  2. Alternatively, if you can use modern OS and tools - consider Network.framework.
  3. The origin of the fix comes from a dependency tool (carthage) which an unnatural reason to bump up deployment versions (Aside from no deprecated API has been cleaned up ).

Thats said, to unblock your build issues. You have the following options:

  1. Use SPM, Cocoapods or manually link CocoaAsyncSocket to your project.
  2. Pass in deployment versions via xcodebuild
  3. Copy over missing libarclite files over to you Xcode according to here (Not recommended since it doesn't solve the underlying problem, just fixes the error )
github-actions[bot] commented 1 year ago

This pull request has been marked as stale, it will be closed automatically if there is no further activity.

eliaSchenker commented 7 months ago

Having similar issues with Xcode 15, this should definitely be merged as this low a deployment target is simply no longer supported on newer systems (basically eliminates building the app if the deployment target is not manually changed (which is impossible in package managers like Carthage))

seanm commented 7 months ago

Personally, I'm against increasing the minimum requirement. If you can use modern macOS, why do you even need CocoaAsyncSocket? Just use Network.framework. CocoaAsyncSocket is great for older macOS, where we didn't have Network.framework.

eliaSchenker commented 7 months ago

@seanm I see your point about legacy system support. However I've run into this problem because this repo is a dependency of the official objective-c/swift rabbitmq library (https://github.com/rabbitmq/rabbitmq-objc-client) which is definitely intended for use on modern systems.

Maybe a separate release tag could be created for legacy system support (e.g. 7.6.6-legacy with older deployment target and 7.6.6 with the one recommended by Apple)? I don't think that the use of this library on modern systems should be completely ignored, even if it is intended for older systems.

seanm commented 7 months ago

@seanm I see your point about legacy system support. However I've run into this problem because this repo is a dependency of the official objective-c/swift rabbitmq library (https://github.com/rabbitmq/rabbitmq-objc-client) which is definitely intended for use on modern systems.

It says on that page "This library currently targets iOS 12+ and macOS 10.12+." so seems 10.13 deployment would be too new anyway.

This PR is silly anyway, it increases the deployment target from 10.10 to 10.13 but it doesn't actually change any code, it doesn't start using new API and it doesn't stop using old API. i.e. it doesn't actually make any change that removes compatibility with 10.10 through 10.12.

If other projects like rabbitmq want a higher deployment, they can just pass a higher deployment to their invocation of xcodebuild or similar tweak to however they build CocoaAsyncSocket, can they not?

xr1337 commented 7 months ago

Thanks for the insights @seanm. Agreed with all discussion points above and will update the top comment