depot_tools.patch 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Changes to gclient that:
  2. # move dotfiles into the staging directory
  3. # skip cipd binary downloads
  4. # skip gcs downloads unless its an allowed sysroot
  5. # replace 'src' in checkout paths with the output directory
  6. # add flag to specify an allowed sysroot
  7. # ensure shallow fetches
  8. # utilize a newer version of gsutil to support later versions of python
  9. --- a/gclient.py
  10. +++ b/gclient.py
  11. @@ -126,8 +126,8 @@ DEPOT_TOOLS_DIR = os.path.dirname(os.pat
  12. # one, e.g. if a spec explicitly says `cache_dir = None`.)
  13. UNSET_CACHE_DIR = object()
  14. -PREVIOUS_CUSTOM_VARS_FILE = '.gclient_previous_custom_vars'
  15. -PREVIOUS_SYNC_COMMITS_FILE = '.gclient_previous_sync_commits'
  16. +PREVIOUS_CUSTOM_VARS_FILE = r'UC_STAGING'+os.sep+'.gclient_previous_custom_vars'
  17. +PREVIOUS_SYNC_COMMITS_FILE = r'UC_STAGING'+os.sep+'.gclient_previous_sync_commits'
  18. PREVIOUS_SYNC_COMMITS = 'GCLIENT_PREVIOUS_SYNC_COMMITS'
  19. @@ -424,6 +424,7 @@ class Dependency(gclient_utils.WorkItem,
  20. protocol='https',
  21. git_dependencies_state=gclient_eval.DEPS,
  22. print_outbuf=False):
  23. + if name and name[0:3] == "src": name = r"UC_OUT"+name[3:]
  24. gclient_utils.WorkItem.__init__(self, name)
  25. DependencySettings.__init__(self, parent, url, managed, custom_deps,
  26. custom_vars, custom_hooks, deps_file,
  27. @@ -769,6 +770,7 @@ class Dependency(gclient_utils.WorkItem,
  28. condition = dep_value.get('condition')
  29. dep_type = dep_value.get('dep_type')
  30. + if dep_type == 'cipd': continue
  31. if not self._get_option('process_all_deps', False):
  32. should_process = should_process and _should_process(condition)
  33. @@ -820,6 +822,12 @@ class Dependency(gclient_utils.WorkItem,
  34. should_process_object = should_process and _should_process(
  35. merged_condition)
  36. + if name != "src/third_party/node/node_modules" and \
  37. + (not name.startswith("src/build/linux/") or \
  38. + not f"{self._get_option('sysroot', 'None')}-sysroot" in name):
  39. + continue
  40. + should_process_object = True
  41. + merged_condition = 'True'
  42. gcs_deps.append(
  43. GcsDependency(parent=self,
  44. name=name,
  45. @@ -931,6 +939,8 @@ class Dependency(gclient_utils.WorkItem,
  46. self._gn_args_from = local_scope.get('gclient_gn_args_from')
  47. self._gn_args_file = local_scope.get('gclient_gn_args_file')
  48. + if self._gn_args_file and self._gn_args_file[0:3] == "src":
  49. + self._gn_args_file = r"UC_OUT"+self._gn_args_file[3:]
  50. self._gn_args = local_scope.get('gclient_gn_args', [])
  51. # It doesn't make sense to set all of these, since setting gn_args_from
  52. # to another DEPS will make gclient ignore any other local gn_args*
  53. @@ -3935,6 +3945,7 @@ def CMDsync(parser, args):
  54. dest='experiments',
  55. default=[],
  56. help='Which experiments should be enabled.')
  57. + parser.add_option('--sysroot')
  58. (options, args) = parser.parse_args(args)
  59. client = GClient.LoadCurrentConfig(options)
  60. --- a/gclient_scm.py
  61. +++ b/gclient_scm.py
  62. @@ -925,8 +925,7 @@ class GitWrapper(SCMWrapper):
  63. self._SetFetchConfig(options)
  64. # Fetch upstream if we don't already have |revision|.
  65. - if not scm.GIT.IsValidRevision(
  66. - self.checkout_path, revision, sha_only=True):
  67. + if False:
  68. self._Fetch(options, prune=options.force)
  69. if not scm.GIT.IsValidRevision(
  70. @@ -942,7 +941,7 @@ class GitWrapper(SCMWrapper):
  71. # This is a big hammer, debatable if it should even be here...
  72. if options.force or options.reset:
  73. - target = 'HEAD'
  74. + target = 'FETCH_HEAD'
  75. if options.upstream and upstream_branch:
  76. target = upstream_branch
  77. self._Scrub(target, options)
  78. @@ -957,7 +956,6 @@ class GitWrapper(SCMWrapper):
  79. # to the checkout step.
  80. if not (options.force or options.reset):
  81. self._CheckClean(revision)
  82. - self._CheckDetachedHead(revision, options)
  83. if not current_revision:
  84. current_revision = self._Capture(
  85. @@ -1637,8 +1635,7 @@ class GitWrapper(SCMWrapper):
  86. fetch_cmd.append('--no-tags')
  87. elif quiet:
  88. fetch_cmd.append('--quiet')
  89. - if depth:
  90. - fetch_cmd.append('--depth=' + str(depth))
  91. + fetch_cmd.append('--depth=1')
  92. self._Run(fetch_cmd, options, show_header=options.verbose, retry=True)
  93. def _SetFetchConfig(self, options):
  94. --- a/gsutil.py
  95. +++ b/gsutil.py
  96. @@ -25,7 +25,7 @@ DEFAULT_BIN_DIR = os.path.join(THIS_DIR,
  97. IS_WINDOWS = os.name == 'nt'
  98. -VERSION = '4.68'
  99. +VERSION = '5.28'
  100. # Google OAuth Context required by gsutil.
  101. LUCI_AUTH_SCOPES = [