WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
239054
Adopt "version set"-based linked-on-or-after checks instead of platform-specific ones
https://bugs.webkit.org/show_bug.cgi?id=239054
Summary
Adopt "version set"-based linked-on-or-after checks instead of platform-speci...
Tim Horton
Reported
2022-04-10 14:50:50 PDT
Adopt "version set"-based linked-on-or-after checks instead of platform-specific ones
Attachments
Patch
(91.27 KB, patch)
2022-04-10 14:52 PDT
,
Tim Horton
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(96.46 KB, patch)
2022-04-10 18:42 PDT
,
Tim Horton
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(96.60 KB, patch)
2022-04-10 18:46 PDT
,
Tim Horton
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(96.60 KB, patch)
2022-04-10 19:03 PDT
,
Tim Horton
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(96.60 KB, patch)
2022-04-10 19:08 PDT
,
Tim Horton
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(96.60 KB, patch)
2022-04-10 19:14 PDT
,
Tim Horton
no flags
Details
Formatted Diff
Diff
Patch
(99.81 KB, patch)
2022-04-11 23:46 PDT
,
Tim Horton
no flags
Details
Formatted Diff
Diff
Patch
(100.73 KB, patch)
2022-04-11 23:48 PDT
,
Tim Horton
no flags
Details
Formatted Diff
Diff
Show Obsolete
(7)
View All
Add attachment
proposed patch, testcase, etc.
Tim Horton
Comment 1
2022-04-10 14:52:05 PDT
Created
attachment 457212
[details]
Patch
Tim Horton
Comment 2
2022-04-10 14:52:08 PDT
<
rdar://problem/83436715
>
Tim Horton
Comment 3
2022-04-10 14:54:02 PDT
Comment on
attachment 457212
[details]
Patch Oh dear, I forgot about the SPI headers.
Tim Horton
Comment 4
2022-04-10 15:01:25 PDT
Actually, not sure we can make SPI headers because of how dyld_build_version_t values are constructed. We might just have to always-be-linked-on-or-after-everything in the open source build? Though I can imagine folks objecting to that. Will ask around!
Tim Horton
Comment 5
2022-04-10 15:05:26 PDT
Or we could fall back to the old mechanism if the SDK we're building against doesn't have the requisite dyld_build_version_t defines... that would solve both the open source build and back-deployment problems. I will try to hack that up.
Tim Horton
Comment 6
2022-04-10 18:42:57 PDT
Created
attachment 457220
[details]
Patch
Tim Horton
Comment 7
2022-04-10 18:46:50 PDT
Created
attachment 457221
[details]
Patch
Tim Horton
Comment 8
2022-04-10 19:03:22 PDT
Created
attachment 457222
[details]
Patch
Tim Horton
Comment 9
2022-04-10 19:08:41 PDT
Created
attachment 457223
[details]
Patch
Tim Horton
Comment 10
2022-04-10 19:14:03 PDT
Created
attachment 457224
[details]
Patch
Simon Fraser (smfr)
Comment 11
2022-04-11 11:41:59 PDT
Comment on
attachment 457224
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=457224&action=review
> Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.cpp:75 > + if (linkedBefore(dyld_fall_2015_os_versions, DYLD_IOS_VERSION_9_0, DYLD_MACOSX_VERSION_10_11)) > + disableBehavior(SDKAlignedBehavior::PictureInPictureMediaPlayback); > + > + if (linkedBefore(dyld_fall_2016_os_versions, DYLD_IOS_VERSION_10_0, DYLD_MACOSX_VERSION_10_12)) {
This code could make use of the fact that if 'linkedBefore(dyld_fall_2015_os_versions ' is true, then 'linkedBefore(dyld_fall_2016_os_versions' must also be true.
Wenson Hsieh
Comment 12
2022-04-11 11:49:19 PDT
Comment on
attachment 457224
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=457224&action=review
> Source/WTF/wtf/Bitmap.h:249 > + memset(bits.data(), 0xFF, sizeof(bits));
We chatted about this on Slack — it seems this might not work well with the implementation of `Bitmap::count()`, since it would end up counting bits after the last (valid) bit in the map. (Though, that shouldn't trigger any bugs, since we only use `setAll()` for the linked-on behaviors map below)
Simon Fraser (smfr)
Comment 13
2022-04-11 11:53:51 PDT
Can this use a big OptionSet<> instead?
Tim Horton
Comment 14
2022-04-11 13:12:06 PDT
(In reply to Simon Fraser (smfr) from
comment #13
)
> Can this use a big OptionSet<> instead?
We're already at 60 bits, IDK if uint128_t is a thing I can use, and since we almost never remove things from this list and add them at a greater frequency now, I think using something flexible makes the most sense.
Tim Horton
Comment 15
2022-04-11 13:14:27 PDT
(In reply to Simon Fraser (smfr) from
comment #11
)
> Comment on
attachment 457224
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=457224&action=review
> > > Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.cpp:75 > > + if (linkedBefore(dyld_fall_2015_os_versions, DYLD_IOS_VERSION_9_0, DYLD_MACOSX_VERSION_10_11)) > > + disableBehavior(SDKAlignedBehavior::PictureInPictureMediaPlayback); > > + > > + if (linkedBefore(dyld_fall_2016_os_versions, DYLD_IOS_VERSION_10_0, DYLD_MACOSX_VERSION_10_12)) { > > This code could make use of the fact that if > 'linkedBefore(dyld_fall_2015_os_versions ' is true, then > 'linkedBefore(dyld_fall_2016_os_versions' must also be true.
It is true, though dyld_program_sdk_at_least is very cheap, and it's likely not worth the decreased ergonomics within this function that people have to frequently add to (and also might confuse the weird one-off one where the versions are different).
Tim Horton
Comment 16
2022-04-11 13:14:51 PDT
(In reply to Wenson Hsieh from
comment #12
)
> Comment on
attachment 457224
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=457224&action=review
> > > Source/WTF/wtf/Bitmap.h:249 > > + memset(bits.data(), 0xFF, sizeof(bits)); > > We chatted about this on Slack — it seems this might not work well with the > implementation of `Bitmap::count()`, since it would end up counting bits > after the last (valid) bit in the map. > > (Though, that shouldn't trigger any bugs, since we only use `setAll()` for > the linked-on behaviors map below)
I will fix this.
Tim Horton
Comment 17
2022-04-11 23:46:03 PDT
Created
attachment 457312
[details]
Patch
Tim Horton
Comment 18
2022-04-11 23:48:34 PDT
Created
attachment 457313
[details]
Patch
Myles C. Maxfield
Comment 19
2022-04-12 00:25:40 PDT
Holy moly we have a lot of linkedOnOrAfter checks!
Wenson Hsieh
Comment 20
2022-04-12 11:59:54 PDT
Comment on
attachment 457313
[details]
Patch r=mews
EWS
Comment 21
2022-04-12 17:39:36 PDT
Committed
r292793
(
249576@main
): <
https://commits.webkit.org/249576@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 457313
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug