Fix Windows build when enable_brave_vpn is false and create_dist (#33372)

* Fix Windows build when enable_brave_vpn is false

When VPN is disabled (e.g. Origin builds), copy chrome's resource
allowlist instead of trying to merge with wireguard resources.

* create_dist Origin fixes
This commit is contained in:
Brian R. Bondy
2026-01-23 10:29:27 -05:00
committed by GitHub
parent d1917db4a9
commit 139d44583b
4 changed files with 54 additions and 36 deletions
+27 -17
View File
@@ -767,24 +767,34 @@ if (is_redirect_cc_build) {
}
if (is_win && enable_resource_allowlist_generation) {
# Merge chrome_resource_allowlist and wireguard resources allowlist to keep
# wireguard resources in pak files.
action("merge_allowlists") {
deps = [
"//brave/browser/brave_vpn/win/brave_vpn_wireguard_service:wireguard_resource_allowlist",
"//chrome:resource_allowlist",
]
# wireguard resources in pak files. When VPN is disabled, just copy the chrome
# allowlist.
if (enable_brave_vpn) {
action("merge_allowlists") {
deps = [
"//brave/browser/brave_vpn/win/brave_vpn_wireguard_service:wireguard_resource_allowlist",
"//chrome:resource_allowlist",
]
script = "//brave//resources/brave_allowlist.py"
source_allowlist = "$root_gen_dir/chrome/chrome_resource_allowlist.txt"
args = [
"--repack_allowlist",
rebase_path(source_allowlist, root_build_dir),
"--brave_allowlist",
rebase_path(wireguard_resource_allowlist_file, root_build_dir),
"--output",
rebase_path(brave_allowlist_file, root_build_dir),
]
script = "//brave//resources/brave_allowlist.py"
source_allowlist = "$root_gen_dir/chrome/chrome_resource_allowlist.txt"
args = [
"--repack_allowlist",
rebase_path(source_allowlist, root_build_dir),
"--brave_allowlist",
rebase_path(wireguard_resource_allowlist_file, root_build_dir),
"--output",
rebase_path(brave_allowlist_file, root_build_dir),
]
outputs = [ brave_allowlist_file ]
outputs = [ brave_allowlist_file ]
}
} else {
# When VPN is disabled, just copy the chrome resource allowlist.
copy("merge_allowlists") {
deps = [ "//chrome:resource_allowlist" ]
sources = [ "$root_gen_dir/chrome/chrome_resource_allowlist.txt" ]
outputs = [ brave_allowlist_file ]
}
}
}
+19 -19
View File
@@ -164,26 +164,26 @@ exports.update = () => {
path.join(braveAppVectorIconsDir, 'vector_icons', branding),
path.join(chromeComponentsDir, 'vector_icons', branding),
])
}
// Copy to make our ${branding_path_product}_behaviors.cc
fileMap.add([
path.join(
config.braveCoreDir,
'chromium_src',
'chrome',
'installer',
'setup',
'brave_behaviors.cc',
),
path.join(
config.srcDir,
'chrome',
'installer',
'setup',
'brave_behaviors.cc',
),
])
// Copy to make our ${branding_path_product}_behaviors.cc
fileMap.add([
path.join(
config.braveCoreDir,
'chromium_src',
'chrome',
'installer',
'setup',
`${branding}_behaviors.cc`,
),
path.join(
config.srcDir,
'chrome',
'installer',
'setup',
`${branding}_behaviors.cc`,
),
])
}
// Replace webui CSS to use our fonts.
fileMap.add([
path.join(
@@ -29,6 +29,7 @@
"chrome/common/chrome_constants_unittest_mac.cc",
"chrome/installer/mini_installer/brave_mini_installer_unittest.cc",
"chrome/installer/setup/brave_behaviors.cc",
"chrome/installer/setup/brave_origin_behaviors.cc",
"chrome/installer/setup/test/install_worker_vpn_unittest.cc",
"chrome/install_static/brave_install_details_unittest.cc",
"chrome/install_static/brave_install_modes_unittest.cc",
@@ -0,0 +1,7 @@
/* Copyright (c) 2026 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
// Brave Origin uses the same installer behaviors as Brave.
#include "brave_behaviors.cc"