build_do_not_depend_on_packed_resource_integrity.patch 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 41ce32113ec2679b76d5a4fd69a7109c832ac7a1..1cd35794bf78f3d92b42634d9494c85a98e93ea6 100644
  13. --- a/chrome/BUILD.gn
  14. +++ b/chrome/BUILD.gn
  15. @@ -199,11 +199,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 5cce9134fabf566ec968d5738242b3dc13f2f54c..0e8ca7b1762571f57372a937630004252f396ae7 100644
  34. --- a/chrome/browser/BUILD.gn
  35. +++ b/chrome/browser/BUILD.gn
  36. @@ -4723,7 +4723,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. sources += [ "certificate_viewer_stub.cc" ]
  43. }
  44. diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
  45. index 513932b71a19d8f0a8196faf2ef14c2a7a996229..0b16b410606d2dcb8f8013755f079a209c8ba3a4 100644
  46. --- a/chrome/test/BUILD.gn
  47. +++ b/chrome/test/BUILD.gn
  48. @@ -6833,7 +6833,6 @@ test("unit_tests") {
  49. deps += [
  50. "//chrome:other_version",
  51. - "//chrome:packed_resources_integrity",
  52. "//chrome//services/util_win:unit_tests",
  53. "//chrome/app:chrome_dll_resources",
  54. "//chrome/app:win_unit_tests",
  55. @@ -6859,6 +6858,10 @@ test("unit_tests") {
  56. "//ui/resources",
  57. ]
  58. + if (!is_electron_build) {
  59. + deps += [ "//chrome:packed_resources_integrity" ]
  60. + }
  61. +
  62. ldflags = [
  63. "/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
  64. "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
  65. @@ -7826,7 +7829,6 @@ test("unit_tests") {
  66. }
  67. deps += [
  68. - "//chrome:packed_resources_integrity_hash",
  69. "//chrome/browser/apps:icon_standardizer",
  70. "//chrome/browser/apps/app_service",
  71. "//chrome/browser/apps/app_service:app_registry_cache_waiter",
  72. @@ -7913,6 +7915,10 @@ test("unit_tests") {
  73. "//ui/webui/resources/js/browser_command:mojo_bindings",
  74. ]
  75. + if (!is_electron_build) {
  76. + deps += [ "//chrome:packed_resources_integrity_hash" ]
  77. + }
  78. +
  79. data += [ "//ash/components/arc/test/data/icons/" ]
  80. if (include_js2gtest_tests) {