Skip to content

Draft: Bug 23656&40477: Reorganize mozconfig files

For #40917 (closed), we'd like to provide some mozconfigs before the fork point.

This commits add two files:

  • browser/config/mozconfigs/base-browser: a file with all the common build preferences (so, it doesn't contain the toolchains), and all the preferences to enhance security and privacy
    • ideally, this should be added at the beginning of the patch set;
  • browser/config/mozconfigs/tor-browser: a file that adds Tor-related settings on top of the ones of base-browser.

The rationale is removing redundancy in configurations files (see also tor-browser-build#40477 (closed)).

Every mozconfig-$ARCH sources browser/config/mozconfigs/tor-browser, and adds only a few not common settings.

In the -2 branch, I'd add them at the beginning of the patch set and source browser/config/mozconfigs/base-browser instead. Then, I'd make them source browser/config/mozconfigs/tor-browser from the "TB3: ..." commit onward.

This commit also renames .mozconfig to mozconfig-linux-x86_64-dev. This means that all the developers that make local, incremental builds will need to provide their own mozconfig. It could be a link to the new file, or one that includes it, or even a completely new file. As an advantage, changes to that file will not interfere with rebases anymore. The disadvantage is that you may forget to remove temporary modifications. (TBH, a similar achievement could be reached by setting every time the MOZCONFIG environment variable, but I prefer the solution I'm proposing).

In addition to that, I have renamed the various .mozconfig-$ARCH to mozconfig-$ARCH. Since they are quite important config files, I think it's better to keep them as normally visible file - as opposed to the various files used by VCS, linters, etc... - but this isn't a strong preference. The build system is compatible with both .mozconfig and mozconfig files, is the initial dot a historical thing?

Finally, this commits is a starting point to address tor-browser-build#23656 (closed).

I didn't include settings for the toolchain. I think we could keep them in tor-browser-build, and inject them in the same way we do know, but to a mozconfig-toolchain file. I have added a check on the base-browser file to load the mozconfig-toolchain whenever it finds it. An alternative, is adding them anyway to the mozconfig-$ARCH file, except for mozconfig-linux-x86_64-dev, since it's the only file we use to build outside tor-browser-build.

Edited by Pier Angelo Vendrame

Merge request reports

Loading