[webkit-changes] [WebKit/WebKit] a0da80: Refactor JSC_API_AVAILABLE to behave more like WK_...
Elliott Williams
noreply at github.com
Mon Feb 20 09:43:01 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a0da8012d30d24e63c583aa54056f2dedcdad4ac
https://github.com/WebKit/WebKit/commit/a0da8012d30d24e63c583aa54056f2dedcdad4ac
Author: Elliott Williams <emw at apple.com>
Date: 2023-02-20 (Mon, 20 Feb 2023)
Changed paths:
M Source/JavaScriptCore/API/JSRemoteInspector.h
M Source/JavaScriptCore/API/WebKitAvailability.h
M Source/JavaScriptCore/API/tests/testIncludes.m
M Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig
M Source/JavaScriptCore/Scripts/postprocess-header-rule
M Source/WebCore/config.h
M Source/WebKit/WebKit2Prefix.h
M Source/WebKitLegacy/mac/WebKitPrefix.h
Log Message:
-----------
Refactor JSC_API_AVAILABLE to behave more like WK_API_AVAILABLE
https://bugs.webkit.org/show_bug.cgi?id=250740
rdar://104354248
Reviewed by Alexey Proskuryakov.
Previously, we did not turn off JSC's availability declarations in
downlevel builds. This prevented us from converting TBA declarations to
shipping versions until those OS versions are used in all downlevel
builds. As a result, the most recent JSC_API_AVAILABLE versions are
macos(11.0) and ios(14.0).
Fix this and simplify the build by chaging JSC's availability logic to
be more like WK_API_AVAILABLE:
- In debug/release builds, JSC_API_AVAILABLE postprocessing is disabled.
- In production builds, WebKitAdditions determines when postprocessing
can be disabled, supporting the use of more recent availability
versions.
- When postprocessing is disabled, a public JSC header disables
JSC_API_AVAILABLE via preprocessor macros.
Postprocessing can be disabled by the
JSC_FRAMEWORK_HEADER_POSTPROCESSING_DISABLED build setting, but
WK_FRAMEWORK_HEADER_POSTPROCESSING_DISABLED is also recognized to match
existing behavior in WebKitAdditions.
* Source/JavaScriptCore/API/JSRemoteInspector.h: Remove the workaround
Patrick Angle needed to be able to call new SPI from downlevel builds.
* Source/JavaScriptCore/API/WebKitAvailability.h: Behave like
<WebKit/WKFoundation.h>. When JSC header postprocessing is disabled,
macros are used to stub out the availiability declarations. This
conditional logic is unifdef'd appropriately during the build.
* Source/JavaScriptCore/API/tests/testIncludes.m: No longer need to stub
out JSC_API_AVAILABLE here.
* Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig: Disable
postprocessing in debug/release, downlevel, and STP builds, just like
WebKit does.
* Source/JavaScriptCore/Scripts/postprocess-header-rule: Synced with
WebKit's postprocess-header-rule. Largely equivalent,
except with "JSC" prefixes. There is no needed equivalent to WebKit's
replace-webkit-additions-includes.py call or most of its unifdef
logic.
JSC_MAC_VERSION_TBA and JSC_IOS_VERSION_TBA, which are TBA'd
versions of __MAC_OS_X_VERSION_MIN_REQUIRED and
__IPHONE_OS_VERSION_MIN_REQUIRED, are still emitted, though we are not
currently using them.
* Source/WebCore/config.h: No longer need to stub out JSC_API_AVAILABLE
for CMake builds here, as JSC now does this for us.
* Source/WebKit/WebKit2Prefix.h: Ditto.
* Source/WebKitLegacy/mac/WebKitPrefix.h: Ditto.
Canonical link: https://commits.webkit.org/260542@main
More information about the webkit-changes
mailing list