Skip to content

Commit 2d62a3e

Browse files
Remove build-webkit's notion of feature flags having a default value
https://bugs.webkit.org/show_bug.cgi?id=177338 Reviewed by Alex Christensen. .: Add an ENABLE_EXPERIMENTAL_FEATURES flag and use it to enable certain features. * Source/cmake/OptionsGTK.cmake: * Source/cmake/OptionsWPE.cmake: * Source/cmake/WebKitFeatures.cmake: Source/WebKit: Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime experimental features. * Shared/WebPreferencesDefinitions.h: Tools: Delegate feature flag default values to the build system. (FeatureDefines.xcconfig for Xcode, WebKitFeatures.cmake and Options*.cmake for CMake, and FeatureDefines.h for everyone) * BuildSlaveSupport/build.webkit.org-config/config.json: * BuildSlaveSupport/build.webkit.org-config/master.cfg: (Factory.__init__): Update GTK and WPE buildbot configuration to use --no-experimental-features on old stable bots instead of --default-cmake-features. * Scripts/build-webkit: (cMakeArgsFromFeatures): Default feature values to 'undef'. Remove the --default-cmake-features argument; it is now the default. Add --no-experimental-features to replace it. Stop printing the default feature flag value in the help. Avoid propagating undefined values to the build system; only mention flags that are overridden on the command line. This has the nice side effect of using the default CMake features for CMake builds, but still allowing toggling of them using the prettier --FEATURE and --no-FEATURE arguments. * Scripts/webkitdirs.pm: (generateBuildSystemFromCMakeProject): No longer need to suppress CMake warnings about unused arguments. * Scripts/webkitperl/FeatureList.pm: Remove the default values from the feature list. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 3da06a3 commit 2d62a3e

File tree

12 files changed

+191
-117
lines changed

12 files changed

+191
-117
lines changed

ChangeLog

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2017-09-22 Tim Horton <[email protected]> and Michael Catanzaro <[email protected]>
2+
3+
Remove build-webkit's notion of feature flags having a default value
4+
https://bugs.webkit.org/show_bug.cgi?id=177338
5+
6+
Reviewed by Alex Christensen.
7+
8+
Add an ENABLE_EXPERIMENTAL_FEATURES flag and use it to enable certain features.
9+
10+
* Source/cmake/OptionsGTK.cmake:
11+
* Source/cmake/OptionsWPE.cmake:
12+
* Source/cmake/WebKitFeatures.cmake:
13+
114
2017-09-20 Keith Miller <[email protected]>
215

316
JSC should use unified sources for platform specific files.

Source/WebKit/ChangeLog

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2017-09-22 Tim Horton <[email protected]> and Michael Catanzaro <[email protected]>
2+
3+
Remove build-webkit's notion of feature flags having a default value
4+
https://bugs.webkit.org/show_bug.cgi?id=177338
5+
6+
Reviewed by Alex Christensen.
7+
8+
Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime
9+
experimental features.
10+
11+
* Shared/WebPreferencesDefinitions.h:
12+
113
2017-09-22 Chris Dumez <[email protected]>
214

315
Use high resolution timestamp for event time

Source/WebKit/Shared/WebPreferencesDefinitions.h

+10-8
Original file line numberDiff line numberDiff line change
@@ -348,23 +348,25 @@
348348
#define FOR_EACH_WEBKIT_DEBUG_UINT32_PREFERENCE(macro) \
349349
macro(VisibleDebugOverlayRegions, visibleDebugOverlayRegions, UInt32, uint32_t, 0, "", "")
350350

351-
// Our Xcode build system does not currently have any concept of DEVELOPER_MODE.
352351
// Cocoa ports must disable experimental features on release branches for now.
353-
#if ENABLE(DEVELOPER_MODE) || PLATFORM(COCOA)
352+
#if ENABLE(EXPERIMENTAL_FEATURES) || PLATFORM(COCOA)
354353
#define DEFAULT_EXPERIMENTAL_FEATURES_ENABLED true
355354
#else
356355
#define DEFAULT_EXPERIMENTAL_FEATURES_ENABLED false
357356
#endif
358357

359358
// For experimental features:
360359
// - The type should be boolean.
361-
// - You must provide the last two parameters for all experimental features. They
362-
// are the text exposed to the user from the WebKit client.
363-
// - They should be alphabetically ordered by the human readable text (the first string).
364-
// - The default value may be either false (for unstable features) or
360+
// - You must provide the last two parameters for all experimental features.
361+
// They are the text exposed to the user from the WebKit client.
362+
// - They should be *alphabetically ordered* by the human readable text (the
363+
// first string).
364+
// - The default value may be either false (for really unstable features) or
365365
// DEFAULT_EXPERIMENTAL_FEATURES_ENABLED (for features that are ready for
366-
// wider testing).
367-
366+
// wider testing). *The default value may not be true*. That would no longer
367+
// be experimental.
368+
//
369+
// Actually read the comment above before modifying this list!
368370
#define FOR_EACH_WEBKIT_EXPERIMENTAL_FEATURE_PREFERENCE(macro) \
369371
macro(ConstantPropertiesEnabled, constantPropertiesEnabled, Bool, bool, true, "Constant Properties", "Enable CSS constant() properties") \
370372
macro(DisplayContentsEnabled, displayContentsEnabled, Bool, bool, false, "CSS display: contents", "Enable CSS display: contents support") \

Source/cmake/OptionsGTK.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INDEXED_DATABASE PRIVATE ON)
157157
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INDEXED_DATABASE_IN_WORKERS PRIVATE ON)
158158
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_COLOR PRIVATE ON)
159159
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_CONTROLS_SCRIPT PRIVATE ON)
160+
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_SOURCE PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
161+
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_STREAM PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
160162
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MHTML PRIVATE ON)
161163
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NOTIFICATIONS PRIVATE ON)
162164
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PUBLIC_SUFFIX_LIST PRIVATE ON)
@@ -166,6 +168,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_USERSELECT_ALL PRIVATE ON)
166168
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_USER_MESSAGE_HANDLERS PRIVATE ON)
167169
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SUBTLE_CRYPTO PRIVATE ON)
168170
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL PRIVATE ON)
171+
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_RTC PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
169172

170173
include(GStreamerDefinitions)
171174

Source/cmake/OptionsWPE.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ include(GStreamerDefinitions)
1414
WEBKIT_OPTION_DEFINE(EXPORT_DEPRECATED_WEBKIT2_C_API "Whether to export the WebKit2 C API" PRIVATE OFF)
1515

1616
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_3D_TRANSFORMS PUBLIC ON)
17-
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS PUBLIC OFF)
17+
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS PUBLIC ${ENABLE_EXPERIMENTAL_FEATURES})
1818
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_REGIONS PUBLIC OFF)
1919
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_SELECTORS_LEVEL4 PUBLIC ON)
2020
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DEVICE_ORIENTATION PUBLIC OFF)
@@ -24,7 +24,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PUBLIC OFF)
2424
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INDEXED_DATABASE PRIVATE ON)
2525
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INDEXED_DATABASE_IN_WORKERS PRIVATE OFF)
2626
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_CONTROLS_SCRIPT PUBLIC ON)
27-
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_SOURCE PUBLIC OFF)
27+
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_SOURCE PUBLIC ${ENABLE_EXPERIMENTAL_FEATURES})
2828
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MHTML PRIVATE ON)
2929
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETSCAPE_PLUGIN_API PRIVATE OFF)
3030
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PUBLIC_SUFFIX_LIST PRIVATE ON)

Source/cmake/WebKitFeatures.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -343,3 +343,6 @@ macro(CREATE_CONFIGURATION_HEADER)
343343
)
344344
file(REMOVE "${CMAKE_BINARY_DIR}/cmakeconfig.h.tmp")
345345
endmacro()
346+
347+
option(ENABLE_EXPERIMENTAL_FEATURES "Enable experimental features" OFF)
348+
SET_AND_EXPOSE_TO_BUILD(ENABLE_EXPERIMENTAL_FEATURES ${ENABLE_EXPERIMENTAL_FEATURES})

Tools/BuildSlaveSupport/build.webkit.org-config/config.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,13 @@
307307
{
308308
"name": "GTK Linux 64-bit Release Debian Stable (Build)", "type": "Build", "builddir": "gtk-linux-64-release-debian",
309309
"platform": "gtk", "configuration": "release", "architectures": ["x86_64"],
310-
"additionalArguments": ["--default-cmake-features"],
310+
"additionalArguments": ["--no-experimental-features"],
311311
"slavenames": ["gtk-linux-slave-10"]
312312
},
313313
{
314314
"name": "GTK Linux 64-bit Release Ubuntu LTS (Build)", "type": "Build", "builddir": "gtk-linux-64-release-ubuntu",
315315
"platform": "gtk", "configuration": "release", "architectures": ["x86_64"],
316-
"additionalArguments": ["--default-cmake-features"],
316+
"additionalArguments": ["--no-experimental-features"],
317317
"slavenames": ["gtk-linux-slave-11"]
318318
},
319319
{

Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ class Factory(factory.BuildFactory):
871871
self.addStep(DeleteStaleBuildFiles())
872872
if platform == "win":
873873
self.addStep(InstallWin32Dependencies())
874-
if platform == "gtk" and additionalArguments != ["--default-cmake-features"]:
874+
if platform == "gtk" and additionalArguments != ["--no-experimental-features"]:
875875
self.addStep(InstallGtkDependencies())
876876
if platform == "wpe":
877877
self.addStep(InstallWpeDependencies())

Tools/ChangeLog

+36-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
2017-09-22 Tim Horton <[email protected]> and Michael Catanzaro <[email protected]>
2+
3+
Remove build-webkit's notion of feature flags having a default value
4+
https://bugs.webkit.org/show_bug.cgi?id=177338
5+
6+
Reviewed by Alex Christensen.
7+
8+
Delegate feature flag default values to the build system.
9+
(FeatureDefines.xcconfig for Xcode, WebKitFeatures.cmake and Options*.cmake for CMake, and FeatureDefines.h for everyone)
10+
11+
* BuildSlaveSupport/build.webkit.org-config/config.json:
12+
* BuildSlaveSupport/build.webkit.org-config/master.cfg:
13+
(Factory.__init__):
14+
Update GTK and WPE buildbot configuration to use --no-experimental-features on old stable
15+
bots instead of --default-cmake-features.
16+
17+
* Scripts/build-webkit:
18+
(cMakeArgsFromFeatures):
19+
Default feature values to 'undef'.
20+
Remove the --default-cmake-features argument; it is now the default.
21+
Add --no-experimental-features to replace it.
22+
Stop printing the default feature flag value in the help.
23+
Avoid propagating undefined values to the build system;
24+
only mention flags that are overridden on the command line.
25+
26+
This has the nice side effect of using the default CMake features
27+
for CMake builds, but still allowing toggling of them using the
28+
prettier --FEATURE and --no-FEATURE arguments.
29+
30+
* Scripts/webkitdirs.pm:
31+
(generateBuildSystemFromCMakeProject):
32+
No longer need to suppress CMake warnings about unused arguments.
33+
34+
* Scripts/webkitperl/FeatureList.pm:
35+
Remove the default values from the feature list.
36+
137
2017-09-21 Joseph Pecoraro <[email protected]>
238

339
Unreviewed, add the ability to skip a test262 test.
@@ -393,7 +429,6 @@
393429
(-[RedirectedDownloadDelegate _downloadDidFinish:]):
394430
(TEST):
395431

396-
>>>>>>> .r222309
397432
2017-09-20 Alex Christensen <[email protected]>
398433

399434
Add infrastructure for adding custom headers to requests per website

Tools/Scripts/build-webkit

+25-17
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ chdirWebKit();
5252

5353
my $showHelp = 0;
5454
my $clean = 0;
55-
my $defaultCMakeFeatures = 0;
5655
my $minimal = 0;
5756
my $installHeaders;
5857
my $installLibs;
@@ -62,6 +61,7 @@ my @cmakeArgs;
6261
my $onlyWebKitProject = 0;
6362
my $coverageSupport = 0;
6463
my $shouldRunStaticAnalyzer = 0;
64+
my $noExperimentalFeatures = 0;
6565
my $startTime = time();
6666
my $archs32bit = 0;
6767

@@ -79,9 +79,10 @@ foreach (@ARGV) {
7979
}
8080
}
8181

82-
# Initialize values from defaults
82+
# Feature flags default to undefined, where they will inherit the default value
83+
# specified by the build system, or to 'off' if --minimal is specified.
8384
foreach (@features) {
84-
${$_->{value}} = ($minimal ? 0 : $_->{default});
85+
${$_->{value}} = ($minimal ? 0 : undef);
8586
}
8687

8788
my $programName = basename($0);
@@ -106,12 +107,12 @@ Usage: $programName [options] [options to pass to build system]
106107
107108
--inspector-frontend Copy Web Inspector user interface resources to the build directory
108109
109-
--prefix=<path> Set installation prefix to the given path (Gtk/Efl only)
110+
--prefix=<path> Set installation prefix to the given path (CMake only, except Windows)
110111
--makeargs=<arguments> Optional Makefile flags
111112
--cmakeargs=<arguments> One or more optional CMake flags (e.g. --cmakeargs="-DFOO=bar -DCMAKE_PREFIX_PATH=/usr/local")
112113
113114
--minimal No optional features, unless explicitly enabled
114-
--default-cmake-features Use the default CMake features enabled for the port (CMake based ports)
115+
--no-experimental-features No experimental features, unless explicitly enabled (CMake only)
115116
116117
--only-webkit Build only the WebKit project
117118
@@ -129,13 +130,13 @@ my %options = (
129130
'only-webkit' => \$onlyWebKitProject,
130131
'coverage' => \$coverageSupport,
131132
'analyze' => \$shouldRunStaticAnalyzer,
132-
'default-cmake-features' => \$defaultCMakeFeatures,
133+
'no-experimental-features' => \$noExperimentalFeatures,
133134
);
134135

135136
# Build usage text and options list from features
136137
foreach (@features) {
137138
my $opt = sprintf("%-35s", " --[no-]$_->{option}");
138-
$usage .= "$opt $_->{desc} (default: $_->{default})\n";
139+
$usage .= "$opt $_->{desc}\n";
139140
$options{"$_->{option}!"} = $_->{value};
140141
}
141142

@@ -176,15 +177,15 @@ my @options = ();
176177

177178
if (isAppleCocoaWebKit()) {
178179
push @options, XcodeOptions();
179-
sub option($$$)
180+
sub option($$)
180181
{
181-
my ($feature, $isEnabled, $defaultValue) = @_;
182-
return "" if $defaultValue == $isEnabled;
182+
my ($feature, $isEnabled) = @_;
183+
return "" if not defined $isEnabled;
183184
return $feature . "=" . ($isEnabled ? $feature : "");
184185
}
185186

186187
foreach (@features) {
187-
my $option = option($_->{define}, ${$_->{value}}, $_->{default});
188+
my $option = option($_->{define}, ${$_->{value}});
188189
push @options, $option unless $option eq "";
189190
}
190191

@@ -249,7 +250,7 @@ if (isCMakeBuild() && !isAnyWindows()) {
249250
my $maxCPULoad = maxCPULoad() if $makeArgs !~ /-l\s*\d+\.?\d*/;
250251
$makeArgs .= " -l" . maxCPULoad() if defined $maxCPULoad;
251252

252-
# We remove CMakeCache to avoid the bots to reuse cached flags when
253+
# We remove CMakeCache to avoid the bots reusing cached flags when
253254
# we enable new features. This forces a reconfiguration.
254255
my @featureArgs = cMakeArgsFromFeatures();
255256
removeCMakeCache(@featureArgs);
@@ -346,15 +347,22 @@ exit 0;
346347
sub cMakeArgsFromFeatures()
347348
{
348349
my @args;
349-
if (!$defaultCMakeFeatures) {
350-
foreach (@features) {
351-
my $featureName = $_->{define};
352-
if ($featureName) {
353-
my $featureEnabled = ${$_->{value}} ? "ON" : "OFF";
350+
351+
if (!$noExperimentalFeatures) {
352+
push @args, "-DENABLE_EXPERIMENTAL_FEATURES=ON";
353+
}
354+
355+
foreach (@features) {
356+
my $featureName = $_->{define};
357+
if ($featureName) {
358+
my $featureValue = ${$_->{value}};
359+
if (defined $featureValue) {
360+
my $featureEnabled = $featureValue ? "ON" : "OFF";
354361
push @args, "-D$featureName=$featureEnabled";
355362
}
356363
}
357364
}
365+
358366
return @args;
359367
}
360368

Tools/Scripts/webkitdirs.pm

-2
Original file line numberDiff line numberDiff line change
@@ -2072,8 +2072,6 @@ sub generateBuildSystemFromCMakeProject
20722072
# Some ports have production mode, but build-webkit should always use developer mode.
20732073
push @args, "-DDEVELOPER_MODE=ON" if isGtk() || isJSCOnly() || isWPE();
20742074

2075-
# Don't warn variables which aren't used by cmake ports.
2076-
push @args, "--no-warn-unused-cli";
20772075
push @args, @cmakeArgs if @cmakeArgs;
20782076

20792077
my $cmakeSourceDir = isCygwin() ? windowsSourceDir() : sourceDir();

0 commit comments

Comments
 (0)