ungoogled-chromium icon indicating copy to clipboard operation
ungoogled-chromium copied to clipboard

Check for chrome://flags changes across versions

Open emanruse opened this issue 4 years ago • 19 comments

Hi,

New versions of Chrome introduce new and remove old flags. I really hate to dig through the whole list of flags with each new version, checking which ones I may need to tune to my liking or not (+ some are not even documented).

How can one monitor which ones are added/removed/modified from version to version? (and possibly for documentation on each)

emanruse avatar Mar 12 '20 11:03 emanruse

One could save the output of gn args out/Release --list and diff it between releases.

That's not the best solution of course and I'd also like to know if there is a better way of doing this.

PF4Public avatar Mar 15 '20 11:03 PF4Public

One could save the output of gn args out/Release --list and diff it between releases.

When do you run this? After checkout of ungoogled-chromium? After running build.sh? Or at any other step?

That's not the best solution of course

Why?

emanruse avatar Mar 15 '20 20:03 emanruse

It should be run after gn gen. In Guix we run it as part of the build procedure, so it's possible to look up historical flags from the Guix CI logs.

Here is a recent build log:

https://ci.guix.gnu.org/log/1hsn58gv8xk1a1b8xi00j3l9fkxhch1f-ungoogled-chromium-80.0.3987.132-0.7e68f18

Older versions can be found by searching the CI, e.g. https://ci.guix.gnu.org/search?query=ungoogled-chromium-79

It should be possible to script the download of these and make pretty diffs, but I'm not volunteering!

mbakke avatar Mar 16 '20 01:03 mbakke

It should be run after gn gen.

OK. I tried that (adding the gn args command in build.sh right before the ninja line) but it's telling me that I need a previously-generated build. It seems to me too challenging to keep and diff logs of builds, especially considering that (*my speculation) they may be somewhat different considering there are multiple distro variants of ungoogled-chromium.

I looked for a different approach:

Digging around the source of chromium I found this (e.g. for version 80.0.3987.132):

https://chromium.googlesource.com/chromium/src/+/refs/tags/80.0.3987.132/chrome/browser/flag-metadata.json

The "blame" shows what was added chronologically but I guess it is not very useful as it is based on chromium's own versioning and ungoogled-chromium doesn't have corresponding version for every chromium version. IOW it cannot be a direct source of info per se.

But I suppose it is possible to have a script which:

  1. Downloads .../tags/previous-UC-version/.../flag-metadata.json
  2. Downloads .../tags/current-UC-version/.../flag-metadata.json
  3. Diffs both
  4. Outputs added, removed, expired flags.

The previous and current UC versions is info which is availabne to ungoogled-chromium's project, so this should be possible to have these version strings.

The output can be shown for example right after the build finishes. Then the user will know what is new in regards to flags and what he may want to configure.

What do you say?

emanruse avatar Mar 16 '20 12:03 emanruse

P.S. One thing that may need special attention in the json-diffing approach is: diff based on non-adjacent ungoogled-chromium releases, e.g. I may have build v.78 then skipped v.79 and build v.80. Then the diff should consider that. Perhaps the diff-script should accept manual input of prev and current version too. Then it would be possible to compare what happened with flags between any 2 versions.

emanruse avatar Mar 16 '20 12:03 emanruse

Wait, what kinds of "flags" are we talking about here? Here's what I came up with off the top of my head:

  1. GN args
  2. Compiler/linker flags (usually set by GN)
  3. Anything listed in Chromium's docs/configuration.md. These are: Prefs, Features, Switches, Flags, and Settings

Eloston avatar Mar 19 '20 18:03 Eloston

Wait, what kinds of "flags" are we talking about here?

The ones we access via chrome://flags

emanruse avatar Mar 19 '20 20:03 emanruse

I see, in that case then I think flags-metadata.json is the best way to go here. The stuff with gn args is wrong and will not give you want you want.

We could probably add a devscript that can fetch both versions of the JSON and compare them. Finding the versions should be pretty easy; just read chromium_version.txt in the current checkout and the one in the last tag.

If there's a consistent schema/format to the JSON, we can also parse both of them to get a cleaner comparison.

Eloston avatar Mar 20 '20 04:03 Eloston

The ones we access via chrome://flags

That should have been written in the first post. I was confused. Of course gn args are unrelated here.

PF4Public avatar Mar 20 '20 09:03 PF4Public

The ones we access via chrome://flags

That should have been written in the first post. I was confused.

Sorry about that. Glad we clarified it.

emanruse avatar Mar 20 '20 17:03 emanruse

You might like the file flag-metadata.json (sorry, don't know how to link to the live file) as it tells at least the planned deprecation version before it is deprecated.

Madis0 avatar May 27 '20 05:05 Madis0

@Madis0 That was mentioned in https://github.com/Eloston/ungoogled-chromium/issues/959#issuecomment-599501744. The Last Known Good Revision version of the file is here: https://chromium.googlesource.com/chromium/src/+/lkgr/chrome/browser/flag-metadata.json

Eloston avatar May 31 '20 19:05 Eloston

I have already done this, albeit partially. since it is 2020, are you still interested?

uazo avatar Oct 20 '23 06:10 uazo

What have you done, @uazo?

emanruse avatar Oct 20 '23 16:10 emanruse

see https://github.com/uazo/bromite-flags-list

I found a way to extract code information from the code itself by exploiting clangd and using ClangQL (fork of https://github.com/frabert/ClangQL).

Currently, through that method I can have all flags active in my configuration excel json history

is a first stage because it needs further development, but it is usable

uazo avatar Oct 21 '23 09:10 uazo

@uazo Thanks for sharing, perhaps this could be adapted to ungoogled-chromium.

PF4Public avatar Oct 21 '23 11:10 PF4Public

perhaps this could be adapted to ungoogled-chromium.

@PF4Public the idea is to apply it directly on chromium vanilla. i will keep you updated.

uazo avatar Oct 25 '23 07:10 uazo

@uazo Have you considered calling gn args --list out/Release each version, saving the result and then diffing resulting files? Maybe it would be simpler?

PF4Public avatar Jan 13 '24 14:01 PF4Public

Maybe it would be simpler?

would not be sufficient. with that procedure I extract the code-related flags (to understand those with BASE_FEATURE), the mechanism you propose instead extracts the gn flags, i.e. the BUILDFLAG(), although there is no 1-1 relationship between the gn flags and the BUILDFLAGs.

uazo avatar Jan 15 '24 07:01 uazo