RFC: rename buildflag_header targets (and gni) to buildflag

54 views
Skip to first unread message

Scott Violet

unread,
Feb 20, 2018, 10:29:46 PM2/20/18
to chromium-dev
We currently have two unrelated concepts in Chrome named similarly:

1. A target to generate buildflags. Typically this target is named foo_feature(s) and the corresponding gni named foo_feature.gni. For example, ui/base has ui_features.gni and the target ui_features.

2. base::Feature. This is generally unrelated to (1) and used for features that are user changeable (such as about:flags and/or finch trials). These are typically named with feature in the name as well. For example, ui/base/ui_base_features.h.

Given the two very different meanings I propose we rename the buildflag related targets and files to use buildflags. For ui/base this would mean the following:
. ui_features.gni is renamed to ui_base_buildflags.gni
. rename target ui_features to ui_base_buildflags

Any reason not to do this?

  -Scott

Ken Rockot

unread,
Feb 20, 2018, 11:12:08 PM2/20/18
to Scott Violet, chromium-dev
Seems like an intuitive change to me. 


  -Scott

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAKARY_%3D5aofhmLNWgdLLS_gii%3DrkK0M9EnMXV6z9TffN445YgQ%40mail.gmail.com.

Nico Weber

unread,
Feb 21, 2018, 8:37:39 AM2/21/18
to Scott Violet, chromium-dev
Sounds good to me.

There are quite a few buildflag _feature flags. How can we make sure we don't end up converting just a couple, ending up in an even more inconsistent place?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.

Scott Violet

unread,
Feb 21, 2018, 11:03:16 AM2/21/18
to Nico Weber, chromium-dev
My plan is a grep for all gn targets using buildflag_header. Is there a better way to ensure I don't miss anything?

  -Scott

Alexei Svitkine

unread,
Feb 21, 2018, 11:08:39 AM2/21/18
to Scott Violet, Nico Weber, chromium-dev
The proposed change sounds good to me too. Thanks for the clean up!

Wez

unread,
Feb 21, 2018, 11:19:34 AM2/21/18
to asvi...@chromium.org, Scott Violet, Nico Weber, chromium-dev

Dirk Pranke

unread,
Feb 21, 2018, 1:07:01 PM2/21/18
to Scott Violet, Alexei Svitkine, Nico Weber, chromium-dev, Wez
I agree that it would be good to better distinguish between compile-time features and runtime/user-changeable features.

However, I wonder a bit how many of the build flags in the *features.gni files aren't actually used in buildflag_header() targets, and why not (or whether that'll cause more confusion).

For example, in ui_features.gni, 6 of the 7 variables are in a declare_args() block, and 6 of the 7 variables are used in //ui/base:ui_features, but those aren't the same 6 (enable_hidpi isn't a declare_arg(), and optimize_webui isn't used in :ui_features).

If everything in these .gni files was in a declare_args() block, I might be tempted to call the files *_build_args instead of buildflags, but if they're not all build args, that might also be confusing.

(I'm not sure I have a better suggestion here, unfortunately).

-- Dirk

Scott Violet

unread,
Feb 21, 2018, 2:07:04 PM2/21/18
to Nico Weber, chromium-dev
I will make sure to address them all. I suppose we could add a PRESUBMIT check to ensure naming consistency, but I'm not really sure that is necessary. WDYT?

On Wed, Feb 21, 2018 at 5:36 AM, Nico Weber <tha...@chromium.org> wrote:

Nico Weber

unread,
Feb 21, 2018, 2:08:16 PM2/21/18
to Scott Violet, chromium-dev
If you convert them all, I'd expect that new ones will end up being consistent with the existing ones, so I'd agree with not needing a presubmit.

Scott Violet

unread,
Feb 21, 2018, 2:13:50 PM2/21/18
to Dirk Pranke, Alexei Svitkine, Nico Weber, chromium-dev, Wez
Dirk,

I think you're pointing out that we aren't consistent with exactly what lives in *features.gni. This proposal doesn't attempt to solve that (I haven't even realized that until you pointed it out). That said, I think this proposal leaves us in an overall less confusing place then we are currently in. Do you agree?

  -Scott

Dirk Pranke

unread,
Feb 21, 2018, 3:01:47 PM2/21/18
to Scott Violet, Alexei Svitkine, Nico Weber, chromium-dev, Wez
Yes, sorry for being unclear. I think this is a good proposal.

-- Dirk
Reply all
Reply to author
Forward
0 new messages