Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome binaries are 600MB when publishing #115

Closed
nightblade9 opened this issue Nov 13, 2024 · 6 comments
Closed

Chrome binaries are 600MB when publishing #115

nightblade9 opened this issue Nov 13, 2024 · 6 comments

Comments

@nightblade9
Copy link

Hi,

I'm prototyping something like Electron.NET: a Blazor web server with embedded Chromium for the front-end.

As it happens, I'm using the binaries from this repo (chromiumembeddedframework.runtime.win-x64 from NuGet). The binaries available are huge: if you run dotnet publish, the resulting folder is around 600MB. Is it possible to reduce this somehow?

I've taken the hopefully-risk-free steps of deleting interactive_ui_tests.exe (250MB) which looks like some sort of Chromium internal testing tool. I also delete locales, other than en-US, which is the default; this saves around 40MB.

The next biggest candidate, by an order of magnitude, is chrome.exe, weighing in at around 250mb. I thought, after reading #56 , that perhaps we can use a "minimal distribution" of Chromium instead. It looks like that change went in around 2017, though, and is already included, because the NuGet packages are from a couple of weeks ago.

Is there any way to build a smaller, more lightweight version of Chromium? I understood that ElectronJS does this, but their final "hello world" distribution is around 100MB. Mine, even with the shrinkages mentioned, is around 300MB.

@amaitland
Copy link
Member

I've taken the hopefully-risk-free steps of deleting interactive_ui_tests.exe (250MB) which looks like some sort of Chromium internal testing tool.

Are you sure you are in the correct repo? That's not a file that is part of the chromiumembeddedframework.runtime.win-x64 package.

The next biggest candidate, by an order of magnitude, is chrome.exe, weighing in at around 250mb.

Definitely don't ship chrome.exe, there should be libcef.dll which is should be a little over 200mb. That's expected (slightly smaller than chrome).

There shouldn't be any .exe files in the packages. .nupkg files are just zip files, so you can extract them and look for yourself.

Is there any way to build a smaller, more lightweight version of Chromium?

We just repackage the builds from https://cef-builds.spotifycdn.com/index.html

Building/modifying Chromium is outside the scope of this project.

@amaitland amaitland closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2024
@amaitland
Copy link
Member

You can take a look at my proof-of-concept project file here: as you can see, it only has two dependencies:

chromium
chromium.win-x64

Neither of those packages are generated from this repo.

@perlun
Copy link
Member

perlun commented Nov 20, 2024

@nightblade9 Perhaps you already figured this out, but the chromium.win-x64 NuGet package seems to come from here: https://github.com/devlooped/chromium. Hope this helps! 👋

@perlun
Copy link
Member

perlun commented Nov 20, 2024

Perhaps you already figured this out

Yes, you apparently did. 😂 devlooped/chromium#93

(In the future, if you create an issue in the wrong repo and end up creating another one in the right repo, please add a reference to it in the original issue - this makes things clearer for everybody)

@nightblade9
Copy link
Author

Sorry, my mistake.

@perlun
Copy link
Member

perlun commented Dec 6, 2024

No problems! 👍 Have a great day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants