build_do_not_depend_on_packed_resource_integrity.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 e7dda63b94aebaf45cf25af0bc101698d44fc44b..feb624f77466de6bf1ea398dc8274231dac432fa 100644
  13. --- a/chrome/BUILD.gn
  14. +++ b/chrome/BUILD.gn
  15. @@ -164,11 +164,16 @@ if (!is_android && !is_mac) {
  16. "common/crash_keys.h",
  17. ]
  18. + if (!is_electron_build) {
  19. + deps += [
  20. + ":packed_resources_integrity",
  21. + ]
  22. + }
  23. +
  24. deps += [
  25. ":chrome_dll",
  26. ":chrome_exe_version",
  27. ":copy_first_run",
  28. - ":packed_resources_integrity",
  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 17e03f58263b5254cec991386536286de3b41600..65fdfcec6894249996fa12b9471362475620cfd7 100644
  34. --- a/chrome/browser/BUILD.gn
  35. +++ b/chrome/browser/BUILD.gn
  36. @@ -4306,7 +4306,7 @@ static_library("browser") {
  37. # On Windows, the hashes are embedded in //chrome:chrome_initial rather
  38. # than here in :chrome_dll.
  39. - if (!is_win) {
  40. + if (!is_win && !is_electron_build) {
  41. deps += [ "//chrome:packed_resources_integrity" ]
  42. }
  43. diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
  44. index 1625f8917ac257f11f4637ea60eca586ec2492a3..dc0f43e955994fba9dc597c08133a4438ebf1c45 100644
  45. --- a/chrome/test/BUILD.gn
  46. +++ b/chrome/test/BUILD.gn
  47. @@ -5281,7 +5281,6 @@ test("unit_tests") {
  48. assert(toolkit_views)
  49. sources += [ "../browser/ui/startup/credential_provider_signin_info_fetcher_win_unittest.cc" ]
  50. deps += [
  51. - "//chrome:packed_resources_integrity",
  52. "//chrome/browser:chrome_process_finder",
  53. "//chrome/browser/safe_browsing/chrome_cleaner",
  54. "//chrome/browser/safe_browsing/chrome_cleaner:public",
  55. @@ -5294,6 +5293,12 @@ test("unit_tests") {
  56. "//components/chrome_cleaner/public/proto",
  57. "//ui/events/devices:test_support",
  58. ]
  59. +
  60. + if (!is_electron_build) {
  61. + deps += [
  62. + "//chrome:packed_resources_integrity",
  63. + ]
  64. + }
  65. }
  66. if (is_win || is_chromeos_ash || is_mac) {
  67. @@ -5858,7 +5863,6 @@ test("unit_tests") {
  68. }
  69. deps += [
  70. - "//chrome:packed_resources_integrity_hash",
  71. "//chrome/browser:cart_db_content_proto",
  72. "//chrome/browser/media/router:test_support",
  73. "//chrome/browser/promo_browser_command:mojo_bindings",
  74. @@ -5893,6 +5897,9 @@ test("unit_tests") {
  75. "//ui/color:test_support",
  76. "//ui/native_theme:test_support",
  77. ]
  78. + if (!is_electron_build) {
  79. + deps += [ "//chrome:packed_resources_integrity_hash" ]
  80. + }
  81. if (is_win) {
  82. deps += [ "//components/chrome_cleaner/public/proto:test_only_proto" ]
  83. }