Fix GN dependencies in //brave/utility
We had made services.cc depend on //brave/utility via a chromium_src override, but that caused a dependency cycle because //brave/utility also depends on //chrome/utility (e.g. extend some upstream classes), causing a gn check error. To fix this, we can follow the pattern used in other places and make upstream's //chrome/utility directly include the files from Brave that it needs, and replace the oneliner patch to //chrome/utility/BUILD.gn with one that would simply include those sources, instead of having it depend on //brave/utility. Last, we also add a missing dep on //brave/common/importer:importer to avoid another gn check failure due to having some files from that target included from brave_external_process_importer_bridge.h. Resolves https://github.com/brave/brave-browser/issues/10623
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
static_library("lib") {
|
static_library("lib") {
|
||||||
visibility = [
|
visibility = [
|
||||||
"//brave/utility:*",
|
|
||||||
"//brave/test:*",
|
"//brave/test:*",
|
||||||
|
"//chrome/utility:*",
|
||||||
]
|
]
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
static_library("lib") {
|
static_library("lib") {
|
||||||
visibility = [
|
visibility = [
|
||||||
"//brave/utility:*",
|
|
||||||
"//brave/test:*",
|
"//brave/test:*",
|
||||||
|
"//chrome/utility:*",
|
||||||
]
|
]
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
source_set("tor") {
|
source_set("tor") {
|
||||||
visibility = [
|
visibility = [
|
||||||
"//brave/utility:*",
|
"//brave/test:*",
|
||||||
"//brave/test:*"
|
"//chrome/utility:*",
|
||||||
]
|
]
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn
|
diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn
|
||||||
index 3c1c93059d71ce27125a67d49624cdadaf3078c8..0ea1995b1ef4b804c2be07556dad744895306556 100644
|
index 3c1c93059d71ce27125a67d49624cdadaf3078c8..5b74db962a57545280bbeffda999b2723f2d4922 100644
|
||||||
--- a/chrome/utility/BUILD.gn
|
--- a/chrome/utility/BUILD.gn
|
||||||
+++ b/chrome/utility/BUILD.gn
|
+++ b/chrome/utility/BUILD.gn
|
||||||
@@ -29,6 +29,7 @@ static_library("utility") {
|
@@ -66,6 +66,8 @@ static_library("utility") {
|
||||||
|
"//ui/base:buildflags",
|
||||||
|
]
|
||||||
|
|
||||||
public_deps = []
|
+ import("//brave/utility/sources.gni") sources += brave_utility_sources deps += brave_utility_deps public_deps += brave_utility_public_deps
|
||||||
deps = [
|
+
|
||||||
+ "//brave/utility",
|
if (is_win) {
|
||||||
"//base",
|
deps += [
|
||||||
"//build:chromeos_buildflags",
|
"//components/services/quarantine",
|
||||||
"//chrome:resources",
|
|
||||||
|
|||||||
+5
-60
@@ -1,61 +1,6 @@
|
|||||||
import("//brave/components/brave_ads/browser/buildflags/buildflags.gni")
|
# Group depending on upstream's counterpart to make it easier to manage
|
||||||
import("//brave/components/brave_rewards/browser/buildflags/buildflags.gni")
|
# dependencies in brave/ (//chrome/utility does not depend on //brave/utility,
|
||||||
import("//brave/components/ipfs/buildflags/buildflags.gni")
|
# so //brave/utility becomes essentially an alias for //chrome/utility now).
|
||||||
import("//brave/components/tor/buildflags/buildflags.gni")
|
group("utility") {
|
||||||
import("//build/config/features.gni")
|
public_deps = [ "//chrome/utility" ]
|
||||||
import("//build/config/ui.gni")
|
|
||||||
|
|
||||||
source_set("utility") {
|
|
||||||
# Remove when https://github.com/brave/brave-browser/issues/10623 is resolved
|
|
||||||
check_includes = false
|
|
||||||
visibility = [
|
|
||||||
"//chrome/utility/*",
|
|
||||||
"//brave/utility/*",
|
|
||||||
"//brave:child_dependencies",
|
|
||||||
"//brave/test:*"
|
|
||||||
]
|
|
||||||
|
|
||||||
sources = [
|
|
||||||
"brave_content_utility_client.cc",
|
|
||||||
"brave_content_utility_client.h",
|
|
||||||
]
|
|
||||||
|
|
||||||
deps = []
|
|
||||||
public_deps = []
|
|
||||||
|
|
||||||
if (!is_android) {
|
|
||||||
sources += [
|
|
||||||
"importer/brave_external_process_importer_bridge.cc",
|
|
||||||
"importer/brave_external_process_importer_bridge.h",
|
|
||||||
"importer/brave_profile_import_impl.cc",
|
|
||||||
"importer/brave_profile_import_impl.h",
|
|
||||||
"importer/chrome_importer.cc",
|
|
||||||
"importer/chrome_importer.h",
|
|
||||||
]
|
|
||||||
|
|
||||||
deps += [
|
|
||||||
"//base",
|
|
||||||
"//brave/common/importer:interfaces",
|
|
||||||
"//chrome/app:chromium_strings",
|
|
||||||
"//components/os_crypt",
|
|
||||||
"//components/password_manager/core/browser",
|
|
||||||
"//components/webdata/common",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (enable_tor) {
|
|
||||||
deps += [ "//brave/components/services/tor" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ipfs_enabled) {
|
|
||||||
deps += [ "//brave/components/services/ipfs" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (brave_ads_enabled) {
|
|
||||||
public_deps += [ "//brave/components/services/bat_ads:lib" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (brave_rewards_enabled) {
|
|
||||||
public_deps += [ "//brave/components/services/bat_ledger:lib" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
include_rules = [
|
include_rules = [
|
||||||
|
"+brave/common/importer",
|
||||||
"+components/favicon_base",
|
"+components/favicon_base",
|
||||||
"+components/os_crypt",
|
"+components/os_crypt",
|
||||||
"+components/password_manager/core/browser",
|
"+components/password_manager/core/browser",
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import("//brave/components/brave_ads/browser/buildflags/buildflags.gni")
|
||||||
|
import("//brave/components/brave_rewards/browser/buildflags/buildflags.gni")
|
||||||
|
import("//brave/components/ipfs/buildflags/buildflags.gni")
|
||||||
|
import("//brave/components/tor/buildflags/buildflags.gni")
|
||||||
|
|
||||||
|
brave_utility_importer_sources = []
|
||||||
|
brave_utility_importer_deps = []
|
||||||
|
brave_utility_importer_public_deps = []
|
||||||
|
|
||||||
|
if (!is_android) {
|
||||||
|
brave_utility_importer_sources += [
|
||||||
|
"//brave/utility/importer/brave_external_process_importer_bridge.cc",
|
||||||
|
"//brave/utility/importer/brave_external_process_importer_bridge.h",
|
||||||
|
"//brave/utility/importer/brave_profile_import_impl.cc",
|
||||||
|
"//brave/utility/importer/brave_profile_import_impl.h",
|
||||||
|
"//brave/utility/importer/chrome_importer.cc",
|
||||||
|
"//brave/utility/importer/chrome_importer.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
brave_utility_importer_deps += [
|
||||||
|
"//base",
|
||||||
|
"//brave/common/importer:importer",
|
||||||
|
"//brave/common/importer:interfaces",
|
||||||
|
"//chrome/app:chromium_strings",
|
||||||
|
"//components/os_crypt",
|
||||||
|
"//components/password_manager/core/browser",
|
||||||
|
"//components/webdata/common",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enable_tor) {
|
||||||
|
brave_utility_importer_deps += [ "//brave/components/services/tor" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ipfs_enabled) {
|
||||||
|
brave_utility_importer_deps += [ "//brave/components/services/ipfs" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (brave_ads_enabled) {
|
||||||
|
brave_utility_importer_public_deps +=
|
||||||
|
[ "//brave/components/services/bat_ads:lib" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (brave_rewards_enabled) {
|
||||||
|
brave_utility_importer_public_deps +=
|
||||||
|
[ "//brave/components/services/bat_ledger:lib" ]
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import("//brave/utility/importer/sources.gni")
|
||||||
|
|
||||||
|
brave_utility_sources = [
|
||||||
|
"//brave/utility/brave_content_utility_client.cc",
|
||||||
|
"//brave/utility/brave_content_utility_client.h",
|
||||||
|
]
|
||||||
|
brave_utility_sources += brave_utility_importer_sources
|
||||||
|
|
||||||
|
brave_utility_deps = []
|
||||||
|
brave_utility_deps += brave_utility_importer_deps
|
||||||
|
|
||||||
|
brave_utility_public_deps = []
|
||||||
|
brave_utility_public_deps += brave_utility_importer_public_deps
|
||||||
Reference in New Issue
Block a user