chromiumgn

How can I minimize the Chromium build files?


When I performed a release build of Chromium in a Windows environment according to the following procedure, the file size was 48GB.

https://chromium.googlesource.com/chromium/src/+/main/docs/windows_build_instructions.md

However, the file installed using the Chrome installer is about 700MB. Is there a build option to output the minimum required files for browsing?

The build options currently in use are:

gen gen out/Default --args="is_debug=false enable_nacl=false symbol_level=0 blink_symbol_level=0 is_component_build=true"
autoninja -C out/Default chrome

Solution

  • You are using is_component_build flag which will build many shared libraries to avoid the long linkage time, if it's not specified. You can just remove that flag, then it will be automatically set to false. That should minimize the number of files output during the compilation process.

    Also your build folder includes debug symbols and other files thereby increasing the build folder's size to a few GBs. Generally even for highly optimized release build, it's greater than 20 GB and for debug build it's around 80-100 GB.

    So, you should not be comparing the build folder size with the installation folder size. Also, mini_installer will greatly reduce the size of your Chromium fork while distributing your app. So you should consider making an installer for your Chromium fork for distribution to end-users.