qBittorrent
qBittorrent copied to clipboard
Deprecated warnings found in CI - macOS logs.
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
I ignored the other warnings as I know they're being deprecated, we're moving over to Qt6.
@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.
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.
@Kolcha Can you help with the LSCopyDefaultHandlerForURLScheme & daemon deprecation warnings?
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
@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.
@sledgehammer999 something to be looked at prior to 4.4.0 release.
There are now more deprecations that need to be handled.
@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?
@sledgehammer999 Going to add this to 4.4.2 milestone to keep track of/reminder.
Deprecations as of macos-12 (monterey)
https://github.com/xavier2k6/qBittorrent/actions/workflows/ci_macos.yaml?query=branch%3ACI_macOS-12_test
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.
- Add macOS Issues Tracker link
- Ping users who've previously contributed via PR's
I believe we should completely stop publishing macOS builds so as not to annoy users.
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]
@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:
Deprecationsas outlined in https://github.com/qbittorrent/qBittorrent/issues/15630#issuecomment-1528003962- "Open Issues" under the macOS Issues Tracker link
Why deprecations are a problem? Builds for macOS work more or less fine for me.
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.
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 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?
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.
@ackerthehacker2 Any help/fixes you could provide with regards to macOS deprecations/open issues would be much appreciated too.