Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 648846326ad49d8df7698f76d4fdc65f48b5f5ef
      
https://github.com/WebKit/WebKit/commit/648846326ad49d8df7698f76d4fdc65f48b5f5ef
  Author: Elliott Williams <[email protected]>
  Date:   2025-12-22 (Mon, 22 Dec 2025)

  Changed paths:
    M Tools/Scripts/libraries/webkitapipy/webkitapipy/macho.py
    M Tools/Scripts/libraries/webkitapipy/webkitapipy/program.py
    M Tools/Scripts/libraries/webkitapipy/webkitapipy/program_unittest.py
    M Tools/Scripts/libraries/webkitapipy/webkitapipy/sdkdb.py
    M Tools/Scripts/libraries/webkitapipy/webkitapipy/sdkdb_unittest.py

  Log Message:
  -----------
  [webkitapipy] Use of ObjC SPI methods ignored when a binary has a method with 
the same selector
https://bugs.webkit.org/show_bug.cgi?id=304532
rdar://166914163

Reviewed by Sam Sneddon.

When an SPI allowlist has an entry like:
    { name = "setHighFrameRateReason:", class = "CADisplayLink" },

and a binary has some other method in it with the same name:
    -[WKDisplayLinkHandler setHighFrameRateReason:]

audit-spi should NOT issue an "unnecessary allowed name" diagnostic. It
should assume that use of setHighFrameRateReason: in the code might be a
call to the SPI method.

This is in contrast to when an SPI allowlist has a classless entry like:
    { name = "setHighFrameRateReason:", class = "?" },

There, we continue to emit a diagnostic that the entry should be
cleaned up.

Implement this by changing how we load the binaries under audit: First,
add them to the exports table like any other binaries containing allowed
declarations. Then, add their bindings and selectors to the imports
table. The auditing query already takes a selector's class name into
consideration, so the only change needed is the logic used to populate
the database.

* Tools/Scripts/libraries/webkitapipy/webkitapipy/macho.py:
(APIReport.from_binary): Fix return type annotation.
* Tools/Scripts/libraries/webkitapipy/webkitapipy/program.py:
* Tools/Scripts/libraries/webkitapipy/webkitapipy/program_unittest.py:
(CLITest.test_loads_partial_sdkdb_for_framework):
* Tools/Scripts/libraries/webkitapipy/webkitapipy/sdkdb.py:
(DeclarationKind.from_sql): Fix return type annotation.
(SDKDB.add_binary):
(SDKDB._add_imports):
(SDKDB.add_for_auditing): Deleted.
* Tools/Scripts/libraries/webkitapipy/webkitapipy/sdkdb_unittest.py:
(TestSDKDB.audit_with):
(TestSDKDB.test_audit_unused_allow_multiple_allowlists):
(TestSDKDB):
(TestSDKDB.test_audit_allow_different_fully_qualified_methods_same_name):
(TestSDKDB.test_audit_unnecessary_allow_unqualified_methods_same_name):

Canonical link: https://commits.webkit.org/304887@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to