ungoogled-chromium
ungoogled-chromium copied to clipboard
Check for chrome://flags changes across versions
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)
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.
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?
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!
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:
- Downloads .../tags/previous-UC-version/.../flag-metadata.json
- Downloads .../tags/current-UC-version/.../flag-metadata.json
- Diffs both
- 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?
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.
Wait, what kinds of "flags" are we talking about here? Here's what I came up with off the top of my head:
- GN args
- Compiler/linker flags (usually set by GN)
- Anything listed in Chromium's docs/configuration.md. These are: Prefs, Features, Switches, Flags, and Settings
Wait, what kinds of "flags" are we talking about here?
The ones we access via chrome://flags
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.
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.
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.
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 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
I have already done this, albeit partially. since it is 2020, are you still interested?
What have you done, @uazo?
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 Thanks for sharing, perhaps this could be adapted to ungoogled-chromium.
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 Have you considered calling gn args --list out/Release
each version, saving the result and then diffing resulting files? Maybe it would be simpler?
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.