Bug 200937 - Remove support for watchOS < 6.0
Summary: Remove support for watchOS < 6.0
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Rollin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-08-20 12:44 PDT by Keith Rollin
Modified: 2019-08-27 10:29 PDT (History)
18 users (show)

See Also:


Attachments
Patch (8.19 KB, patch)
2019-08-20 12:50 PDT, Keith Rollin
no flags Details | Formatted Diff | Diff
Patch (17.22 KB, patch)
2019-08-20 15:10 PDT, Keith Rollin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Rollin 2019-08-20 12:44:11 PDT
Update conditionals that reference __WATCH_OS_X_VERSION_MIN_REQUIRED and __WATCH_OS_X_VERSION_MAX_ALLOWED, assuming that they both have values >= 50000. This means that expressions like "__WATCH_OS_X_VERSION_MIN_REQUIRED < 50000" are always False and "__WATCH_OS_X_VERSION_MIN_REQUIRED >= 50000" are always True.
Comment 1 Radar WebKit Bug Importer 2019-08-20 12:44:26 PDT
<rdar://problem/54524009>
Comment 2 Keith Rollin 2019-08-20 12:46:58 PDT
s/OS_X/OS/g
Comment 3 Keith Rollin 2019-08-20 12:50:15 PDT
Created attachment 376793 [details]
Patch
Comment 4 EWS Watchlist 2019-08-20 12:53:03 PDT
Attachment 376793 [details] did not pass style-queue:


ERROR: Tools/TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm:141:  Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file.  [build/version_check] [5]
ERROR: Tools/TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm:146:  Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file.  [build/version_check] [5]
ERROR: Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:32:  Incorrect OS version check. VERSION_MIN_REQUIRED values never include a minor version. You may be looking for a combination of VERSION_MIN_REQUIRED for target OS version check and VERSION_MAX_ALLOWED for SDK check.  [build/version_check] [5]
ERROR: Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:32:  Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file.  [build/version_check] [5]
Total errors found: 4 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Keith Rollin 2019-08-20 12:56:40 PDT
All of those style errors are pre-existing. Some will be cleaned up in subsequent patches that remove support for older OSes on other platforms.
Comment 6 Keith Rollin 2019-08-20 13:47:35 PDT
Comment on attachment 376793 [details]
Patch

I need to check for 6.0, not 5.0.
Comment 7 Keith Rollin 2019-08-20 15:10:51 PDT
Created attachment 376816 [details]
Patch
Comment 8 EWS Watchlist 2019-08-20 15:13:40 PDT
Attachment 376816 [details] did not pass style-queue:


ERROR: Tools/TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm:141:  Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file.  [build/version_check] [5]
ERROR: Tools/TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm:146:  Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file.  [build/version_check] [5]
ERROR: Tools/TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm:161:  Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file.  [build/version_check] [5]
ERROR: Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:32:  Incorrect OS version check. VERSION_MIN_REQUIRED values never include a minor version. You may be looking for a combination of VERSION_MIN_REQUIRED for target OS version check and VERSION_MAX_ALLOWED for SDK check.  [build/version_check] [5]
ERROR: Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:32:  Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file.  [build/version_check] [5]
ERROR: Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:34:  Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file.  [build/version_check] [5]
ERROR: Source/WebCore/PAL/pal/spi/cocoa/NSProgressSPI.h:30:  Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file.  [build/version_check] [5]
Total errors found: 7 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Keith Rollin 2019-08-20 20:41:06 PDT
All of those style errors are pre-existing. Some will be cleaned up in subsequent patches that remove support for older OSes on other platforms.
Comment 10 Darin Adler 2019-08-21 09:49:18 PDT
Comment on attachment 376816 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=376816&action=review

> Source/WTF/wtf/FeatureDefines.h:195
> +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(WATCHOS)

Should check what __IPHONE_OS_VERSION_MIN_REQUIRED is set to on watchOS 6.0. If it's >= 130000, the PLATFORM(WATCHOS) clause is not needed.

> Source/WTF/wtf/Platform.h:1620
> +#if PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || PLATFORM(WATCHOS) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 110000)

If IOS_FAMILY includes watchOS, should check what __IPHONE_OS_VERSION_MIN_REQUIRED is set to on watchOS 6.0. If it's >= 110000, the PLATFORM(WATCHOS) clause is not needed.

> Source/WTF/wtf/Platform.h:1628
> +#if (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(WATCHOS) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000)

If IOS_FAMILY includes watchOS, should check what __IPHONE_OS_VERSION_MIN_REQUIRED is set to on watchOS 6.0. If it's >= 130000, the PLATFORM(WATCHOS) clause is not needed.

> Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:32
> +#define USE_SECURE_ARCHIVER_API (PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110200) || PLATFORM(WATCHOS) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 110200))

If IOS_FAMILY includes watchOS, should check what __IPHONE_OS_VERSION_MIN_REQUIRED is set to on watchOS 6.0. If it's >= 110200, the PLATFORM(WATCHOS) clause is not needed.

> Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:34
> +#define USE_SECURE_ARCHIVER_FOR_ATTRIBUTED_STRING (PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(WATCHOS) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000))

If IOS_FAMILY includes watchOS, should check what __IPHONE_OS_VERSION_MIN_REQUIRED is set to on watchOS 6.0. If it's >= 130000, the PLATFORM(WATCHOS) clause is not needed.
Comment 11 Tim Horton 2019-08-21 10:01:36 PDT
(In reply to Darin Adler from comment #10)
> Comment on attachment 376816 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=376816&action=review
> 
> > Source/WTF/wtf/FeatureDefines.h:195
> > +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(WATCHOS)
> 
> Should check what __IPHONE_OS_VERSION_MIN_REQUIRED is set to on watchOS 6.0.
> If it's >= 130000, the PLATFORM(WATCHOS) clause is not needed.

My understanding is that the iPhone version is stuck where it branched off (9?) forever.
Comment 12 Keith Rollin 2019-08-21 10:23:47 PDT
(In reply to Tim Horton from comment #11)
> My understanding is that the iPhone version is stuck where it branched off
> (9?) forever.

My understanding matches Tim's. I went through and printed out all the values of the various TARGET_, WTF_OS_, WTF_PLATFORM_, etc. variables, and noticed that the IOS versions are defined to 90000 for watch and tv.
Comment 13 WebKit Commit Bot 2019-08-21 11:02:10 PDT
Comment on attachment 376816 [details]
Patch

Clearing flags on attachment: 376816

Committed r248950: <https://trac.webkit.org/changeset/248950>
Comment 14 WebKit Commit Bot 2019-08-21 11:02:12 PDT
All reviewed patches have been landed.  Closing bug.
Comment 15 Darin Adler 2019-08-21 17:51:04 PDT
(In reply to Keith Rollin from comment #12)
> (In reply to Tim Horton from comment #11)
> > My understanding is that the iPhone version is stuck where it branched off
> > (9?) forever.
> 
> My understanding matches Tim's. I went through and printed out all the
> values of the various TARGET_, WTF_OS_, WTF_PLATFORM_, etc. variables, and
> noticed that the IOS versions are defined to 90000 for watch and tv.

OK, got it.

Given that, it seems we should almost never check PLATFORM(IOS_FAMILY) and then __IPHONE_OS_VERSION_MIN_REQUIRED. Seems like most of those are mistakes; if there are version checks then they ought to instead be only PLATFORM(IOS).
Comment 16 Alexey Proskuryakov 2019-08-21 18:15:19 PDT
Correct, these are mistakes made when PLATFORM(IOS) was true for all iOS family targets. A renaming that was performed last fall made these more obvious. 

Most of the time we check with >=, so the mistakes are benign, and the behavior is validated by QA and user experience anyway, but I expect that we probably still have some interesting edge cases.
Comment 17 Keith Rollin 2019-08-22 01:03:11 PDT
(In reply to Darin Adler from comment #15)
> (In reply to Keith Rollin from comment #12)
> > (In reply to Tim Horton from comment #11)
> > > My understanding is that the iPhone version is stuck where it branched off
> > > (9?) forever.
> > 
> > My understanding matches Tim's. I went through and printed out all the
> > values of the various TARGET_, WTF_OS_, WTF_PLATFORM_, etc. variables, and
> > noticed that the IOS versions are defined to 90000 for watch and tv.
> 
> OK, got it.
> 
> Given that, it seems we should almost never check PLATFORM(IOS_FAMILY) and
> then __IPHONE_OS_VERSION_MIN_REQUIRED. Seems like most of those are
> mistakes; if there are version checks then they ought to instead be only
> PLATFORM(IOS).

Agreed. That's my intent when I get to cleaning up the iOS bits. I've been saving it for the end after I've addressed the other platforms in order to simplify things first. Then I'll need to address cases where we check for iOS and version, iOS family and version where we really mean just iOS, where we check for iOS family and version where we really do mean iOS family, and places where we check just the version without checking the platform. This part of the project will really need to look into the intent of what we want, and can't just be a mechanical process of removing checks as was the case with the other platforms.