Is it possible to compile Chromium with certain features removed?
Reported by
trusktr@gmail.com,
Jul 27 2017
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36 Steps to reproduce the problem: n/a What is the expected behavior? What went wrong? n/a Did this work before? N/A Does this work in other browsers? N/A Chrome version: 59.0.3071.115 Channel: n/a OS Version: OS X 10.12.5 Flash Version: For example, suppose I want to ship a custom application made with Chromium (something like Electron, but my own). Suppose my application does not use Canvas 2D context, only WebGL, and it does not use the `<video>` element. Would it be possible to compile Chromium without `<video>` tag support, and without canvas 2D features? In general, I'd like to write apps with HTML technology, but when I ship them as standalone apps I'd like for the build to be minimal, only including the features that I use. Is there some way to achieve this?
,
Jul 28 2017
,
Jul 28 2017
It would be great for Electron apps: https://github.com/electron/electron/issues/4961
,
Jul 28 2017
,
Jul 28 2017
The bug tracker is not a place to post discussion questions like this, so I'm going to WontFix this. A better forum would be chromium-dev@chromium.org or chromium-discuss@chromium.org. To answer the question, though, certain subsystems have GN feature flags to disable them. E.g., extensions here (codesearch for buildflag): https://cs.chromium.org/chromium/src/extensions/features/features.gni. However not all features do, and many web platform features do not. We probably would not accept changes to disable selective web platform features because it would add code complexity, and such things would most likely break rather quickly since nothing in our continuous integration system would test them.
,
Jul 31 2017
Rather than being able to manually disable certain features, perhaps an automatic way to do it would be less complex for the code base. For example, imagine a way to run a Chromium application while a Chromium build tool observes and records which code paths are ever hit (the developer has to automate and execute all designed use cases within reason), then based on that recording the compiler can figure out which code paths to omit when compiling, without the code base having to have feature-enabling/disabling code. This may be done by compiling the code into a record state that can inject no-op function calls into every scope, where when code paths are executed the code path tree will be recorded (seems like DevTools already does something at least similar for JavaScript in the timeline viewer). Based on this info, it should be possible to compile with unused code paths removed. a DevOps team and a QA team (for example) could be in charge of doing this after an application developer writes an app. It might be powerful for embedded development, mobile apps, etc. It's just an idea. If it can be imagined, then it can be done!
,
Jul 31 2017
By > This may be done by compiling the code into a record state that can inject no-op function calls into every scope, I meant > This may be done by inject no-op function calls into every scope when compiling, so that the program has these extra no-op functions throughout every code path, ...
,
Jul 31 2017
Moving to the list as suggested. |
||||
►
Sign in to add a comment |
||||
Comment 1 by trusktr@gmail.com
, Jul 28 2017