brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.53k stars 2.27k forks source link

[Desktop] Fix deps in //brave/browser/extensions/* #10661

Open jumde opened 4 years ago

jumde commented 4 years ago
$ gn check . //brave/browser/extensions/*
ERROR at //brave/browser/extensions/api/brave_theme_api.cc:13:11: Include not allowed.
#include "brave/browser/themes/brave_dark_mode_utils.h"
          ^-------------------------------------------
It is not in any dependency of
  //brave/browser/extensions:extensions
The include file is in the target(s):
  //brave/browser/themes:themes
which should somehow be reachable.
___________________
ERROR at //brave/browser/extensions/api/brave_action_api.cc:20:11: Include not allowed.
#include "chrome/browser/profiles/profile.h"
          ^--------------------------------
It is not in any dependency of
  //brave/browser/extensions:extensions
The include file is in the target(s):
  //chrome/browser:browser
which should somehow be reachable.
___________________
ERROR at //brave/browser/extensions/api/brave_action_api.cc:21:11: Include not allowed.
#include "chrome/browser/ui/browser.h"
          ^--------------------------
sangwoo108 commented 5 months ago

Problematic includes

# "//brave/components/brave_wallet/common:mojom__generator", non visible
# "//brave/browser/ethereum_remote_client:browser",  circular deps
# "//brave/browser/ui", circular deps
sangwoo108 commented 5 months ago

chrome/browser/build.gn

    allow_circular_includes_from += [
      "//chrome/browser/apps/platform_apps",

      # TODO(https://crbug.com/883570): This is unfortunate, but not easy to
      # fix. Ideally, //chrome/browser:browser shouldn't depend on these APIs
      #(though the APIs likely will depend on //chrome/browser), but we need
      # to pull them in here to allow registration of keyed services.
      "//chrome/browser/apps/platform_apps/api",

      "//chrome/browser/extensions",

      # TODO(crbug.com/1200215): Remove cycles and simplify all dependencies.
      "//chrome/browser/web_applications/extensions",
    ]
    deps += [

chrome is allowing extension to have circular deps