Trouble cleaning up chromium browser build

273 views
Skip to first unread message

JOGOS Software

unread,
Jun 21, 2023, 9:09:11 PM6/21/23
to Chromium-dev
I have recently made a build of the Chromium browser that I may want to distribute. I am not sure what I should get rid of in the build and what I shouldn't, my goal is to get it as small as possible without impairing functionality. I have had trouble with the "ninja -t clean" command, as it seems to delete chrome.exe and other necessary files.

Dirk Pranke

unread,
Jun 21, 2023, 9:40:45 PM6/21/23
to jogbus...@gmail.com, Chromium-dev
Hi!

As you've seen, you definitely do not want to run `ninja -t clean` as that will delete everything that was built in that directory.

You can run `gn desc out/default //chrome:chrome runtime_deps` to get a list of all of the files and directories GN thinks you will need to be able to run Chrome. This list is probably conservative and includes files that aren't really needed, but we haven't spent much time pruning things. 

You can also run `python3 tools/mb/mb.py zip //out/default //chrome:chrome chrome.zip` to create a zipfile in your current directory that will contain all the files listed by the GN command; `mb zip` is just a wrapper around `gn desc` to automate a few things.

The actual packaging done by the installs is somewhat more complicated, so I'd probably stick with the above, at least as a rough draft.

-- Dirk

On Wed, Jun 21, 2023 at 6:08 PM JOGOS Software <jogbus...@gmail.com> wrote:
I have recently made a build of the Chromium browser that I may want to distribute. I am not sure what I should get rid of in the build and what I shouldn't, my goal is to get it as small as possible without impairing functionality. I have had trouble with the "ninja -t clean" command, as it seems to delete chrome.exe and other necessary files.

--
--
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...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/1675ff9b-3d19-4087-8726-889117cb1a72n%40chromium.org.

Christian Biesinger

unread,
Jun 22, 2023, 1:58:07 PM6/22/23
to dpr...@google.com, jogbus...@gmail.com, Chromium-dev
Also make sure to set `is_official_build = 1` in your args.gn for best results.

Christian
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAEoffTDw3yC177rr4Xmz80yhnVpQ_XCHBeoztPqL9kktGgi2Pg%40mail.gmail.com.

Caleb Raitto

unread,
Jun 23, 2023, 10:52:08 AM6/23/23
to Chromium-dev, Christian Biesinger, jogbus...@gmail.com, Chromium-dev, dpr...@google.com
On Windows, there's also the mini_installer build target [0] -- it's a exe file that installs and starts a Chromium instance. If I recall correctly, you can copy that file to a new machine and you don't need to copy anything else to install and run Chromium. I've used it to test Chrome for Windows (I cross-build from my Linux machine and copy it over RDP). I don't think it exists on Linux, Mac, or other platforms though...

Unlike the official Chrome installer, the mini_installer itself has no UI -- it just silently installs and immediately starts Chromium. I think it doesn't work if Chromium is already installed via the mini_installer (you have to uninstall first), but it can live alongside a official Chrome installation(s) (i.e. stable, beta, dev, canary).

I haven't used it in a while, so your mileage may vary.

-Caleb
On Thursday, June 22, 2023 at 1:58:07 PM UTC-4 Christian Biesinger wrote:
Also make sure to set `is_official_build = 1` in your args.gn for best results.

Christian

On Wed, Jun 21, 2023 at 9:40 PM 'Dirk Pranke' via Chromium-dev
<chromi...@chromium.org> wrote:
>
> Hi!
>
> As you've seen, you definitely do not want to run `ninja -t clean` as that will delete everything that was built in that directory.
>
> You can run `gn desc out/default //chrome:chrome runtime_deps` to get a list of all of the files and directories GN thinks you will need to be able to run Chrome. This list is probably conservative and includes files that aren't really needed, but we haven't spent much time pruning things.
>
> You can also run `python3 tools/mb/mb.py zip //out/default //chrome:chrome chrome.zip` to create a zipfile in your current directory that will contain all the files listed by the GN command; `mb zip` is just a wrapper around `gn desc` to automate a few things.
>
> The actual packaging done by the installs is somewhat more complicated, so I'd probably stick with the above, at least as a rough draft.
>
> -- Dirk
>
> On Wed, Jun 21, 2023 at 6:08 PM JOGOS Software <jogbus...@gmail.com> wrote:
>>
>> I have recently made a build of the Chromium browser that I may want to distribute. I am not sure what I should get rid of in the build and what I shouldn't, my goal is to get it as small as possible without impairing functionality. I have had trouble with the "ninja -t clean" command, as it seems to delete chrome.exe and other necessary files.
>>
>> --
>> --
>> 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/1675ff9b-3d19-4087-8726-889117cb1a72n%40chromium.org.
>
> --
> --
> 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.
Reply all
Reply to author
Forward
0 new messages