build_do_not_depend_on_packed_resource_integrity.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Samuel Attard <[email protected]>
  3. Date: Thu, 27 May 2021 17:21:07 -0700
  4. Subject: build: do not depend on packed_resource_integrity
  5. This ensures we do not depend on a target that does not exist when
  6. building Electron, electron generates its own .pak files via
  7. electron_repack and therefore this integrity target which is generated
  8. by the chrome_paks target does not exist. This can not be upstreamed,
  9. if we ever align our .pak file generation with Chrome we can remove this
  10. patch.
  11. diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
  12. index 13cef63b5315eb1d8b188a0f5365b9af4ff1bf77..bd4906cb976effb8f3ded88f7af3a705b982f8f6 100644
  13. --- a/chrome/BUILD.gn
  14. +++ b/chrome/BUILD.gn
  15. @@ -196,11 +196,16 @@ if (!is_android && !is_mac) {
  16. "common/crash_keys.h",
  17. ]
  18. + if (!is_electron_build) {
  19. + deps = [
  20. + ":packed_resources_integrity_header",
  21. + ]
  22. + }
  23. +
  24. deps += [
  25. ":chrome_dll",
  26. ":chrome_exe_version",
  27. ":copy_first_run",
  28. - ":packed_resources_integrity_header",
  29. ":visual_elements_resources",
  30. "//base",
  31. "//build:branding_buildflags",
  32. diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
  33. index bb13698d59d014043f302f5fe577bece576ab9fa..dc43b438174be09430c51215b90fd0c8ed25f6b9 100644
  34. --- a/chrome/browser/BUILD.gn
  35. +++ b/chrome/browser/BUILD.gn
  36. @@ -4460,7 +4460,7 @@ static_library("browser") {
  37. ]
  38. }
  39. - if (!is_win) {
  40. + if (!is_win && !is_electron_build) {
  41. # On Windows, the hashes are embedded in //chrome:chrome_initial rather
  42. # than here in :chrome_dll.
  43. deps += [ "//chrome:packed_resources_integrity_header" ]
  44. diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
  45. index 50d2352dd2dae59eec718d889b0790e87b193d97..2b7585c0dd4a9ee86aaefde606ef814bc6bebecc 100644
  46. --- a/chrome/test/BUILD.gn
  47. +++ b/chrome/test/BUILD.gn
  48. @@ -7027,9 +7027,12 @@ test("unit_tests") {
  49. "//chrome/notification_helper",
  50. ]
  51. + if (!is_electron_build) {
  52. + deps += [ "//chrome:packed_resources_integrity_header" ]
  53. + }
  54. +
  55. deps += [
  56. "//chrome:other_version",
  57. - "//chrome:packed_resources_integrity_header",
  58. "//chrome//services/util_win:unit_tests",
  59. "//chrome/app:chrome_dll_resources",
  60. "//chrome/app:win_unit_tests",
  61. @@ -8051,6 +8054,10 @@ test("unit_tests") {
  62. "../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
  63. ]
  64. + if (!is_electron_build) {
  65. + deps += [ "//chrome:packed_resources_integrity_header" ]
  66. + }
  67. +
  68. sources += [
  69. # The importer code is not used on Android.
  70. "../common/importer/firefox_importer_utils_unittest.cc",
  71. @@ -8118,7 +8125,6 @@ test("unit_tests") {
  72. # Non-android deps for "unit_tests" target.
  73. deps += [
  74. "../browser/screen_ai:screen_ai_install_state",
  75. - "//chrome:packed_resources_integrity_header",
  76. "//chrome/browser/apps:icon_standardizer",
  77. "//chrome/browser/apps/app_service",
  78. "//chrome/browser/apps/app_service:app_registry_cache_waiter",