build_do_not_depend_on_packed_resource_integrity.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 8e07f7000de932bc9b6bf484b1a9fce4d4580b4a..eac65b694c0a0857f73f75228b8d673bdfcd2b93 100644
  13. --- a/chrome/BUILD.gn
  14. +++ b/chrome/BUILD.gn
  15. @@ -172,11 +172,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 a7b5475c29acff9032ceb28f1237c4901559deba..db2b9ea0a08d6dc72afc67b305f628eb2ad67a38 100644
  34. --- a/chrome/browser/BUILD.gn
  35. +++ b/chrome/browser/BUILD.gn
  36. @@ -4277,7 +4277,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 d5f3e36ccf1aad7a88424befeed9d7be59cb4ad5..7a0809f33c376154720e204b1b0456bc59b341b7 100644
  45. --- a/chrome/test/BUILD.gn
  46. +++ b/chrome/test/BUILD.gn
  47. @@ -5025,10 +5025,15 @@ 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/win/conflicts:unit_tests",
  53. "//chrome/test:credential_provider_test_utils",
  54. ]
  55. +
  56. + if (!is_electron_build) {
  57. + deps += [
  58. + "//chrome:packed_resources_integrity",
  59. + ]
  60. + }
  61. }
  62. if (is_win || is_chromeos_ash || is_mac) {