syncthing / syncthing/syncthing-macos

Deprecation warnings when compiling

Open
#256 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C
Stars
3.9k
Forks
203
Avg merge
3d 14h
Merged PRs (30d)
2

Description

With the syncthing 2.0.0 release here at last, I wanted to mention a few compiler warnings that are appearing when building the macOS wrapper. These are produced on a macOS 15.6 system with Xcode 16.4.16F6.

These are very old deprecations (from macOS 10.11 circa 2015!)

No idea if or when they will stop working (macOS 26?) but they should be fixed at some point.

13 warnings in STLoginItem.m
STLoginItem.m:19:35: warning: 'LSSharedFileListCreate' is deprecated: first deprecated in macOS 10.11 - No longer supported
      [-Wdeprecated-declarations]
   19 |         LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL);
      |                                          ^
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:368:1: note:
      'LSSharedFileListCreate' has been explicitly marked deprecated here
  368 | LSSharedFileListCreate(
      | ^

STLoginItem.m:19:64: warning: 'kLSSharedFileListSessionLoginItems' is deprecated: first deprecated in macOS 10.11
      [-Wdeprecated-declarations]
   19 |         LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL);
      |                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                       Use a LaunchAgent, XPCService or the ServiceManagement APIs instead.
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:129:20: note:
      'kLSSharedFileListSessionLoginItems' has been explicitly marked deprecated here
  129 | extern CFStringRef kLSSharedFileListSessionLoginItems                API_DEPRECATED_WITH_REPLACEMENT("Use a LaunchAgent, XPCService or the ServiceManagement APIs instead.", macos(10.5, 10.11)) API...
      |                    ^

STLoginItem.m:22:34: warning: 'LSSharedFileListInsertItemURL' is deprecated: first deprecated in macOS 10.11 - No longer supported
      [-Wdeprecated-declarations]
   22 |                 LSSharedFileListItemRef item = LSSharedFileListInsertItemURL(loginItems,
      |                                                ^
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:683:1: note:
      'LSSharedFileListInsertItemURL' has been explicitly marked deprecated here
  683 | LSSharedFileListInsertItemURL(
      | ^

STLoginItem.m:23:70: warning: 'kLSSharedFileListItemLast' is deprecated: first deprecated in macOS 10.11 - No longer supported
      [-Wdeprecated-declarations]
   23 |                                                                      kLSSharedFileListItemLast, NULL, NULL,
      |                                                                      ^
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:237:32: note:
      'kLSSharedFileListItemLast' has been explicitly marked deprecated here
  237 | extern LSSharedFileListItemRef kLSSharedFileListItemLast             API_DEPRECATED("No longer supported", macos(10.5, 10.11)) API_UNAVAILABLE(ios, tvos, watchos);
      |                                ^

STLoginItem.m:36:35: warning: 'LSSharedFileListCreate' is deprecated: first deprecated in macOS 10.11 - No longer supported
      [-Wdeprecated-declarations]
   36 |         LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL);
      |                                          ^
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:368:1: note:
      'LSSharedFileListCreate' has been explicitly marked deprecated here
  368 | LSSharedFileListCreate(
      | ^

STLoginItem.m:36:64: warning: 'kLSSharedFileListSessionLoginItems' is deprecated: first deprecated in macOS 10.11
      [-Wdeprecated-declarations]
   36 |         LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL);
      |                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                       Use a LaunchAgent, XPCService or the ServiceManagement APIs instead.
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:129:20: note:
      'kLSSharedFileListSessionLoginItems' has been explicitly marked deprecated here
  129 | extern CFStringRef kLSSharedFileListSessionLoginItems                API_DEPRECATED_WITH_REPLACEMENT("Use a LaunchAgent, XPCService or the ServiceManagement APIs instead.", macos(10.5, 10.11)) API...
      |                    ^

STLoginItem.m:45:38: warning: 'LSSharedFileListCopySnapshot' is deprecated: first deprecated in macOS 10.11 - No longer supported
      [-Wdeprecated-declarations]
   45 |         CFArrayRef loginItemsArray = LSSharedFileListCopySnapshot(loginItems, &seedValue);
      |                                      ^
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:626:1: note:
      'LSSharedFileListCopySnapshot' has been explicitly marked deprecated here
  626 | LSSharedFileListCopySnapshot(
      | ^

STLoginItem.m:50:19: warning: 'LSSharedFileListItemCopyResolvedURL' is deprecated: first deprecated in macOS 10.11 - No longer
      supported [-Wdeprecated-declarations]
   50 |             url = LSSharedFileListItemCopyResolvedURL(itemRef, 0, &err);
      |                   ^
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:993:1: note:
      'LSSharedFileListItemCopyResolvedURL' has been explicitly marked deprecated here
  993 | LSSharedFileListItemCopyResolvedURL(
      | ^

STLoginItem.m:69:35: warning: 'LSSharedFileListCreate' is deprecated: first deprecated in macOS 10.11 - No longer supported
      [-Wdeprecated-declarations]
   69 |         LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL);
      |                                          ^
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:368:1: note:
      'LSSharedFileListCreate' has been explicitly marked deprecated here
  368 | LSSharedFileListCreate(
      | ^

STLoginItem.m:69:64: warning: 'kLSSharedFileListSessionLoginItems' is deprecated: first deprecated in macOS 10.11
      [-Wdeprecated-declarations]
   69 |         LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL);
      |                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                       Use a LaunchAgent, XPCService or the ServiceManagement APIs instead.
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:129:20: note:
      'kLSSharedFileListSessionLoginItems' has been explicitly marked deprecated here
  129 | extern CFStringRef kLSSharedFileListSessionLoginItems                API_DEPRECATED_WITH_REPLACEMENT("Use a LaunchAgent, XPCService or the ServiceManagement APIs instead.", macos(10.5, 10.11)) API...
      |                    ^

STLoginItem.m:73:32: warning: 'LSSharedFileListCopySnapshot' is deprecated: first deprecated in macOS 10.11 - No longer supported
      [-Wdeprecated-declarations]
   73 |                 CFArrayRef loginItemsArray = LSSharedFileListCopySnapshot(loginItems, &seedValue);
      |                                              ^
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:626:1: note:
      'LSSharedFileListCopySnapshot' has been explicitly marked deprecated here
  626 | LSSharedFileListCopySnapshot(
      | ^

STLoginItem.m:77:19: warning: 'LSSharedFileListItemCopyResolvedURL' is deprecated: first deprecated in macOS 10.11 - No longer
      supported [-Wdeprecated-declarations]
   77 |             url = LSSharedFileListItemCopyResolvedURL(itemRef, 0, &err);
      |                   ^
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:993:1: note:
      'LSSharedFileListItemCopyResolvedURL' has been explicitly marked deprecated here
  993 | LSSharedFileListItemCopyResolvedURL(
      | ^

STLoginItem.m:81:6: warning: 'LSSharedFileListItemRemove' is deprecated: first deprecated in macOS 10.11 - No longer supported
      [-Wdeprecated-declarations]
   81 |                                         LSSharedFileListItemRemove(loginItems, itemRef);
      |                                         ^
In module 'Foundation' imported from STLoginItem.h:12:
In module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h:821:1: note:
      'LSSharedFileListItemRemove' has been explicitly marked deprecated here
  821 | LSSharedFileListItemRemove(
      | ^

1 warning in STApplication.m
STApplication.m:262:18: warning: 'setToolTip:' is deprecated: first deprecated in macOS 10.14 - Use the receiver's button.toolTip
      instead [-Wdeprecated-declarations]
  262 |     [_statusItem setToolTip:@""];
      |                  ^
In module 'Cocoa' imported from STApplication.h:9:
In module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSStatusItem.h:79:38: note:
      property 'toolTip' is declared deprecated here
   79 | @property (nullable, copy) NSString *toolTip API_DEPRECATED("Use the receiver's button.toolTip instead", macos(10.0,10.14));
      |                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSStatusItem.h:79:38: note:
      'setToolTip:' has been explicitly marked deprecated here

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with STLoginItem.m and reproduce the macOS wrapper build using Xcode 16.4. Review each deprecated SharedFileList call and the replacement guidance shown in the compiler warnings. Done means the wrapper builds without these deprecation warnings while retaining its login-item behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, objective-c
Domain
desktop, operating-systems
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.