BACKGROUND
I'm doing a project to slowly remove the feature flags from the global build configuration. As an example, currently we pass ENABLE_TASK_MANAGER when compiling ICU even though it's only used by a couple of files in the Chrome directory. As we add more more stuff, this is not scalable and sub-projects that DEPS in builds are annoyed at getting all of this junk.
The replacement is the BUILDFLAG system which prevents most of the mistakes that pop up when doing non-global defines. It also allows flags to be flipped with fast incremental rebuilds (in the above example, you wouldn't have to recompile ICU when flipping the task manager.
Mostly these flags exist because feature teams added them when landing and experimenting with the code and never cleaned them up.
Some of the flags are quite challenging to move because there is no clear place to put them that's not in the global build configuration. An example is enable_themes which is used only in Chrome and in one file once in components. This use in components represents a layering violation. Presumably it was moved to share with iOS and the design of the grit build makes it difficult to modularize.
PLAN
I would like to delete the following global variables in //build/config/features.gni and replace them with platform ifdefs or delete them (at one is used only in Chrome and is disabled only on iOS so it's currently a no-op).
enable_notifications
enable_web_speech
enable_task_manager
enable_configuration_policy
enable_mac_keystone
enable_themes
These flags are not overridable as GN args, so anybody setting them would need to edit the build files manually. This also means we are not testing these flags on any bots outside of the platforms they are set on by default. They are very stable (excluding either iOS or both Android and iOS as required by those platforms) and not likely to change in the future as far as I can tell.
I'm interested in hearing mostly from embedders that may have local modifications to features.gni that change some of these not-otherwise-overridable build flags. If anybody feels like these flags are important please (1) let me know, and (2) write a patch to make the value properly overridable without using a global flag. I'm happy to provide consulting as needed.
Thanks,
Brett