qBittorrent icon indicating copy to clipboard operation
qBittorrent copied to clipboard

Deprecated warnings found in CI - macOS logs.

Open xavier2k6 opened this issue 4 years ago • 11 comments
trafficstars

qBittorrent & operating system versions

qBittorrent: master branch Operating system: macOS Qt: 5.15.2/6.2.0 libtorrent-rasterbar: 1.2.14/2.0.4

What is the problem?

While looking through the CI - macOS logs in master, I came across these "deprecated" warnings:

https://github.com/qbittorrent/qBittorrent/blob/559a979536713dbe3a5b474e2f62aaee58917c83/src/base/utils/fs.cpp#L350-L358

/src/base/utils/fs.cpp:352:9: warning: 'statfs64' is deprecated: first deprecated in macOS 10.6 [-Wdeprecated-declarations]
    if (statfs64(file.toLocal8Bit().constData(), &buf) != 0)

https://github.com/qbittorrent/qBittorrent/blob/559a979536713dbe3a5b474e2f62aaee58917c83/src/base/preferences.cpp#L1127

/src/base/preferences.cpp:1127:42: warning: 'LSCopyDefaultHandlerForURLScheme' is deprecated: first deprecated in macOS 10.15 - Use LSCopyDefaultApplicationURLForURL() instead. [-Wdeprecated-declarations]
    const CFStringRef defaultHandlerId = LSCopyDefaultHandlerForURLScheme(magnetUrlScheme);

(GUI=OFF)

https://github.com/qbittorrent/qBittorrent/blob/559a979536713dbe3a5b474e2f62aaee58917c83/src/app/main.cpp#L283

/src/app/main.cpp:283:17: warning: 'daemon' is deprecated: first deprecated in macOS 10.5 - Use posix_spawn APIs instead. [-Wdeprecated-declarations]
            if (daemon(1, 0) == 0)

Steps to reproduce

No response

Additional context

Take a look at the latest CI - macOS run/logs section of Build qBittorrent (Qt5) / Build qBittorrent (Qt6)

https://github.com/qbittorrent/qBittorrent/actions/runs/1378766147

Log(s) & preferences file(s)

No response

xavier2k6 avatar Oct 25 '21 22:10 xavier2k6

I ignored the other warnings as I know they're being deprecated, we're moving over to Qt6.

xavier2k6 avatar Oct 25 '21 22:10 xavier2k6

@Chocobo1 statfs64 deprecation was taken care of by PR https://github.com/qbittorrent/qBittorrent/pull/15661, Could you look into the LSCopyDefaultHandlerForURLScheme & daemon deprecation warnings too please.

xavier2k6 avatar Nov 04 '21 16:11 xavier2k6

Could you look into the LSCopyDefaultHandlerForURLScheme & daemon deprecation warnings too please.

Sorry, I don't have access to a mac and therefore can't test (nor code) this case.

Chocobo1 avatar Nov 05 '21 04:11 Chocobo1

@Kolcha Can you help with the LSCopyDefaultHandlerForURLScheme & daemon deprecation warnings?

xavier2k6 avatar Nov 09 '21 18:11 xavier2k6

sorry, I'm not macOS developer at all, and don't know how safely replace these deprecated stuff. I'll look into it this weekend, but can't promise anything

Kolcha avatar Nov 10 '21 17:11 Kolcha

@xavier2k6 , sorry, I can't fix remaining warnings, at least for now. maybe I'll return later. but again, I don't have Apple devices anymore, except MacBook Pro from office.

Kolcha avatar Nov 19 '21 21:11 Kolcha

@sledgehammer999 something to be looked at prior to 4.4.0 release.

xavier2k6 avatar Nov 22 '21 20:11 xavier2k6

There are now more deprecations that need to be handled.

xavier2k6 avatar Dec 11 '21 22:12 xavier2k6

@sledgehammer999 It's probably too late to address these now with v4.4 about to be GA, should I add it to 4.4.1 milestone?

xavier2k6 avatar Jan 03 '22 17:01 xavier2k6

@sledgehammer999 Going to add this to 4.4.2 milestone to keep track of/reminder.

xavier2k6 avatar Mar 17 '22 10:03 xavier2k6

Deprecations as of macos-12 (monterey)

https://github.com/xavier2k6/qBittorrent/actions/workflows/ci_macos.yaml?query=branch%3ACI_macOS-12_test

xavier2k6 avatar Apr 11 '22 11:04 xavier2k6

Our CI - macOS is now currently running under 12.6.3 - so deprecations etc. can be seen there now.

@sledgehammer999 @thalieht @glassez

The macOS version is not well supported, because we don't have active macOS developers/contributors. The project is in need of macOS developers. If you are a macOS developer willing to help, just go to our bug tracker for a list of macOS related issues. Or try to fix bugs that you yourself have discovered and annoy you.

This is what's currently displayed on the main website for macOS & I'd like to suggest two things for consideration.

  1. Add macOS Issues Tracker link
  2. Ping users who've previously contributed via PR's

xavier2k6 avatar Feb 08 '23 17:02 xavier2k6

I believe we should completely stop publishing macOS builds so as not to annoy users.

glassez avatar Feb 10 '23 18:02 glassez

I believe we should completely stop publishing macOS builds so as not to annoy users.

I agree

macOS 13 test/beta runner-image is available now for GHA CI so I will be creating a branch on my repo to test building/deprecations etc.

Edit: GHA CI: Test with macOS 13 Runner Image https://github.com/xavier2k6/qBittorrent/actions/runs/5137434599

Deprecations:

warning: 'kUTTagClassFilenameExtension' is deprecated: first deprecated in macOS 12.0 - Use UTTagClassFilenameExtension instead. [-Wdeprecated-declarations]
warning: 'UTTypeCreatePreferredIdentifierForTag' is deprecated: first deprecated in macOS 12.0 - Use the UTType class instead. [-Wdeprecated-declarations]
warning: 'LSCopyDefaultHandlerForURLScheme' is deprecated: first deprecated in macOS 10.15 - Use -[NSWorkspace URLForApplicationToOpenURL:] instead. [-Wdeprecated-declarations]
warning: 'iconForFileType:' is deprecated: first deprecated in macOS 12.0 - Use -[NSWorkspace iconForContentType:] instead. [-Wdeprecated-declarations]
warning: 'NSUserNotification' is deprecated: first deprecated in macOS 11.0 - All NSUserNotifications API should be replaced with UserNotifications.frameworks API [-Wdeprecated-declarations]
warning: 'NSUserNotificationDefaultSoundName' is deprecated: first deprecated in macOS 11.0 - All NSUserNotifications API should be replaced with UserNotifications.frameworks API [-Wdeprecated-declarations]
warning: 'NSUserNotificationCenter' is deprecated: first deprecated in macOS 11.0 - All NSUserNotifications API should be replaced with UserNotifications.frameworks API [-Wdeprecated-declarations]

xavier2k6 avatar Apr 28 '23 19:04 xavier2k6

@dmitry1100 @vit9696 @briankendall @MaddTheSane Ping! - In reference to https://github.com/qbittorrent/qBittorrent/issues/15630#issuecomment-1422957536

You've previously submitted PR's for macOS & would appreciate it if any of you could help providing PR's to handle below:

  1. Deprecations as outlined in https://github.com/qbittorrent/qBittorrent/issues/15630#issuecomment-1528003962
  2. "Open Issues" under the macOS Issues Tracker link

xavier2k6 avatar Jun 12 '23 11:06 xavier2k6

Why deprecations are a problem? Builds for macOS work more or less fine for me.

vit9696 avatar Jun 12 '23 12:06 vit9696

Why deprecations are a problem? Builds for macOS work more or less fine for me.

Because after a while it will stop working. Marking some features as deprecated is a way to give developers time to switch to using new features before old ones are completely deleted.

glassez avatar Jun 12 '23 14:06 glassez

Latest run with macOS 13 runner image: https://github.com/xavier2k6/qBittorrent/actions/runs/6289363171

@DouiKo Could you take a look through the logs & see if you can make any progress with the deprecations please.

xavier2k6 avatar Sep 24 '23 10:09 xavier2k6

@xavier2k6 I will do my best to do what I can. Should I replace these functions as prompted by the warning and then check for any issues?

DouiKo avatar Sep 25 '23 04:09 DouiKo

Should I replace these functions as prompted by the warning and then check for any issues?

Please, anything that you can do to help benefit our macOS userbase.

Only 1 team member has access/uses macOS & that's running Catalina (IIRC)....so we are barely able to support it as is.

With Qt 6.5+ now only supporting macOS 11+............etc.

I will have another issue for you to look into/see if you can implement it......at a later stage, will ping you when I create the associated ticket.....can't do it now....time.

xavier2k6 avatar Sep 25 '23 08:09 xavier2k6

@ackerthehacker2 Any help/fixes you could provide with regards to macOS deprecations/open issues would be much appreciated too.

xavier2k6 avatar Oct 14 '23 17:10 xavier2k6