New issue
Advanced search Search tips

Issue 641155 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug



Sign in to add a comment

Split enable_extensions into enable_extensions and enable_apps.

Project Member Reported by st...@chromium.org, Aug 25 2016

Issue description

Currently turning on the enable_extensions GN flag will build all extensions and apps APIs. We want to selectively build only extension APIs and apps APIs.

Internally this means that we should re-organize our sources. Currently we have an extension_browser_sources and its platform specific variants.

This needs to be split into,
. extensions_browser_sources: This will contain all the sources needed by the extensions system that are compiled into the Chrome browser.
. extensions_api_sources: This will have all the sources for the extensions API. 
. apps_api_sources: This will have all the sources for the extensions API that have been extracted to //extensions.
. apps_api_browser_sources: This will have all the sources for the extensions API that are still in //chrome/browser/extensions.

In the Browser build, if either enable_extensions or enable_apps is specified, we'll include extensions_browser_sources. If enable_extensions is specified, we'll include extensions_api_sources. If enable_apps is specified, we'll also include both the apps sources.

AppShell will be built with the apps_api_sources always.


Note: Currently very few extensions only APIs exist in //extensions; most of the APIs there are apps APIs. This may change in the future and we don't want to continue to build with APIs that are extensions only in AppShell.

 
> apps_api_browser_sources: This will have all the sources for the extensions API that are still in //chrome/browser/extensions.

How is this different from extensions_api_sources, from the description?

Also, many apis are available to both extensions and apps - will we have a "common" target?

> Note: Currently very few extensions only APIs exist in //extensions; most of the APIs there are apps APIs. This may change in the future and we don't want to continue to build with APIs that are extensions only in AppShell.

I'm not sure this is true, largely because of the common apis.

Comment 2 by st...@chromium.org, Aug 31 2016

Re: common, I was thinking of just putting them in a target called "api_sources/api_browser_sources", with the extesions_ and apps_ prefixes only being used for APIs specific.

So auditing the list of APIs in //extensions,
activity_log                    -       : (extension)
alarms                          -       : (both)
app_current_window_interna      -       : (both)
app_runtime                     -       : (both)
app_window                      -       : (app)
audio                           -       : (app)
bluetooth                       -       : (app)
bluetooth_socket                -       : (app)
cast_channel                    -       : (both)
clipboard                       -       : (app)
declarative                     -       : (extension)
declarative_content             -       : (extension)
declarative_webrequest          -       : (extension)
diagnostics                     -       : (app)
display_source                  -       : (both)
dns                             -       : (both)
document_scan                   -       : (both)
guest_view                      -       : (extension)
hid                             -       : (both)
idle                            -       : (both)
management                      -       : (both)
messaging                       -       : (???)
mime_handler_private            -       : (both)
networking_config               -       : (both)
networking_private              -       : (both)
power                           -       : (both)
printer_provider                -       : (both)
printer_provider_internal       -       : (both)
runtime                         -       : (both)
serial                          -       : (app)
socket                          -       : (both)
sockets_tcp                     -       : (both)
sockets_tcp_server              -       : (both)
sockets_udp                     -       : (both)
storage                         -       : (both)
system_cpu                      -       : (both)
system_display                  -       : (both)
system_info                     -       : (both)
system_memory                   -       : (both)
system_network                  -       : (both)
system_storage                  -       : (both)
test                            -       : (???)
usb                             -       : (both)
virtual_keyboard_private        -       : (both)
vpn_provider                    -       : (both)
webcam_private                  -       : (both)
web_request                     -       : (extension)


It does seem an extraordinary number are for both. A lot of these APIs really don't seem like they should be though, but then fixing that is another task.

In the process of the conversion to .gn, I will keep the targets,

api_sources
api_browser_sources
extensions_api_sources
extensions_api_browser_sources
apps_api_sources
apps_api_browser_sources


I am not sure about the use of extensions_api_browser_sources but since we're refactoring this code anyway, we might as well get it clean and well bucketed.

I'd prefer we rename api_* to maybe common_api* or shared_api* or something to make it clear that it's used in both.

Also, what is browser_sources supposed to denote again?  From your original description:
> This will contain all the sources needed by the extensions system that are compiled into the Chrome browser.
That's everything. :)  Do you mean just those sources in chrome/browser/extensions?

I'd like to avoid conflating "chrome" and "browser", since "browser" has a specific meaning the context of browser vs renderer.  So if this is just to have the distinction between chrome and //extensions, maybe chrome_extensions_api_sources, etc?

Comment 4 by st...@chromium.org, Aug 31 2016

I do mean the sources in //chrome.
Both suggestions sgtm.

Project Member

Comment 5 by bugdroid1@chromium.org, Sep 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a932263a75195ad6cfe3e47dce49cc8845ded05e

commit a932263a75195ad6cfe3e47dce49cc8845ded05e
Author: steel <steel@chromium.org>
Date: Thu Sep 15 00:44:02 2016

Decompose //extensions/browser/BUILD.gn

This CL changes the extensions build to have BUILD.gn's in (almost) all
leaf directories. This accomplishes several things,

a.) Makes it very clear of what files belong to which component/API. For
example, to see which files exist in the audio API, one needs to parse
the massive single //extensions/browsers/BUILD.gn to find the main API
source list, then look if any of the exception conditions (is_chromeos,
is_linux, etc) also contain any of the audio API files. This is now all
in one //extensions/browser/api/audio/BUILD.gn, making it easier to parse
and understand the build of each component.

b.) It makes dependencies clearer. Currently we have no idea which
dependency in the huge dependency list in //extensions/browser/BUILD.gn is
needed by which API. With individual build files, we can now specify
dependencies for just the component that needs them. This CL tries to
do this but some dependencies are used by enough components that we've just
included them for all (//content/browser/public, //skia). This is not ideal
but at worst, it is still much better than the current build.

Since we're now moving APIs over from //chrome/browser/extensions over to
//extensions/browser, this becomes even more important. All APIs that get
moved over now can use this new format for their build files.

jamescook@, rockot@, xiyuan@ - FYI

R=rdevlin.cronin@chromium.org
BUG=641155

Review-Url: https://codereview.chromium.org/2336843002
Cr-Commit-Position: refs/heads/master@{#418729}

[modify] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/activity_log/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/alarms/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/app_current_window_internal/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/app_runtime/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/app_window/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/audio/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/bluetooth/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/bluetooth_socket/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/cast_channel/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/clipboard/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/declarative/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/declarative_content/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/declarative_webrequest/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/diagnostics/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/display_source/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/dns/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/document_scan/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/guest_view/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/guest_view/app_view/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/guest_view/extension_view/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/guest_view/web_view/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/hid/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/idle/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/management/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/messaging/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/mime_handler_private/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/networking_config/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/networking_private/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/power/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/printer_provider/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/printer_provider_internal/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/runtime/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/serial/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/socket/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/sockets_tcp/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/sockets_tcp_server/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/sockets_udp/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/storage/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/system_cpu/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/system_display/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/system_info/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/system_memory/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/system_network/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/system_storage/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/test/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/usb/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/virtual_keyboard_private/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/vpn_provider/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/web_request/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/api/webcam_private/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/app_window/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/guest_view/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/guest_view/app_view/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/guest_view/extension_options/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/guest_view/extension_view/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/guest_view/extension_view/whitelist/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/guest_view/mime_handler_view/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/guest_view/web_view/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/guest_view/web_view/web_ui/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/install/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/mojo/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/updater/BUILD.gn
[add] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/browser/value_store/BUILD.gn
[modify] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/common/BUILD.gn
[modify] https://crrev.com/a932263a75195ad6cfe3e47dce49cc8845ded05e/extensions/renderer/BUILD.gn

Comment 6 by st...@chromium.org, Dec 6 2016

Owner: michae...@chromium.org
This may be obsolete. Assigning to Michael to triage.

Comment 7 by r...@chromium.org, Mar 3 2017

Cc: r...@chromium.org
Labels: -M-55
not obsolete; enable_apps will be a useful switch for building chrome without apps
Cc: -asargent@chromium.org
Owner: benwells@chromium.org
to benwells to determine if this is still useful
benwells@: I'd still like this (for building chrome without apps), so feel free to assign to me if you like.
Owner: devlin@chromium.org
Enjoy!
Cc: -roc...@chromium.org rockot@google.com

Sign in to add a comment