libv8 5.3.332.38.5 → 5.6.326.50.0beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (352) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +0 -1
  3. data/CHANGELOG.md +2 -0
  4. data/ext/libv8/builder.rb +2 -2
  5. data/lib/libv8/version.rb +1 -1
  6. data/patches/0001-Build-a-standalone-static-library.patch +4 -4
  7. data/patches/0002-Don-t-compile-unnecessary-stuff.patch +16 -11
  8. data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +4 -4
  9. data/patches/{0005-Do-not-embed-debug-symbols-in-macOS-libraries.patch → 0004-Do-not-embed-debug-symbols-in-macOS-libraries.patch} +4 -4
  10. data/vendor/depot_tools/.gitignore +4 -0
  11. data/vendor/depot_tools/OWNERS +0 -2
  12. data/vendor/depot_tools/PRESUBMIT.py +20 -23
  13. data/vendor/depot_tools/README.gclient.md +3 -3
  14. data/vendor/depot_tools/README.git-cl.md +13 -12
  15. data/vendor/depot_tools/README.md +2 -3
  16. data/vendor/depot_tools/WATCHLISTS +0 -1
  17. data/vendor/depot_tools/appengine_mapper.py +23 -0
  18. data/vendor/depot_tools/apply_issue.py +2 -8
  19. data/vendor/depot_tools/bootstrap/win/README.md +1 -8
  20. data/vendor/depot_tools/bootstrap/win/git_bootstrap.py +6 -16
  21. data/vendor/depot_tools/bootstrap/win/git_version.txt +1 -1
  22. data/vendor/depot_tools/bootstrap/win/git_version_bleeding_edge.txt +1 -1
  23. data/vendor/depot_tools/checkout.py +20 -433
  24. data/vendor/depot_tools/cipd +73 -0
  25. data/vendor/depot_tools/cipd.bat +12 -0
  26. data/vendor/depot_tools/cipd.ps1 +57 -0
  27. data/vendor/depot_tools/cipd_client_version +1 -0
  28. data/vendor/depot_tools/clang_format.py +9 -6
  29. data/vendor/depot_tools/clang_format_merge_driver +8 -0
  30. data/vendor/depot_tools/clang_format_merge_driver.bat +11 -0
  31. data/vendor/depot_tools/clang_format_merge_driver.py +67 -0
  32. data/vendor/depot_tools/codereview.settings +3 -2
  33. data/vendor/depot_tools/commit_queue.py +1 -1
  34. data/vendor/depot_tools/cpplint.py +2 -0
  35. data/vendor/depot_tools/fetch.py +1 -54
  36. data/vendor/depot_tools/fetch_configs/android.py +2 -2
  37. data/vendor/depot_tools/fetch_configs/breakpad.py +2 -3
  38. data/vendor/depot_tools/fetch_configs/chromium.py +2 -3
  39. data/vendor/depot_tools/fetch_configs/crashpad.py +2 -2
  40. data/vendor/depot_tools/fetch_configs/dart.py +2 -3
  41. data/vendor/depot_tools/fetch_configs/dartino.py +2 -3
  42. data/vendor/depot_tools/fetch_configs/dartium.py +2 -3
  43. data/vendor/depot_tools/fetch_configs/depot_tools.py +3 -6
  44. data/vendor/depot_tools/fetch_configs/gyp.py +2 -3
  45. data/vendor/depot_tools/fetch_configs/infra.py +2 -2
  46. data/vendor/depot_tools/fetch_configs/infra_internal.py +2 -2
  47. data/vendor/depot_tools/fetch_configs/ios.py +2 -2
  48. data/vendor/depot_tools/fetch_configs/ios_internal.py +2 -3
  49. data/vendor/depot_tools/fetch_configs/mojo.py +2 -3
  50. data/vendor/depot_tools/fetch_configs/nacl.py +2 -3
  51. data/vendor/depot_tools/fetch_configs/naclports.py +2 -3
  52. data/vendor/depot_tools/fetch_configs/pdfium.py +2 -2
  53. data/vendor/depot_tools/fetch_configs/skia.py +2 -2
  54. data/vendor/depot_tools/fetch_configs/skia_buildbot.py +2 -2
  55. data/vendor/depot_tools/fetch_configs/syzygy.py +2 -2
  56. data/vendor/depot_tools/fetch_configs/v8.py +2 -3
  57. data/vendor/depot_tools/fetch_configs/webrtc.py +5 -3
  58. data/vendor/depot_tools/fetch_configs/webrtc_android.py +2 -2
  59. data/vendor/depot_tools/fetch_configs/webrtc_ios.py +2 -2
  60. data/vendor/depot_tools/fix_encoding.py +6 -6
  61. data/vendor/depot_tools/gclient.py +136 -368
  62. data/vendor/depot_tools/gclient_scm.py +108 -647
  63. data/vendor/depot_tools/gclient_utils.py +22 -86
  64. data/vendor/depot_tools/gerrit_client.py +105 -0
  65. data/vendor/depot_tools/gerrit_util.py +174 -67
  66. data/vendor/depot_tools/git-crrev-parse +6 -7
  67. data/vendor/depot_tools/git-gs +1 -1
  68. data/vendor/depot_tools/git_cache.py +68 -18
  69. data/vendor/depot_tools/git_cherry_pick_upload.py +4 -4
  70. data/vendor/depot_tools/git_cl.py +1028 -961
  71. data/vendor/depot_tools/git_common.py +2 -3
  72. data/vendor/depot_tools/git_drover.py +0 -1
  73. data/vendor/depot_tools/git_footers.py +3 -43
  74. data/vendor/depot_tools/git_rebase_update.py +9 -1
  75. data/vendor/depot_tools/git_squash_branch.py +1 -1
  76. data/vendor/depot_tools/infra/config/cq.cfg +8 -1
  77. data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
  78. data/vendor/depot_tools/man/html/depot_tools.html +3 -11
  79. data/vendor/depot_tools/man/html/depot_tools_tutorial.html +9 -9
  80. data/vendor/depot_tools/man/html/git-cherry-pick-upload.html +2 -2
  81. data/vendor/depot_tools/man/html/git-drover.html +17 -17
  82. data/vendor/depot_tools/man/html/git-footers.html +2 -2
  83. data/vendor/depot_tools/man/html/git-freeze.html +4 -4
  84. data/vendor/depot_tools/man/html/git-hyper-blame.html +2 -2
  85. data/vendor/depot_tools/man/html/git-map-branches.html +2 -2
  86. data/vendor/depot_tools/man/html/git-map.html +2 -2
  87. data/vendor/depot_tools/man/html/git-mark-merge-base.html +2 -2
  88. data/vendor/depot_tools/man/html/git-nav-downstream.html +2 -2
  89. data/vendor/depot_tools/man/html/git-nav-upstream.html +2 -2
  90. data/vendor/depot_tools/man/html/git-new-branch.html +2 -2
  91. data/vendor/depot_tools/man/html/git-rebase-update.html +2 -2
  92. data/vendor/depot_tools/man/html/git-rename-branch.html +2 -2
  93. data/vendor/depot_tools/man/html/git-reparent-branch.html +2 -2
  94. data/vendor/depot_tools/man/html/git-retry.html +3 -3
  95. data/vendor/depot_tools/man/html/git-squash-branch.html +3 -3
  96. data/vendor/depot_tools/man/html/git-thaw.html +2 -2
  97. data/vendor/depot_tools/man/html/git-upstream-diff.html +3 -3
  98. data/vendor/depot_tools/man/man1/git-cherry-pick-upload.1 +4 -4
  99. data/vendor/depot_tools/man/man1/git-drover.1 +19 -19
  100. data/vendor/depot_tools/man/man1/git-footers.1 +4 -4
  101. data/vendor/depot_tools/man/man1/git-freeze.1 +6 -6
  102. data/vendor/depot_tools/man/man1/git-hyper-blame.1 +4 -4
  103. data/vendor/depot_tools/man/man1/git-map-branches.1 +4 -4
  104. data/vendor/depot_tools/man/man1/git-map.1 +4 -4
  105. data/vendor/depot_tools/man/man1/git-mark-merge-base.1 +4 -4
  106. data/vendor/depot_tools/man/man1/git-nav-downstream.1 +4 -4
  107. data/vendor/depot_tools/man/man1/git-nav-upstream.1 +4 -4
  108. data/vendor/depot_tools/man/man1/git-new-branch.1 +4 -4
  109. data/vendor/depot_tools/man/man1/git-rebase-update.1 +4 -4
  110. data/vendor/depot_tools/man/man1/git-rename-branch.1 +4 -4
  111. data/vendor/depot_tools/man/man1/git-reparent-branch.1 +4 -4
  112. data/vendor/depot_tools/man/man1/git-retry.1 +5 -5
  113. data/vendor/depot_tools/man/man1/git-squash-branch.1 +5 -5
  114. data/vendor/depot_tools/man/man1/git-thaw.1 +4 -4
  115. data/vendor/depot_tools/man/man1/git-upstream-diff.1 +5 -5
  116. data/vendor/depot_tools/man/man7/depot_tools.7 +5 -10
  117. data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +4 -4
  118. data/vendor/depot_tools/man/src/depot_tools.txt +1 -1
  119. data/vendor/depot_tools/man/src/depot_tools_tutorial.txt +7 -7
  120. data/vendor/depot_tools/man/src/filter_demo_output.py +2 -2
  121. data/vendor/depot_tools/man/src/git-footers.demo.1.sh +1 -1
  122. data/vendor/depot_tools/man/src/git-retry.txt +1 -1
  123. data/vendor/depot_tools/man/src/git-squash-branch.txt +2 -2
  124. data/vendor/depot_tools/man/src/git-upstream-diff.txt +1 -1
  125. data/vendor/depot_tools/my_activity.py +6 -3
  126. data/vendor/depot_tools/my_reviews.py +1 -1
  127. data/vendor/depot_tools/ninja +2 -2
  128. data/vendor/depot_tools/ninja-linux32 +0 -0
  129. data/vendor/depot_tools/ninja-linux64 +0 -0
  130. data/vendor/depot_tools/ninja-mac +0 -0
  131. data/vendor/depot_tools/ninja.exe +0 -0
  132. data/vendor/depot_tools/owners.py +14 -3
  133. data/vendor/depot_tools/presubmit_canned_checks.py +46 -67
  134. data/vendor/depot_tools/presubmit_support.py +109 -371
  135. data/vendor/depot_tools/pylintrc +83 -56
  136. data/vendor/depot_tools/recipe_modules/OWNERS +1 -0
  137. data/vendor/depot_tools/recipe_modules/bot_update/__init__.py +18 -9
  138. data/vendor/depot_tools/recipe_modules/bot_update/api.py +56 -55
  139. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic.json +3 -7
  140. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_output_manifest.json +3 -7
  141. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json +3 -7
  142. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/buildbot.json +52 -0
  143. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/clobber.json +19 -10
  144. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_rebase_patch_ref.json +19 -10
  145. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_reset.json +19 -10
  146. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/no_shallow.json +19 -10
  147. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json +19 -10
  148. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange.json +3 -7
  149. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2.json +2 -54
  150. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2_buildbot.json +56 -0
  151. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/{forced.json → trychange_oauth2_json.json} +6 -9
  152. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2_json_win.json +54 -0
  153. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob.json +9 -9
  154. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail.json +9 -9
  155. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +9 -9
  156. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json +9 -9
  157. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json +20 -10
  158. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle_deprecated.json +59 -0
  159. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8.json +9 -9
  160. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json +20 -10
  161. data/vendor/depot_tools/recipe_modules/bot_update/example.py +45 -63
  162. data/vendor/depot_tools/recipe_modules/bot_update/resources/bot_update.py +210 -807
  163. data/vendor/depot_tools/recipe_modules/bot_update/test_api.py +34 -45
  164. data/vendor/depot_tools/recipe_modules/cipd/api.py +59 -84
  165. data/vendor/depot_tools/recipe_modules/cipd/example.expected/basic.json +71 -117
  166. data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-failed.json +14 -60
  167. data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-many-instances.json +71 -117
  168. data/vendor/depot_tools/recipe_modules/cipd/example.expected/mac64.json +71 -117
  169. data/vendor/depot_tools/recipe_modules/cipd/example.expected/win64.json +71 -117
  170. data/vendor/depot_tools/recipe_modules/cipd/example.py +2 -12
  171. data/vendor/depot_tools/recipe_modules/cipd/test_api.py +0 -9
  172. data/vendor/depot_tools/recipe_modules/depot_tools/api.py +6 -0
  173. data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/basic.json +7 -0
  174. data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/win.json +7 -0
  175. data/vendor/depot_tools/recipe_modules/depot_tools/example.py +3 -0
  176. data/vendor/depot_tools/recipe_modules/gclient/__init__.py +4 -0
  177. data/vendor/depot_tools/recipe_modules/gclient/api.py +9 -22
  178. data/vendor/depot_tools/recipe_modules/gclient/config.py +18 -5
  179. data/vendor/depot_tools/recipe_modules/gclient/example.expected/basic.json +14 -14
  180. data/vendor/depot_tools/recipe_modules/gclient/example.expected/buildbot.json +211 -0
  181. data/vendor/depot_tools/recipe_modules/gclient/example.expected/revision.json +16 -14
  182. data/vendor/depot_tools/recipe_modules/gclient/example.expected/tryserver.json +16 -14
  183. data/vendor/depot_tools/recipe_modules/gclient/example.py +13 -11
  184. data/vendor/depot_tools/recipe_modules/gerrit/__init__.py +6 -0
  185. data/vendor/depot_tools/recipe_modules/gerrit/api.py +63 -0
  186. data/vendor/depot_tools/recipe_modules/gerrit/example.expected/basic.json +64 -0
  187. data/vendor/depot_tools/recipe_modules/gerrit/example.py +35 -0
  188. data/vendor/depot_tools/recipe_modules/gerrit/test_api.py +24 -0
  189. data/vendor/depot_tools/recipe_modules/git/__init__.py +4 -0
  190. data/vendor/depot_tools/recipe_modules/git/api.py +155 -142
  191. data/vendor/depot_tools/recipe_modules/git/example.expected/basic.json +43 -17
  192. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_branch.json +43 -17
  193. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_file_name.json +43 -17
  194. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_hash.json +43 -17
  195. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_ref.json +43 -17
  196. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_submodule_update_force.json +43 -17
  197. data/vendor/depot_tools/recipe_modules/git/example.expected/can_fail_build.json +13 -13
  198. data/vendor/depot_tools/recipe_modules/git/example.expected/cannot_fail_build.json +43 -17
  199. data/vendor/depot_tools/recipe_modules/git/example.expected/cat-file_test.json +45 -19
  200. data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_delta.json +45 -19
  201. data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_failed.json +43 -17
  202. data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output.json +43 -17
  203. data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output_fails_build.json +8 -8
  204. data/vendor/depot_tools/recipe_modules/git/example.expected/curl_trace_file.json +44 -18
  205. data/vendor/depot_tools/recipe_modules/git/example.expected/git-cache-checkout.json +48 -22
  206. data/vendor/depot_tools/recipe_modules/git/example.expected/platform_win.json +43 -17
  207. data/vendor/depot_tools/recipe_modules/git/example.expected/rebase_failed.json +42 -16
  208. data/vendor/depot_tools/recipe_modules/git/example.expected/remote_not_origin.json +43 -17
  209. data/vendor/depot_tools/recipe_modules/git/example.expected/set_got_revision.json +43 -17
  210. data/vendor/depot_tools/recipe_modules/git/example.py +9 -3
  211. data/vendor/depot_tools/recipe_modules/git_cl/__init__.py +4 -0
  212. data/vendor/depot_tools/recipe_modules/git_cl/api.py +8 -8
  213. data/vendor/depot_tools/recipe_modules/git_cl/example.py +1 -1
  214. data/vendor/depot_tools/recipe_modules/gsutil/__init__.py +4 -0
  215. data/vendor/depot_tools/recipe_modules/gsutil/api.py +196 -0
  216. data/vendor/depot_tools/recipe_modules/gsutil/example.expected/basic.json +186 -0
  217. data/vendor/depot_tools/recipe_modules/gsutil/example.py +77 -0
  218. data/vendor/depot_tools/recipe_modules/gsutil/resources/gsutil_smart_retry.py +69 -0
  219. data/vendor/depot_tools/recipe_modules/infra_paths/__init__.py +3 -0
  220. data/vendor/depot_tools/recipe_modules/infra_paths/api.py +20 -3
  221. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/basic.json +3 -1
  222. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json +3 -1
  223. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json +3 -1
  224. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json +3 -1
  225. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json +3 -1
  226. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json +3 -1
  227. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json +3 -1
  228. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_linux.json +3 -1
  229. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_mac.json +3 -1
  230. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_win.json +3 -1
  231. data/vendor/depot_tools/recipe_modules/infra_paths/example.py +6 -1
  232. data/vendor/depot_tools/recipe_modules/infra_paths/path_config.py +4 -6
  233. data/vendor/depot_tools/recipe_modules/rietveld/__init__.py +5 -0
  234. data/vendor/depot_tools/recipe_modules/rietveld/api.py +12 -9
  235. data/vendor/depot_tools/recipe_modules/rietveld/example.expected/basic.json +2 -24
  236. data/vendor/depot_tools/recipe_modules/rietveld/example.expected/buildbot.json +30 -0
  237. data/vendor/depot_tools/recipe_modules/rietveld/example.py +12 -6
  238. data/vendor/depot_tools/recipe_modules/tryserver/__init__.py +4 -0
  239. data/vendor/depot_tools/recipe_modules/tryserver/api.py +46 -70
  240. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/set_failure_hash_with_no_steps.json +8 -0
  241. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/{with_svn_patch.json → with_gerrit_patch.json} +1 -31
  242. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_gerrit_patch_deprecated.json +39 -0
  243. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch.json +2 -2
  244. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch_luci.json +8 -0
  245. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch.json +3 -3
  246. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch_new.json +3 -3
  247. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch.json +1 -1
  248. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch_new.json +1 -1
  249. data/vendor/depot_tools/recipe_modules/tryserver/example.py +35 -5
  250. data/vendor/depot_tools/recipes.py +52 -28
  251. data/vendor/depot_tools/repo +216 -69
  252. data/vendor/depot_tools/rietveld.py +20 -15
  253. data/vendor/depot_tools/roll_dep.py +1 -1
  254. data/vendor/depot_tools/scm.py +11 -826
  255. data/vendor/depot_tools/subprocess2.py +5 -5
  256. data/vendor/depot_tools/third_party/cq_client/README.depot_tools.md +2 -0
  257. data/vendor/depot_tools/third_party/cq_client/README.md +5 -1
  258. data/vendor/depot_tools/third_party/cq_client/cq.pb.go +183 -104
  259. data/vendor/depot_tools/third_party/cq_client/cq.proto +43 -27
  260. data/vendor/depot_tools/third_party/cq_client/cq_pb2.py +95 -29
  261. data/vendor/depot_tools/third_party/cq_client/testdata/cq_both.cfg +67 -0
  262. data/vendor/depot_tools/third_party/cq_client/testdata/cq_gerrit.cfg +1 -2
  263. data/vendor/depot_tools/third_party/cq_client/testdata/cq_rietveld.cfg +0 -3
  264. data/vendor/depot_tools/third_party/upload.py +44 -24
  265. data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +0 -5
  266. metadata +38 -93
  267. data/patches/0004-Reinterpret-thread-hash-for-FreeBSD-too.patch +0 -25
  268. data/vendor/depot_tools/git-auto-svn +0 -6
  269. data/vendor/depot_tools/git_auto_svn.py +0 -122
  270. data/vendor/depot_tools/man/html/git-auto-svn.html +0 -837
  271. data/vendor/depot_tools/man/man1/git-auto-svn.1 +0 -113
  272. data/vendor/depot_tools/man/src/_git-auto-svn_desc.helper.txt +0 -1
  273. data/vendor/depot_tools/man/src/git-auto-svn.txt +0 -69
  274. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/off.json +0 -43
  275. data/vendor/depot_tools/recipe_modules/cipd/example.expected/install-failed.json +0 -31
  276. data/vendor/depot_tools/recipe_modules/cipd/resources/bootstrap.py +0 -218
  277. data/vendor/depot_tools/recipe_modules/tryserver/test_api.py +0 -7
  278. data/vendor/depot_tools/third_party/gsutil/CHECKSUM +0 -1
  279. data/vendor/depot_tools/third_party/gsutil/COPYING +0 -202
  280. data/vendor/depot_tools/third_party/gsutil/LICENSE.third_party +0 -295
  281. data/vendor/depot_tools/third_party/gsutil/MANIFEST.in +0 -5
  282. data/vendor/depot_tools/third_party/gsutil/README +0 -38
  283. data/vendor/depot_tools/third_party/gsutil/README.chromium +0 -25
  284. data/vendor/depot_tools/third_party/gsutil/README.pkg +0 -49
  285. data/vendor/depot_tools/third_party/gsutil/ReleaseNotes.txt +0 -825
  286. data/vendor/depot_tools/third_party/gsutil/VERSION +0 -1
  287. data/vendor/depot_tools/third_party/gsutil/gslib/README +0 -5
  288. data/vendor/depot_tools/third_party/gsutil/gslib/__init__.py +0 -22
  289. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/__init__.py +0 -15
  290. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/acls.py +0 -234
  291. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/anon.py +0 -57
  292. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/command_opts.py +0 -116
  293. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/dev.py +0 -139
  294. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/metadata.py +0 -186
  295. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/naming.py +0 -173
  296. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/prod.py +0 -160
  297. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/projects.py +0 -130
  298. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/subdirs.py +0 -110
  299. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/support.py +0 -86
  300. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/versioning.py +0 -242
  301. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/wildcards.py +0 -170
  302. data/vendor/depot_tools/third_party/gsutil/gslib/bucket_listing_ref.py +0 -175
  303. data/vendor/depot_tools/third_party/gsutil/gslib/command.py +0 -725
  304. data/vendor/depot_tools/third_party/gsutil/gslib/command_runner.py +0 -102
  305. data/vendor/depot_tools/third_party/gsutil/gslib/commands/__init__.py +0 -15
  306. data/vendor/depot_tools/third_party/gsutil/gslib/commands/cat.py +0 -131
  307. data/vendor/depot_tools/third_party/gsutil/gslib/commands/chacl.py +0 -523
  308. data/vendor/depot_tools/third_party/gsutil/gslib/commands/config.py +0 -662
  309. data/vendor/depot_tools/third_party/gsutil/gslib/commands/cp.py +0 -1819
  310. data/vendor/depot_tools/third_party/gsutil/gslib/commands/disablelogging.py +0 -101
  311. data/vendor/depot_tools/third_party/gsutil/gslib/commands/enablelogging.py +0 -149
  312. data/vendor/depot_tools/third_party/gsutil/gslib/commands/getacl.py +0 -82
  313. data/vendor/depot_tools/third_party/gsutil/gslib/commands/getcors.py +0 -121
  314. data/vendor/depot_tools/third_party/gsutil/gslib/commands/getdefacl.py +0 -86
  315. data/vendor/depot_tools/third_party/gsutil/gslib/commands/getlogging.py +0 -137
  316. data/vendor/depot_tools/third_party/gsutil/gslib/commands/getversioning.py +0 -116
  317. data/vendor/depot_tools/third_party/gsutil/gslib/commands/getwebcfg.py +0 -122
  318. data/vendor/depot_tools/third_party/gsutil/gslib/commands/help.py +0 -218
  319. data/vendor/depot_tools/third_party/gsutil/gslib/commands/ls.py +0 -578
  320. data/vendor/depot_tools/third_party/gsutil/gslib/commands/mb.py +0 -172
  321. data/vendor/depot_tools/third_party/gsutil/gslib/commands/mv.py +0 -159
  322. data/vendor/depot_tools/third_party/gsutil/gslib/commands/perfdiag.py +0 -903
  323. data/vendor/depot_tools/third_party/gsutil/gslib/commands/rb.py +0 -113
  324. data/vendor/depot_tools/third_party/gsutil/gslib/commands/rm.py +0 -237
  325. data/vendor/depot_tools/third_party/gsutil/gslib/commands/setacl.py +0 -138
  326. data/vendor/depot_tools/third_party/gsutil/gslib/commands/setcors.py +0 -145
  327. data/vendor/depot_tools/third_party/gsutil/gslib/commands/setdefacl.py +0 -105
  328. data/vendor/depot_tools/third_party/gsutil/gslib/commands/setmeta.py +0 -420
  329. data/vendor/depot_tools/third_party/gsutil/gslib/commands/setversioning.py +0 -114
  330. data/vendor/depot_tools/third_party/gsutil/gslib/commands/setwebcfg.py +0 -190
  331. data/vendor/depot_tools/third_party/gsutil/gslib/commands/update.py +0 -305
  332. data/vendor/depot_tools/third_party/gsutil/gslib/commands/version.py +0 -150
  333. data/vendor/depot_tools/third_party/gsutil/gslib/exception.py +0 -76
  334. data/vendor/depot_tools/third_party/gsutil/gslib/help_provider.py +0 -81
  335. data/vendor/depot_tools/third_party/gsutil/gslib/name_expansion.py +0 -550
  336. data/vendor/depot_tools/third_party/gsutil/gslib/no_op_auth_plugin.py +0 -30
  337. data/vendor/depot_tools/third_party/gsutil/gslib/plurality_checkable_iterator.py +0 -56
  338. data/vendor/depot_tools/third_party/gsutil/gslib/project_id.py +0 -67
  339. data/vendor/depot_tools/third_party/gsutil/gslib/storage_uri_builder.py +0 -56
  340. data/vendor/depot_tools/third_party/gsutil/gslib/thread_pool.py +0 -79
  341. data/vendor/depot_tools/third_party/gsutil/gslib/util.py +0 -167
  342. data/vendor/depot_tools/third_party/gsutil/gslib/wildcard_iterator.py +0 -498
  343. data/vendor/depot_tools/third_party/gsutil/gsutil +0 -384
  344. data/vendor/depot_tools/third_party/gsutil/gsutil.spec.in +0 -75
  345. data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/__init__.py +0 -22
  346. data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client.py +0 -630
  347. data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client_test.py +0 -374
  348. data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_helper.py +0 -103
  349. data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_plugin.py +0 -24
  350. data/vendor/depot_tools/third_party/gsutil/pkg_util.py +0 -60
  351. data/vendor/depot_tools/third_party/gsutil/plugins/__init__.py +0 -0
  352. data/vendor/depot_tools/third_party/gsutil/plugins/sso_auth.py +0 -105
@@ -4,15 +4,9 @@
4
4
  "python",
5
5
  "-u",
6
6
  "RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
7
- "--master",
8
- "chromium.testing.master",
9
- "--builder",
10
- "TestBuilder",
11
- "--slave",
12
- "TestSlavename",
13
7
  "--spec",
14
8
  "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]",
15
- "--root",
9
+ "--patch_root",
16
10
  "src/v8",
17
11
  "--revision_mapping_file",
18
12
  "{\"src\": \"got_cr_revision\"}",
@@ -32,15 +26,31 @@
32
26
  "src/v8@HEAD"
33
27
  ],
34
28
  "env": {
29
+ "GIT_HTTP_LOW_SPEED_LIMIT": "1000",
30
+ "GIT_HTTP_LOW_SPEED_TIME": "300",
35
31
  "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
36
32
  },
37
33
  "name": "bot_update",
38
34
  "~followup_annotations": [
35
+ "@@@STEP_TEXT@Some step text@@@",
39
36
  "@@@STEP_LOG_LINE@json.output@{@@@",
40
- "@@@STEP_LOG_LINE@json.output@ \"did_run\": false, @@@",
41
- "@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false@@@",
37
+ "@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
38
+ "@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
39
+ "@@@STEP_LOG_LINE@json.output@ \"src\": \"HEAD\", @@@",
40
+ "@@@STEP_LOG_LINE@json.output@ \"src/v8\": \"HEAD\"@@@",
41
+ "@@@STEP_LOG_LINE@json.output@ }, @@@",
42
+ "@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
43
+ "@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src/v8\", @@@",
44
+ "@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
45
+ "@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
46
+ "@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
47
+ "@@@STEP_LOG_LINE@json.output@ }, @@@",
48
+ "@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
49
+ "@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
42
50
  "@@@STEP_LOG_LINE@json.output@}@@@",
43
- "@@@STEP_LOG_END@json.output@@@"
51
+ "@@@STEP_LOG_END@json.output@@@",
52
+ "@@@SET_BUILD_PROPERTY@got_cr_revision@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
53
+ "@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@"
44
54
  ]
45
55
  },
46
56
  {
@@ -6,6 +6,7 @@ DEPS = [
6
6
  'bot_update',
7
7
  'gclient',
8
8
  'recipe_engine/path',
9
+ 'recipe_engine/platform',
9
10
  'recipe_engine/properties',
10
11
  ]
11
12
 
@@ -25,12 +26,12 @@ def RunSteps(api):
25
26
  'HEAD')
26
27
  patch = api.properties.get('patch', True)
27
28
  clobber = True if api.properties.get('clobber') else False
28
- force = True if api.properties.get('force') else False
29
29
  no_shallow = True if api.properties.get('no_shallow') else False
30
30
  output_manifest = api.properties.get('output_manifest', False)
31
31
  with_branch_heads = api.properties.get('with_branch_heads', False)
32
32
  refs = api.properties.get('refs', [])
33
33
  oauth2 = api.properties.get('oauth2', False)
34
+ oauth2_json = api.properties.get('oauth2_json', False)
34
35
  root_solution_revision = api.properties.get('root_solution_revision')
35
36
  suffix = api.properties.get('suffix')
36
37
  gerrit_no_reset = True if api.properties.get('gerrit_no_reset') else False
@@ -44,12 +45,12 @@ def RunSteps(api):
44
45
  gerrit_no_rebase_patch_ref=gerrit_no_rebase_patch_ref)
45
46
  else:
46
47
  api.bot_update.ensure_checkout(
47
- force=force,
48
48
  no_shallow=no_shallow,
49
49
  patch=patch,
50
50
  with_branch_heads=with_branch_heads,
51
51
  output_manifest=output_manifest,
52
52
  refs=refs, patch_oauth2=oauth2,
53
+ oauth2_json=oauth2_json,
53
54
  clobber=clobber,
54
55
  root_solution_revision=root_solution_revision,
55
56
  suffix=suffix,
@@ -59,110 +60,78 @@ def RunSteps(api):
59
60
 
60
61
  def GenTests(api):
61
62
  yield api.test('basic') + api.properties(
62
- mastername='chromium.linux',
63
- buildername='Linux Builder',
64
- slavename='totallyaslave-m1',
63
+ patch=False,
64
+ revision='abc'
65
+ )
66
+ yield api.test('buildbot') + api.properties(
67
+ path_config='buildbot',
65
68
  patch=False,
66
69
  revision='abc'
67
70
  )
68
71
  yield api.test('basic_with_branch_heads') + api.properties(
69
- mastername='chromium.linux',
70
- buildername='Linux Builder',
71
- slavename='totallyaslave-m1',
72
72
  with_branch_heads=True,
73
73
  suffix='with branch heads'
74
74
  )
75
75
  yield api.test('basic_output_manifest') + api.properties(
76
- mastername='chromium.linux',
77
- buildername='Linux Builder',
78
- slavename='totallyaslave-m1',
79
76
  output_manifest=True,
80
77
  )
81
78
  yield api.test('tryjob') + api.properties(
82
- mastername='tryserver.chromium.linux',
83
- buildername='linux_rel',
84
- slavename='totallyaslave-c4',
85
79
  issue=12345,
86
80
  patchset=654321,
87
- patch_url='http://src.chromium.org/foo/bar'
81
+ rietveld='https://rietveld.example.com/',
88
82
  )
89
83
  yield api.test('trychange') + api.properties(
90
- mastername='tryserver.chromium.linux',
91
- buildername='linux_rel',
92
- slavename='totallyaslave-c4',
93
84
  refs=['+refs/change/1/2/333'],
94
85
  )
95
86
  yield api.test('trychange_oauth2') + api.properties(
96
- mastername='tryserver.chromium.linux',
97
- buildername='linux_rel',
98
- slavename='totallyaslave-c4',
99
87
  oauth2=True,
100
88
  )
101
- yield api.test('tryjob_fail') + api.properties(
89
+ yield api.test('trychange_oauth2_buildbot') + api.properties(
90
+ path_config='buildbot',
91
+ oauth2=True,
92
+ )
93
+ yield api.test('trychange_oauth2_json') + api.properties(
102
94
  mastername='tryserver.chromium.linux',
103
95
  buildername='linux_rel',
104
96
  slavename='totallyaslave-c4',
97
+ oauth2_json=True,
98
+ )
99
+ yield api.test('trychange_oauth2_json_win') + api.properties(
100
+ mastername='tryserver.chromium.win',
101
+ buildername='win_rel',
102
+ slavename='totallyaslave-c4',
103
+ oauth2_json=True,
104
+ ) + api.platform('win', 64)
105
+ yield api.test('tryjob_fail') + api.properties(
105
106
  issue=12345,
106
107
  patchset=654321,
107
- patch_url='http://src.chromium.org/foo/bar',
108
+ rietveld='https://rietveld.example.com/',
108
109
  ) + api.step_data('bot_update', retcode=1)
109
110
  yield api.test('tryjob_fail_patch') + api.properties(
110
- mastername='tryserver.chromium.linux',
111
- buildername='linux_rel',
112
- slavename='totallyaslave-c4',
113
111
  issue=12345,
114
112
  patchset=654321,
115
- patch_url='http://src.chromium.org/foo/bar',
113
+ rietveld='https://rietveld.example.com/',
116
114
  fail_patch='apply',
117
115
  ) + api.step_data('bot_update', retcode=88)
118
116
  yield api.test('tryjob_fail_patch_download') + api.properties(
119
- mastername='tryserver.chromium.linux',
120
- buildername='linux_rel',
121
- slavename='totallyaslave-c4',
122
117
  issue=12345,
123
118
  patchset=654321,
124
- patch_url='http://src.chromium.org/foo/bar',
119
+ rietveld='https://rietveld.example.com/',
125
120
  fail_patch='download'
126
121
  ) + api.step_data('bot_update', retcode=87)
127
- yield api.test('forced') + api.properties(
128
- mastername='experimental',
129
- buildername='Experimental Builder',
130
- slavename='somehost',
131
- force=1
132
- )
133
122
  yield api.test('no_shallow') + api.properties(
134
- mastername='experimental',
135
- buildername='Experimental Builder',
136
- slavename='somehost',
137
123
  no_shallow=1
138
124
  )
139
- yield api.test('off') + api.properties(
140
- mastername='experimental',
141
- buildername='Experimental Builder',
142
- slavename='somehost',
143
- )
144
125
  yield api.test('clobber') + api.properties(
145
- mastername='experimental',
146
- buildername='Experimental Builder',
147
- slavename='somehost',
148
126
  clobber=1
149
127
  )
150
128
  yield api.test('reset_root_solution_revision') + api.properties(
151
- mastername='experimental',
152
- buildername='Experimental Builder',
153
- slavename='somehost',
154
129
  root_solution_revision='revision',
155
130
  )
156
131
  yield api.test('gerrit_no_reset') + api.properties(
157
- mastername='experimental',
158
- buildername='Experimental Builder',
159
- slavename='somehost',
160
132
  gerrit_no_reset=1
161
133
  )
162
134
  yield api.test('gerrit_no_rebase_patch_ref') + api.properties(
163
- mastername='experimental',
164
- buildername='Experimental Builder',
165
- slavename='somehost',
166
135
  gerrit_no_rebase_patch_ref=True
167
136
  )
168
137
  yield api.test('apply_gerrit_ref') + api.properties(
@@ -172,18 +141,31 @@ def GenTests(api):
172
141
  test_apply_gerrit_ref=True,
173
142
  )
174
143
  yield api.test('tryjob_v8') + api.properties(
175
- mastername='tryserver.chromium.linux',
176
- buildername='linux_rel',
177
- slavename='totallyaslave-c4',
178
144
  issue=12345,
179
145
  patchset=654321,
180
- patch_url='http://src.chromium.org/foo/bar',
146
+ rietveld='https://rietveld.example.com/',
181
147
  patch_project='v8',
182
148
  revisions={'src/v8': 'abc'}
183
149
  )
184
150
  yield api.test('tryjob_v8_head_by_default') + api.properties.tryserver(
185
151
  patch_project='v8',
186
152
  )
187
- yield api.test('tryjob_gerrit_angle') + api.properties.tryserver_gerrit(
188
- full_project_name='angle/angle',
153
+ yield api.test('tryjob_gerrit_angle') + api.properties.tryserver(
154
+ gerrit_project='angle/angle',
155
+ patch_issue=338811,
156
+ patch_set=3,
157
+ )
158
+ yield api.test('tryjob_gerrit_angle_deprecated') + api.properties.tryserver(
159
+ patch_project='angle/angle',
160
+ gerrit='https://chromium-review.googlesource.com',
161
+ patch_storage='gerrit',
162
+ repository='https://chromium.googlesource.com/angle/angle',
163
+ rietveld=None,
164
+ **{
165
+ 'event.change.id': 'angle%2Fangle~master~Ideadbeaf',
166
+ 'event.change.number': 338811,
167
+ 'event.change.url':
168
+ 'https://chromium-review.googlesource.com/#/c/338811',
169
+ 'event.patchSet.ref': 'refs/changes/11/338811/3',
170
+ }
189
171
  )
@@ -7,7 +7,6 @@
7
7
 
8
8
  import cStringIO
9
9
  import codecs
10
- import collections
11
10
  import copy
12
11
  import ctypes
13
12
  import json
@@ -16,7 +15,6 @@ import os
16
15
  import pprint
17
16
  import random
18
17
  import re
19
- import socket
20
18
  import subprocess
21
19
  import sys
22
20
  import tempfile
@@ -32,130 +30,35 @@ import os.path as path
32
30
  BUF_SIZE = 256
33
31
 
34
32
 
35
- # TODO(luqui): This is a horrible hack to identify build_internal when build
36
- # is a recipe dependency. bot_update should not be depending on internal,
37
- # rather the arrow should go the other way (or just be destroyed).
38
- def check_dir(name, dirs, default=None):
39
- for d in dirs:
40
- d = path.abspath(d)
41
- if path.basename(d) == name and path.isdir(d):
42
- return d
43
- return default
44
-
45
-
46
33
  # Define a bunch of directory paths.
47
34
  # Relative to the current working directory.
48
35
  CURRENT_DIR = path.abspath(os.getcwd())
49
36
  BUILDER_DIR = path.dirname(CURRENT_DIR)
50
- SLAVE_DIR = path.dirname(BUILDER_DIR)
51
37
 
52
38
  # Relative to this script's filesystem path.
53
39
  THIS_DIR = path.dirname(path.abspath(__file__))
54
- SCRIPTS_DIR = check_dir(
55
- 'scripts', [
56
- path.dirname(THIS_DIR),
57
- path.join(SLAVE_DIR, '..', 'scripts'),
58
- path.join(THIS_DIR, # resources
59
- '..', # bot_update
60
- '..', # recipe_modules
61
- '..', # depot_tools
62
- '..', # .recipe_deps
63
- '..', # slave
64
- '..', # scripts
65
- '..', # build_internal
66
- '..', # ROOT_DIR
67
- 'build',
68
- 'scripts'),
69
- path.join(SLAVE_DIR, '..', 'build', 'scripts'),
70
- ], default=path.dirname(THIS_DIR))
71
- BUILD_DIR = path.dirname(SCRIPTS_DIR)
72
- ROOT_DIR = path.dirname(BUILD_DIR)
73
40
 
74
41
  DEPOT_TOOLS_DIR = path.abspath(path.join(THIS_DIR, '..', '..', '..'))
75
42
 
76
- BUILD_INTERNAL_DIR = check_dir(
77
- 'build_internal', [
78
- path.join(ROOT_DIR, 'build_internal'),
79
- path.join(ROOT_DIR, # .recipe_deps
80
- path.pardir, # slave
81
- path.pardir, # scripts
82
- path.pardir), # build_internal
83
- ])
84
-
85
-
86
43
  CHROMIUM_GIT_HOST = 'https://chromium.googlesource.com'
87
44
  CHROMIUM_SRC_URL = CHROMIUM_GIT_HOST + '/chromium/src.git'
88
45
 
89
- # Official builds use buildspecs, so this is a special case.
90
- BUILDSPEC_TYPE = collections.namedtuple('buildspec',
91
- ('container', 'version'))
92
- BUILDSPEC_RE = (r'^/chrome-internal/trunk/tools/buildspec/'
93
- '(build|branches|releases)/(.+)$')
94
- GIT_BUILDSPEC_PATH = ('https://chrome-internal.googlesource.com/chrome/tools/'
95
- 'buildspec')
96
46
  BRANCH_HEADS_REFSPEC = '+refs/branch-heads/*'
97
47
 
98
- BUILDSPEC_COMMIT_RE = (
99
- re.compile(r'Buildspec for.*version (\d+\.\d+\.\d+\.\d+)'),
100
- re.compile(r'Create (\d+\.\d+\.\d+\.\d+) buildspec'),
101
- re.compile(r'Auto-converted (\d+\.\d+\.\d+\.\d+) buildspec to git'),
102
- )
103
-
104
48
  # Regular expression that matches a single commit footer line.
105
49
  COMMIT_FOOTER_ENTRY_RE = re.compile(r'([^:]+):\s+(.+)')
106
50
 
107
51
  # Footer metadata keys for regular and gsubtreed mirrored commit positions.
108
52
  COMMIT_POSITION_FOOTER_KEY = 'Cr-Commit-Position'
109
53
  COMMIT_ORIGINAL_POSITION_FOOTER_KEY = 'Cr-Original-Commit-Position'
110
- # Regular expression to parse a commit position
111
- COMMIT_POSITION_RE = re.compile(r'(.+)@\{#(\d+)\}')
112
54
 
113
55
  # Regular expression to parse gclient's revinfo entries.
114
56
  REVINFO_RE = re.compile(r'^([^:]+):\s+([^@]+)@(.+)$')
115
57
 
116
- # Used by 'ResolveSvnRevisionFromGitiles'
117
- GIT_SVN_PROJECT_MAP = {
118
- 'webkit': {
119
- 'svn_url': 'svn://svn.chromium.org/blink',
120
- 'branch_map': [
121
- (r'trunk', r'refs/heads/master'),
122
- (r'branches/([^/]+)', r'refs/branch-heads/\1'),
123
- ],
124
- },
125
- 'v8': {
126
- 'svn_url': 'https://v8.googlecode.com/svn',
127
- 'branch_map': [
128
- (r'trunk', r'refs/heads/candidates'),
129
- (r'branches/bleeding_edge', r'refs/heads/master'),
130
- (r'branches/([^/]+)', r'refs/branch-heads/\1'),
131
- ],
132
- },
133
- 'nacl': {
134
- 'svn_url': 'svn://svn.chromium.org/native_client',
135
- 'branch_map': [
136
- (r'trunk/src/native_client', r'refs/heads/master'),
137
- ],
138
- },
139
- }
140
-
141
- # Key for the 'git-svn' ID metadata commit footer entry.
142
- GIT_SVN_ID_FOOTER_KEY = 'git-svn-id'
143
- # e.g., git-svn-id: https://v8.googlecode.com/svn/trunk@23117
144
- # ce2b1a6d-e550-0410-aec6-3dcde31c8c00
145
- GIT_SVN_ID_RE = re.compile(r'((?:\w+)://[^@]+)@(\d+)\s+(?:[a-zA-Z0-9\-]+)')
146
-
147
-
148
- # This is the git mirror of the buildspecs repository. We could rely on the svn
149
- # checkout, now that the git buildspecs are checked in alongside the svn
150
- # buildspecs, but we're going to want to pull all the buildspecs from here
151
- # eventually anyhow, and there's already some logic to pull from git (for the
152
- # old git_buildspecs.git repo), so just stick with that.
153
- GIT_BUILDSPEC_REPO = (
154
- 'https://chrome-internal.googlesource.com/chrome/tools/buildspec')
155
58
 
156
59
  # Copied from scripts/recipes/chromium.py.
157
60
  GOT_REVISION_MAPPINGS = {
158
- '/chrome/trunk/src': {
61
+ CHROMIUM_SRC_URL: {
159
62
  'src/': 'got_revision',
160
63
  'src/native_client/': 'got_nacl_revision',
161
64
  'src/tools/swarm_client/': 'got_swarm_client_revision',
@@ -167,62 +70,6 @@ GOT_REVISION_MAPPINGS = {
167
70
  }
168
71
 
169
72
 
170
- BOT_UPDATE_MESSAGE = """
171
- What is the "Bot Update" step?
172
- ==============================
173
-
174
- This step ensures that the source checkout on the bot (e.g. Chromium's src/ and
175
- its dependencies) is checked out in a consistent state. This means that all of
176
- the necessary repositories are checked out, no extra repositories are checked
177
- out, and no locally modified files are present.
178
-
179
- These actions used to be taken care of by the "gclient revert" and "update"
180
- steps. However, those steps are known to be buggy and occasionally flaky. This
181
- step has two main advantages over them:
182
- * it only operates in Git, so the logic can be clearer and cleaner; and
183
- * it is a slave-side script, so its behavior can be modified without
184
- restarting the master.
185
-
186
- Why Git, you ask? Because that is the direction that the Chromium project is
187
- heading. This step is an integral part of the transition from using the SVN repo
188
- at chrome/trunk/src to using the Git repo src.git. Please pardon the dust while
189
- we fully convert everything to Git. This message will get out of your way
190
- eventually, and the waterfall will be a happier place because of it.
191
-
192
- This step can be activated or deactivated independently on every builder on
193
- every master. When it is active, the "gclient revert" and "update" steps become
194
- no-ops. When it is inactive, it prints this message, cleans up after itself, and
195
- lets everything else continue as though nothing has changed. Eventually, when
196
- everything is stable enough, this step will replace them entirely.
197
-
198
- Debugging information:
199
- (master/builder/slave may be unspecified on recipes)
200
- master: %(master)s
201
- builder: %(builder)s
202
- slave: %(slave)s
203
- forced by recipes: %(recipe)s
204
- CURRENT_DIR: %(CURRENT_DIR)s
205
- BUILDER_DIR: %(BUILDER_DIR)s
206
- SLAVE_DIR: %(SLAVE_DIR)s
207
- THIS_DIR: %(THIS_DIR)s
208
- SCRIPTS_DIR: %(SCRIPTS_DIR)s
209
- BUILD_DIR: %(BUILD_DIR)s
210
- ROOT_DIR: %(ROOT_DIR)s
211
- DEPOT_TOOLS_DIR: %(DEPOT_TOOLS_DIR)s
212
- bot_update.py is:"""
213
-
214
- ACTIVATED_MESSAGE = """ACTIVE.
215
- The bot will perform a Git checkout in this step.
216
- The "gclient revert" and "update" steps are no-ops.
217
-
218
- """
219
-
220
- NOT_ACTIVATED_MESSAGE = """INACTIVE.
221
- This step does nothing. You actually want to look at the "update" step.
222
-
223
- """
224
-
225
-
226
73
  GCLIENT_TEMPLATE = """solutions = %(solutions)s
227
74
 
228
75
  cache_dir = r%(cache_dir)s
@@ -231,138 +78,11 @@ cache_dir = r%(cache_dir)s
231
78
  """
232
79
 
233
80
 
234
- internal_data = {}
235
- if BUILD_INTERNAL_DIR:
236
- local_vars = {}
237
- try:
238
- execfile(os.path.join(
239
- BUILD_INTERNAL_DIR, 'scripts', 'slave', 'bot_update_cfg.py'),
240
- local_vars)
241
- except Exception:
242
- # Same as if BUILD_INTERNAL_DIR didn't exist in the first place.
243
- print 'Warning: unable to read internal configuration file.'
244
- print 'If this is an internal bot, this step may be erroneously inactive.'
245
- internal_data = local_vars
246
-
247
- RECOGNIZED_PATHS = {
248
- # If SVN path matches key, the entire URL is rewritten to the Git url.
249
- '/chrome/trunk/src':
250
- CHROMIUM_SRC_URL,
251
- '/chrome/trunk/src/tools/cros.DEPS':
252
- CHROMIUM_GIT_HOST + '/chromium/src/tools/cros.DEPS.git',
253
- '/chrome-internal/trunk/src-internal':
254
- 'https://chrome-internal.googlesource.com/chrome/src-internal.git',
255
- }
256
- RECOGNIZED_PATHS.update(internal_data.get('RECOGNIZED_PATHS', {}))
257
-
258
- ENABLED_MASTERS = [
259
- 'bot_update.always_on',
260
- 'chromium.android',
261
- 'chromium.angle',
262
- 'chromium.chrome',
263
- 'chromium.chromedriver',
264
- 'chromium.chromiumos',
265
- 'chromium',
266
- 'chromium.fyi',
267
- 'chromium.goma',
268
- 'chromium.gpu',
269
- 'chromium.gpu.fyi',
270
- 'chromium.infra',
271
- 'chromium.infra.cron',
272
- 'chromium.linux',
273
- 'chromium.lkgr',
274
- 'chromium.mac',
275
- 'chromium.memory',
276
- 'chromium.memory.fyi',
277
- 'chromium.perf',
278
- 'chromium.perf.fyi',
279
- 'chromium.swarm',
280
- 'chromium.webkit',
281
- 'chromium.webrtc',
282
- 'chromium.webrtc.fyi',
283
- 'chromium.win',
284
- 'client.catapult',
285
- 'client.drmemory',
286
- 'client.mojo',
287
- 'client.nacl',
288
- 'client.nacl.ports',
289
- 'client.nacl.sdk',
290
- 'client.nacl.toolchain',
291
- 'client.pdfium',
292
- 'client.skia',
293
- 'client.skia.fyi',
294
- 'client.v8',
295
- 'client.v8.branches',
296
- 'client.v8.fyi',
297
- 'client.v8.ports',
298
- 'client.webrtc',
299
- 'client.webrtc.fyi',
300
- 'tryserver.blink',
301
- 'tryserver.client.catapult',
302
- 'tryserver.client.mojo',
303
- 'tryserver.chromium.android',
304
- 'tryserver.chromium.angle',
305
- 'tryserver.chromium.linux',
306
- 'tryserver.chromium.mac',
307
- 'tryserver.chromium.perf',
308
- 'tryserver.chromium.win',
309
- 'tryserver.infra',
310
- 'tryserver.nacl',
311
- 'tryserver.v8',
312
- 'tryserver.webrtc',
313
- ]
314
- ENABLED_MASTERS += internal_data.get('ENABLED_MASTERS', [])
315
-
316
- ENABLED_BUILDERS = {
317
- 'client.dart.fyi': [
318
- 'v8-linux-release',
319
- 'v8-mac-release',
320
- 'v8-win-release',
321
- ],
322
- 'client.dynamorio': [
323
- 'linux-v8-dr',
324
- ],
325
- }
326
- ENABLED_BUILDERS.update(internal_data.get('ENABLED_BUILDERS', {}))
327
-
328
- ENABLED_SLAVES = {}
329
- ENABLED_SLAVES.update(internal_data.get('ENABLED_SLAVES', {}))
330
-
331
- # Disabled filters get run AFTER enabled filters, so for example if a builder
332
- # config is enabled, but a bot on that builder is disabled, that bot will
333
- # be disabled.
334
- DISABLED_BUILDERS = {}
335
- DISABLED_BUILDERS.update(internal_data.get('DISABLED_BUILDERS', {}))
336
-
337
- DISABLED_SLAVES = {}
338
- DISABLED_SLAVES.update(internal_data.get('DISABLED_SLAVES', {}))
339
-
340
- # These masters work only in Git, meaning for got_revision, always output
341
- # a git hash rather than a SVN rev.
342
- GIT_MASTERS = [
343
- 'client.v8',
344
- 'client.v8.branches',
345
- 'client.v8.ports',
346
- 'tryserver.v8',
347
- ]
348
- GIT_MASTERS += internal_data.get('GIT_MASTERS', [])
349
-
350
-
351
81
  # How many times to try before giving up.
352
82
  ATTEMPTS = 5
353
83
 
354
84
  GIT_CACHE_PATH = path.join(DEPOT_TOOLS_DIR, 'git_cache.py')
355
-
356
- # Find the patch tool.
357
- if sys.platform.startswith('win'):
358
- if not BUILD_INTERNAL_DIR:
359
- print 'Warning: could not find patch tool because there is no '
360
- print 'build_internal present.'
361
- PATCH_TOOL = None
362
- else:
363
- PATCH_TOOL = path.join(BUILD_INTERNAL_DIR, 'tools', 'patch.EXE')
364
- else:
365
- PATCH_TOOL = '/usr/bin/patch'
85
+ GCLIENT_PATH = path.join(DEPOT_TOOLS_DIR, 'gclient.py')
366
86
 
367
87
  # If there is less than 100GB of disk space on the system, then we do
368
88
  # a shallow checkout.
@@ -384,19 +104,10 @@ class GclientSyncFailed(SubprocessFailed):
384
104
  pass
385
105
 
386
106
 
387
- class SVNRevisionNotFound(Exception):
388
- pass
389
-
390
-
391
107
  class InvalidDiff(Exception):
392
108
  pass
393
109
 
394
110
 
395
- class Inactive(Exception):
396
- """Not really an exception, just used to exit early cleanly."""
397
- pass
398
-
399
-
400
111
  RETRY = object()
401
112
  OK = object()
402
113
  FAIL = object()
@@ -525,48 +236,6 @@ def get_gclient_spec(solutions, target_os, target_os_only, git_cache_dir):
525
236
  }
526
237
 
527
238
 
528
- def check_enabled(master, builder, slave):
529
- if master in ENABLED_MASTERS:
530
- return True
531
- builder_list = ENABLED_BUILDERS.get(master)
532
- if builder_list and builder in builder_list:
533
- return True
534
- slave_list = ENABLED_SLAVES.get(master)
535
- if slave_list and slave in slave_list:
536
- return True
537
- return False
538
-
539
-
540
- def check_disabled(master, builder, slave):
541
- """Returns True if disabled, False if not disabled."""
542
- builder_list = DISABLED_BUILDERS.get(master)
543
- if builder_list and builder in builder_list:
544
- return True
545
- slave_list = DISABLED_SLAVES.get(master)
546
- if slave_list and slave in slave_list:
547
- return True
548
- return False
549
-
550
-
551
- def check_valid_host(master, builder, slave):
552
- return (check_enabled(master, builder, slave)
553
- and not check_disabled(master, builder, slave))
554
-
555
-
556
- def maybe_ignore_revision(revision, buildspec):
557
- """Handle builders that don't care what buildbot tells them to build.
558
-
559
- This is especially the case with branch builders that build from buildspecs
560
- and/or trigger off multiple repositories, where the --revision passed in has
561
- nothing to do with the solution being built. Clearing the revision in this
562
- case causes bot_update to use HEAD rather that trying to checkout an
563
- inappropriate version of the solution.
564
- """
565
- if buildspec and buildspec.container == 'branches':
566
- return []
567
- return revision
568
-
569
-
570
239
  def solutions_printer(solutions):
571
240
  """Prints gclient solution to stdout."""
572
241
  print 'Gclient Solutions'
@@ -601,52 +270,18 @@ def solutions_printer(solutions):
601
270
  print
602
271
 
603
272
 
604
- def solutions_to_git(input_solutions):
273
+ def modify_solutions(input_solutions):
605
274
  """Modifies urls in solutions to point at Git repos.
606
275
 
607
- returns: (git solution, svn root of first solution) tuple.
276
+ returns: new solution dictionary
608
277
  """
609
278
  assert input_solutions
610
279
  solutions = copy.deepcopy(input_solutions)
611
- first_solution = True
612
- buildspec = None
613
280
  for solution in solutions:
614
281
  original_url = solution['url']
615
282
  parsed_url = urlparse.urlparse(original_url)
616
283
  parsed_path = parsed_url.path
617
284
 
618
- # Rewrite SVN urls into Git urls.
619
- buildspec_m = re.match(BUILDSPEC_RE, parsed_path)
620
- if first_solution and buildspec_m:
621
- solution['url'] = GIT_BUILDSPEC_PATH
622
- buildspec = BUILDSPEC_TYPE(
623
- container=buildspec_m.group(1),
624
- version=buildspec_m.group(2),
625
- )
626
- solution['deps_file'] = path.join(buildspec.container, buildspec.version,
627
- 'DEPS')
628
- elif parsed_path in RECOGNIZED_PATHS:
629
- solution['url'] = RECOGNIZED_PATHS[parsed_path]
630
- solution['deps_file'] = '.DEPS.git'
631
- elif parsed_url.scheme == 'https' and 'googlesource' in parsed_url.netloc:
632
- pass
633
- else:
634
- print 'Warning: %s' % ('path %r not recognized' % parsed_path,)
635
-
636
- # Strip out deps containing $$V8_REV$$, etc.
637
- if 'custom_deps' in solution:
638
- new_custom_deps = {}
639
- for deps_name, deps_value in solution['custom_deps'].iteritems():
640
- if deps_value and '$$' in deps_value:
641
- print 'Dropping %s:%s from custom deps' % (deps_name, deps_value)
642
- else:
643
- new_custom_deps[deps_name] = deps_value
644
- solution['custom_deps'] = new_custom_deps
645
-
646
- if first_solution:
647
- root = parsed_path
648
- first_solution = False
649
-
650
285
  solution['managed'] = False
651
286
  # We don't want gclient to be using a safesync URL. Instead it should
652
287
  # using the lkgr/lkcr branch/tags.
@@ -654,7 +289,8 @@ def solutions_to_git(input_solutions):
654
289
  print 'Removing safesync url %s from %s' % (solution['safesync_url'],
655
290
  parsed_path)
656
291
  del solution['safesync_url']
657
- return solutions, root, buildspec
292
+
293
+ return solutions
658
294
 
659
295
 
660
296
  def remove(target):
@@ -662,35 +298,40 @@ def remove(target):
662
298
  dead_folder = path.join(BUILDER_DIR, 'build.dead')
663
299
  if not path.exists(dead_folder):
664
300
  os.makedirs(dead_folder)
665
- os.rename(target, path.join(dead_folder, uuid.uuid4().hex))
666
-
667
-
668
- def ensure_no_checkout(dir_names, scm_dirname):
669
- """Ensure that there is no undesired checkout under build/.
301
+ dest = path.join(dead_folder, uuid.uuid4().hex)
302
+ print 'Marking for removal %s => %s' % (target, dest)
303
+ try:
304
+ os.rename(target, dest)
305
+ except Exception as e:
306
+ print 'Error renaming %s to %s: %s' % (target, dest, str(e))
307
+ raise
670
308
 
671
- If there is an incorrect checkout under build/, then
672
- move build/ to build.dead/
673
- This function will check each directory in dir_names.
674
309
 
675
- scm_dirname is expected to be either ['.svn', '.git']
676
- """
677
- assert scm_dirname in ['.svn', '.git', '*']
678
- has_checkout = any(path.exists(path.join(os.getcwd(), dir_name, scm_dirname))
310
+ def ensure_no_checkout(dir_names):
311
+ """Ensure that there is no undesired checkout under build/."""
312
+ build_dir = os.getcwd()
313
+ has_checkout = any(path.exists(path.join(build_dir, dir_name, '.git'))
679
314
  for dir_name in dir_names)
680
-
681
- if has_checkout or scm_dirname == '*':
682
- build_dir = os.getcwd()
683
- prefix = ''
684
- if scm_dirname != '*':
685
- prefix = '%s detected in checkout, ' % scm_dirname
686
-
315
+ if has_checkout:
687
316
  for filename in os.listdir(build_dir):
688
317
  deletion_target = path.join(build_dir, filename)
689
- print '%sdeleting %s...' % (prefix, deletion_target),
318
+ print '.git detected in checkout, deleting %s...' % deletion_target,
690
319
  remove(deletion_target)
691
320
  print 'done'
692
321
 
693
322
 
323
+ def call_gclient(*args, **kwargs):
324
+ """Run the "gclient.py" tool with the supplied arguments.
325
+
326
+ Args:
327
+ args: command-line arguments to pass to gclient.
328
+ kwargs: keyword arguments to pass to call.
329
+ """
330
+ cmd = [sys.executable, '-u', GCLIENT_PATH]
331
+ cmd.extend(args)
332
+ return call(*cmd, **kwargs)
333
+
334
+
694
335
  def gclient_configure(solutions, target_os, target_os_only, git_cache_dir):
695
336
  """Should do the same thing as gclient --spec='...'."""
696
337
  with codecs.open('.gclient', mode='w', encoding='utf-8') as f:
@@ -698,21 +339,27 @@ def gclient_configure(solutions, target_os, target_os_only, git_cache_dir):
698
339
  solutions, target_os, target_os_only, git_cache_dir))
699
340
 
700
341
 
701
- def gclient_sync(with_branch_heads, shallow):
342
+ def gclient_sync(with_branch_heads, shallow, revisions, break_repo_locks):
702
343
  # We just need to allocate a filename.
703
344
  fd, gclient_output_file = tempfile.mkstemp(suffix='.json')
704
345
  os.close(fd)
705
- gclient_bin = 'gclient.bat' if sys.platform.startswith('win') else 'gclient'
706
- cmd = [gclient_bin, 'sync', '--verbose', '--reset', '--force',
346
+
347
+ args = ['sync', '--verbose', '--reset', '--force',
707
348
  '--ignore_locks', '--output-json', gclient_output_file,
708
349
  '--nohooks', '--noprehooks', '--delete_unversioned_trees']
709
350
  if with_branch_heads:
710
- cmd += ['--with_branch_heads']
351
+ args += ['--with_branch_heads']
711
352
  if shallow:
712
- cmd += ['--shallow']
353
+ args += ['--shallow']
354
+ if break_repo_locks:
355
+ args += ['--break_repo_locks']
356
+ for name, revision in sorted(revisions.iteritems()):
357
+ if revision.upper() == 'HEAD':
358
+ revision = 'origin/master'
359
+ args.extend(['--revision', '%s@%s' % (name, revision)])
713
360
 
714
361
  try:
715
- call(*cmd, tries=1)
362
+ call_gclient(*args, tries=1)
716
363
  except SubprocessFailed as e:
717
364
  # Throw a GclientSyncFailed exception so we can catch this independently.
718
365
  raise GclientSyncFailed(e.message, e.code, e.output)
@@ -723,15 +370,8 @@ def gclient_sync(with_branch_heads, shallow):
723
370
  os.remove(gclient_output_file)
724
371
 
725
372
 
726
- def gclient_runhooks(gyp_envs):
727
- gclient_bin = 'gclient.bat' if sys.platform.startswith('win') else 'gclient'
728
- env = dict([env_var.split('=', 1) for env_var in gyp_envs])
729
- call(gclient_bin, 'runhooks', env=env)
730
-
731
-
732
373
  def gclient_revinfo():
733
- gclient_bin = 'gclient.bat' if sys.platform.startswith('win') else 'gclient'
734
- return call(gclient_bin, 'revinfo', '-a') or ''
374
+ return call_gclient('revinfo', '-a') or ''
735
375
 
736
376
 
737
377
  def create_manifest():
@@ -780,32 +420,6 @@ def get_commit_message_footer(message, key):
780
420
  return get_commit_message_footer_map(message).get(key)
781
421
 
782
422
 
783
- def get_svn_rev(git_hash, dir_name):
784
- log = git('log', '-1', git_hash, cwd=dir_name)
785
- git_svn_id = get_commit_message_footer(log, GIT_SVN_ID_FOOTER_KEY)
786
- if not git_svn_id:
787
- return None
788
- m = GIT_SVN_ID_RE.match(git_svn_id)
789
- if not m:
790
- return None
791
- return int(m.group(2))
792
-
793
-
794
- def get_git_hash(revision, branch, sln_dir):
795
- """We want to search for the SVN revision on the git-svn branch.
796
-
797
- Note that git will search backwards from origin/master.
798
- """
799
- match = "^%s: [^ ]*@%s " % (GIT_SVN_ID_FOOTER_KEY, revision)
800
- ref = branch if branch.startswith('refs/') else 'origin/%s' % branch
801
- cmd = ['log', '-E', '--grep', match, '--format=%H', '--max-count=1', ref]
802
- result = git(*cmd, cwd=sln_dir).strip()
803
- if result:
804
- return result
805
- raise SVNRevisionNotFound('We can\'t resolve svn r%s into a git hash in %s' %
806
- (revision, sln_dir))
807
-
808
-
809
423
  def emit_log_lines(name, lines):
810
424
  for line in lines.splitlines():
811
425
  print '@@@STEP_LOG_LINE@%s@%s@@@' % (name, line)
@@ -860,16 +474,35 @@ def force_revision(folder_name, revision):
860
474
  branch, revision = split_revision
861
475
 
862
476
  if revision and revision.upper() != 'HEAD':
863
- if revision and revision.isdigit() and len(revision) < 40:
864
- # rev_num is really a svn revision number, convert it into a git hash.
865
- git_ref = get_git_hash(int(revision), branch, folder_name)
866
- else:
867
- # rev_num is actually a git hash or ref, we can just use it.
868
- git_ref = revision
869
- git('checkout', '--force', git_ref, cwd=folder_name)
477
+ git('checkout', '--force', revision, cwd=folder_name, tries=1)
870
478
  else:
871
479
  ref = branch if branch.startswith('refs/') else 'origin/%s' % branch
872
- git('checkout', '--force', ref, cwd=folder_name)
480
+ git('checkout', '--force', ref, cwd=folder_name, tries=1)
481
+
482
+
483
+ def is_broken_repo_dir(repo_dir):
484
+ # Treat absence of 'config' as a signal of a partially deleted repo.
485
+ return not path.exists(os.path.join(repo_dir, '.git', 'config'))
486
+
487
+
488
+ def _maybe_break_locks(checkout_path):
489
+ """This removes all .lock files from this repo's .git directory.
490
+
491
+ In particular, this will cleanup index.lock files, as well as ref lock
492
+ files.
493
+ """
494
+ git_dir = os.path.join(checkout_path, '.git')
495
+ for dirpath, _, filenames in os.walk(git_dir):
496
+ for filename in filenames:
497
+ if filename.endswith('.lock'):
498
+ to_break = os.path.join(dirpath, filename)
499
+ print 'breaking lock: %s' % to_break
500
+ try:
501
+ os.remove(to_break)
502
+ except OSError as ex:
503
+ print 'FAILED to break lock: %s: %s' % (to_break, ex)
504
+ raise
505
+
873
506
 
874
507
  def git_checkout(solutions, revisions, shallow, refs, git_cache_dir):
875
508
  build_dir = os.getcwd()
@@ -883,10 +516,11 @@ def git_checkout(solutions, revisions, shallow, refs, git_cache_dir):
883
516
  raise Exception('%s exists after cache unlock' % filename)
884
517
  first_solution = True
885
518
  for sln in solutions:
886
- # This is so we can loop back and try again if we need to wait for the
887
- # git mirrors to update from SVN.
519
+ # Just in case we're hitting a different git server than the one from
520
+ # which the target revision was polled, we retry some.
888
521
  done = False
889
- tries_left = 60
522
+ deadline = time.time() + 60 # One minute (5 tries with exp. backoff).
523
+ tries = 0
890
524
  while not done:
891
525
  name = sln['name']
892
526
  url = sln['url']
@@ -908,39 +542,52 @@ def git_checkout(solutions, revisions, shallow, refs, git_cache_dir):
908
542
  'clone', '--no-checkout', '--local', '--shared', mirror_dir, sln_dir)
909
543
 
910
544
  try:
545
+ # If repo deletion was aborted midway, it may have left .git in broken
546
+ # state.
547
+ if path.exists(sln_dir) and is_broken_repo_dir(sln_dir):
548
+ print 'Git repo %s appears to be broken, removing it' % sln_dir
549
+ remove(sln_dir)
550
+
551
+ # Use "tries=1", since we retry manually in this loop.
911
552
  if not path.isdir(sln_dir):
912
- git(*clone_cmd)
553
+ git(*clone_cmd, tries=1)
913
554
  else:
914
- git('remote', 'set-url', 'origin', mirror_dir, cwd=sln_dir)
915
- git('fetch', 'origin', cwd=sln_dir)
555
+ git('remote', 'set-url', 'origin', mirror_dir, cwd=sln_dir, tries=1)
556
+ git('fetch', 'origin', cwd=sln_dir, tries=1)
916
557
  for ref in refs:
917
558
  refspec = '%s:%s' % (ref, ref.lstrip('+'))
918
- git('fetch', 'origin', refspec, cwd=sln_dir)
559
+ git('fetch', 'origin', refspec, cwd=sln_dir, tries=1)
560
+
561
+ # Windows sometimes has trouble deleting files.
562
+ # This can make git commands that rely on locks fail.
563
+ # Try a few times in case Windows has trouble again (and again).
564
+ if sys.platform.startswith('win'):
565
+ tries = 3
566
+ while tries:
567
+ try:
568
+ _maybe_break_locks(sln_dir)
569
+ break
570
+ except Exception:
571
+ tries -= 1
919
572
 
920
573
  revision = get_target_revision(name, url, revisions) or 'HEAD'
921
574
  force_revision(sln_dir, revision)
922
575
  done = True
923
576
  except SubprocessFailed as e:
924
577
  # Exited abnormally, theres probably something wrong.
925
- # Lets wipe the checkout and try again.
926
- tries_left -= 1
927
- if tries_left > 0:
928
- print 'Something failed: %s.' % str(e)
929
- print 'waiting 5 seconds and trying again...'
930
- time.sleep(5)
931
- else:
578
+ print 'Something failed: %s.' % str(e)
579
+
580
+ if time.time() > deadline:
581
+ overrun = time.time() - deadline
582
+ print 'Ran %s seconds past deadline. Aborting.' % overrun
932
583
  raise
584
+
585
+ # Lets wipe the checkout and try again.
586
+ tries += 1
587
+ sleep_secs = 2**tries
588
+ print 'waiting %s seconds and trying again...' % sleep_secs
589
+ time.sleep(sleep_secs)
933
590
  remove(sln_dir)
934
- except SVNRevisionNotFound:
935
- tries_left -= 1
936
- if tries_left > 0:
937
- # If we don't have the correct revision, wait and try again.
938
- print 'We can\'t find revision %s.' % revision
939
- print 'The svn to git replicator is probably falling behind.'
940
- print 'waiting 5 seconds and trying again...'
941
- time.sleep(5)
942
- else:
943
- raise
944
591
 
945
592
  git('clean', '-dff', cwd=sln_dir)
946
593
 
@@ -961,82 +608,9 @@ def _download(url):
961
608
  raise
962
609
 
963
610
 
964
- def parse_diff(diff):
965
- """Takes a unified diff and returns a list of diffed files and their diffs.
966
-
967
- The return format is a list of pairs of:
968
- (<filename>, <diff contents>)
969
- <diff contents> is inclusive of the diff line.
970
- """
971
- result = []
972
- current_diff = ''
973
- current_header = None
974
- for line in diff.splitlines():
975
- # "diff" is for git style patches, and "Index: " is for SVN style patches.
976
- if line.startswith('diff') or line.startswith('Index: '):
977
- if current_header:
978
- # If we are in a diff portion, then save the diff.
979
- result.append((current_header, '%s\n' % current_diff))
980
- git_header_match = re.match(r'diff (?:--git )?(\S+) (\S+)', line)
981
- svn_header_match = re.match(r'Index: (.*)', line)
982
-
983
- if git_header_match:
984
- # First, see if its a git style header.
985
- from_file = git_header_match.group(1)
986
- to_file = git_header_match.group(2)
987
- if from_file != to_file and from_file.startswith('a/'):
988
- # Sometimes git prepends 'a/' and 'b/' in front of file paths.
989
- from_file = from_file[2:]
990
- current_header = from_file
991
-
992
- elif svn_header_match:
993
- # Otherwise, check if its an SVN style header.
994
- current_header = svn_header_match.group(1)
995
-
996
- else:
997
- # Otherwise... I'm not really sure what to do with this.
998
- raise InvalidDiff('Can\'t process header: %s\nFull diff:\n%s' %
999
- (line, diff))
1000
-
1001
- current_diff = ''
1002
- current_diff += '%s\n' % line
1003
- if current_header:
1004
- # We hit EOF, gotta save the last diff.
1005
- result.append((current_header, current_diff))
1006
- return result
1007
-
1008
-
1009
- def get_svn_patch(patch_url):
1010
- """Fetch patch from patch_url, return list of (filename, diff)"""
1011
- svn_exe = 'svn.bat' if sys.platform.startswith('win') else 'svn'
1012
- patch_data = call(svn_exe, 'cat', patch_url)
1013
- return parse_diff(patch_data)
1014
-
1015
-
1016
- def apply_svn_patch(patch_root, patches, whitelist=None, blacklist=None):
1017
- """Expects a list of (filename, diff), applies it on top of patch_root."""
1018
- if whitelist:
1019
- patches = [(name, diff) for name, diff in patches if name in whitelist]
1020
- elif blacklist:
1021
- patches = [(name, diff) for name, diff in patches if name not in blacklist]
1022
- diffs = [diff for _, diff in patches]
1023
- patch = ''.join(diffs)
1024
-
1025
- if patch:
1026
- print '===Patching files==='
1027
- for filename, _ in patches:
1028
- print 'Patching %s' % filename
1029
- try:
1030
- call(PATCH_TOOL, '-p0', '--remove-empty-files', '--force', '--forward',
1031
- stdin_data=patch, cwd=patch_root, tries=1)
1032
- for filename, _ in patches:
1033
- full_filename = path.abspath(path.join(patch_root, filename))
1034
- git('add', full_filename, cwd=path.dirname(full_filename))
1035
- except SubprocessFailed as e:
1036
- raise PatchFailed(e.message, e.code, e.output)
1037
-
1038
611
  def apply_rietveld_issue(issue, patchset, root, server, _rev_map, _revision,
1039
- email_file, key_file, whitelist=None, blacklist=None):
612
+ email_file, key_file, oauth2_file,
613
+ whitelist=None, blacklist=None):
1040
614
  apply_issue_bin = ('apply_issue.bat' if sys.platform.startswith('win')
1041
615
  else 'apply_issue')
1042
616
  cmd = [apply_issue_bin,
@@ -1051,8 +625,10 @@ def apply_rietveld_issue(issue, patchset, root, server, _rev_map, _revision,
1051
625
  # Don't run gclient sync when it sees a DEPS change.
1052
626
  '--ignore_deps',
1053
627
  ]
1054
- # Use an oauth key file if specified.
1055
- if email_file and key_file:
628
+ # Use an oauth key or json file if specified.
629
+ if oauth2_file:
630
+ cmd.extend(['--auth-refresh-token-json', oauth2_file])
631
+ elif email_file and key_file:
1056
632
  cmd.extend(['--email-file', email_file, '--private-key-file', key_file])
1057
633
  else:
1058
634
  cmd.append('--no-auth')
@@ -1085,6 +661,12 @@ def apply_gerrit_ref(gerrit_repo, gerrit_ref, root, gerrit_reset,
1085
661
  print '===Applying gerrit ref==='
1086
662
  print 'Repo is %r @ %r, ref is %r, root is %r' % (
1087
663
  gerrit_repo, base_rev, gerrit_ref, root)
664
+ # TODO(tandrii): move the fix below to common rietveld/gerrit codepath.
665
+ # Speculative fix: prior bot_update run with Rietveld patch may leave git
666
+ # index with unmerged paths. bot_update calls 'checkout --force xyz' thus
667
+ # ignoring such paths, but potentially never cleaning them up. The following
668
+ # command will do so. See http://crbug.com/692067.
669
+ git('reset', '--hard', cwd=root)
1088
670
  try:
1089
671
  git('retry', 'fetch', gerrit_repo, gerrit_ref, cwd=root, tries=1)
1090
672
  git('checkout', 'FETCH_HEAD', cwd=root)
@@ -1096,7 +678,12 @@ def apply_gerrit_ref(gerrit_repo, gerrit_ref, root, gerrit_reset,
1096
678
  try:
1097
679
  ok = False
1098
680
  git('checkout', '-b', temp_branch_name, cwd=root)
1099
- git('rebase', base_rev, cwd=root)
681
+ try:
682
+ git('rebase', base_rev, cwd=root)
683
+ except SubprocessFailed:
684
+ # Abort the rebase since there were failures.
685
+ git('rebase', '--abort', cwd=root)
686
+ raise
1100
687
 
1101
688
  # Get off of the temporary branch since it can't be deleted otherwise.
1102
689
  cur_rev = git('rev-parse', 'HEAD', cwd=root).strip()
@@ -1114,70 +701,14 @@ def apply_gerrit_ref(gerrit_repo, gerrit_ref, root, gerrit_reset,
1114
701
  except SubprocessFailed as e:
1115
702
  raise PatchFailed(e.message, e.code, e.output)
1116
703
 
1117
- def check_flag(flag_file):
1118
- """Returns True if the flag file is present."""
1119
- return os.path.isfile(flag_file)
1120
-
1121
-
1122
- def delete_flag(flag_file):
1123
- """Remove bot update flag."""
1124
- if os.path.isfile(flag_file):
1125
- os.remove(flag_file)
1126
-
1127
-
1128
- def emit_flag(flag_file):
1129
- """Deposit a bot update flag on the system to tell gclient not to run."""
1130
- print 'Emitting flag file at %s' % flag_file
1131
- with open(flag_file, 'wb') as f:
1132
- f.write('Success!')
1133
-
1134
-
1135
- def get_commit_position_for_git_svn(url, revision):
1136
- """Generates a commit position string for a 'git-svn' URL/revision.
1137
-
1138
- If the 'git-svn' URL maps to a known project, we will construct a commit
1139
- position branch value by applying substitution on the SVN URL.
1140
- """
1141
- # Identify the base URL so we can strip off trunk/branch name
1142
- project_config = branch = None
1143
- for _, project_config in GIT_SVN_PROJECT_MAP.iteritems():
1144
- if url.startswith(project_config['svn_url']):
1145
- branch = url[len(project_config['svn_url']):]
1146
- break
1147
-
1148
- if branch:
1149
- # Strip any leading slashes
1150
- branch = branch.lstrip('/')
1151
-
1152
- # Try and map the branch
1153
- for pattern, repl in project_config.get('branch_map', ()):
1154
- nbranch, subn = re.subn(pattern, repl, branch, count=1)
1155
- if subn:
1156
- print 'INFO: Mapped SVN branch to Git branch [%s] => [%s]' % (
1157
- branch, nbranch)
1158
- branch = nbranch
1159
- break
1160
- else:
1161
- # Use generic 'svn' branch
1162
- print 'INFO: Could not resolve project for SVN URL %r' % (url,)
1163
- branch = 'svn'
1164
- return '%s@{#%s}' % (branch, revision)
1165
-
1166
704
 
1167
705
  def get_commit_position(git_path, revision='HEAD'):
1168
706
  """Dumps the 'git' log for a specific revision and parses out the commit
1169
707
  position.
1170
708
 
1171
709
  If a commit position metadata key is found, its value will be returned.
1172
-
1173
- Otherwise, we will search for a 'git-svn' metadata entry. If one is found,
1174
- we will compose a commit position from it, using its SVN revision value as
1175
- the revision.
1176
-
1177
- If the 'git-svn' URL maps to a known project, we will construct a commit
1178
- position branch value by truncating the URL, mapping 'trunk' to
1179
- "refs/heads/master". Otherwise, we will return the generic branch, 'svn'.
1180
710
  """
711
+ # TODO(iannucci): Use git-footers for this.
1181
712
  git_log = git('log', '--format=%B', '-n1', revision, cwd=git_path)
1182
713
  footer_map = get_commit_message_footer_map(git_log)
1183
714
 
@@ -1186,23 +717,11 @@ def get_commit_position(git_path, revision='HEAD'):
1186
717
  footer_map.get(COMMIT_ORIGINAL_POSITION_FOOTER_KEY))
1187
718
  if value:
1188
719
  return value
1189
-
1190
- # Compose a commit position from 'git-svn' metadata
1191
- value = footer_map.get(GIT_SVN_ID_FOOTER_KEY)
1192
- if value:
1193
- m = GIT_SVN_ID_RE.match(value)
1194
- if not m:
1195
- raise ValueError("Invalid 'git-svn' value: [%s]" % (value,))
1196
- return get_commit_position_for_git_svn(m.group(1), m.group(2))
1197
720
  return None
1198
721
 
1199
722
 
1200
- def parse_got_revision(gclient_output, got_revision_mapping, use_svn_revs):
1201
- """Translate git gclient revision mapping to build properties.
1202
-
1203
- If use_svn_revs is True, then translate git hashes in the revision mapping
1204
- to svn revision numbers.
1205
- """
723
+ def parse_got_revision(gclient_output, got_revision_mapping):
724
+ """Translate git gclient revision mapping to build properties."""
1206
725
  properties = {}
1207
726
  solutions_output = {
1208
727
  # Make sure path always ends with a single slash.
@@ -1217,22 +736,14 @@ def parse_got_revision(gclient_output, got_revision_mapping, use_svn_revs):
1217
736
  solution_output = solutions_output[dir_name]
1218
737
  if solution_output.get('scm') is None:
1219
738
  # This is an ignored DEPS, so the output got_revision should be 'None'.
1220
- git_revision = revision = commit_position = None
739
+ revision = commit_position = None
1221
740
  else:
1222
741
  # Since we are using .DEPS.git, everything had better be git.
1223
742
  assert solution_output.get('scm') == 'git'
1224
- git_revision = git('rev-parse', 'HEAD', cwd=dir_name).strip()
1225
- if use_svn_revs:
1226
- revision = get_svn_rev(git_revision, dir_name)
1227
- if not revision:
1228
- revision = git_revision
1229
- else:
1230
- revision = git_revision
743
+ revision = git('rev-parse', 'HEAD', cwd=dir_name).strip()
1231
744
  commit_position = get_commit_position(dir_name)
1232
745
 
1233
746
  properties[property_name] = revision
1234
- if revision != git_revision:
1235
- properties['%s_git' % property_name] = git_revision
1236
747
  if commit_position:
1237
748
  properties['%s_cp' % property_name] = commit_position
1238
749
 
@@ -1249,27 +760,12 @@ def emit_json(out_file, did_run, gclient_output=None, **kwargs):
1249
760
  f.write(json.dumps(output, sort_keys=True))
1250
761
 
1251
762
 
1252
- def ensure_deps_revisions(deps_url_mapping, solutions, revisions):
1253
- """Ensure correct DEPS revisions, ignores solutions."""
1254
- for deps_name, deps_data in sorted(deps_url_mapping.items()):
1255
- if deps_name.strip('/') in solutions:
1256
- # This has already been forced to the correct solution by git_checkout().
1257
- continue
1258
- revision = get_target_revision(deps_name, deps_data.get('url', None),
1259
- revisions)
1260
- if not revision:
1261
- continue
1262
- # TODO(hinoka): Catch SVNRevisionNotFound error maybe?
1263
- git('fetch', 'origin', cwd=deps_name)
1264
- force_revision(deps_name, revision)
1265
-
1266
-
1267
763
  def ensure_checkout(solutions, revisions, first_sln, target_os, target_os_only,
1268
- patch_root, issue, patchset, patch_url, rietveld_server,
1269
- gerrit_repo, gerrit_ref, gerrit_rebase_patch_ref,
1270
- revision_mapping, apply_issue_email_file,
1271
- apply_issue_key_file, buildspec, gyp_env, shallow, runhooks,
1272
- refs, git_cache_dir, gerrit_reset):
764
+ patch_root, issue, patchset, rietveld_server, gerrit_repo,
765
+ gerrit_ref, gerrit_rebase_patch_ref, revision_mapping,
766
+ apply_issue_email_file, apply_issue_key_file,
767
+ apply_issue_oauth2_file, shallow, refs, git_cache_dir,
768
+ gerrit_reset):
1273
769
  # Get a checkout of each solution, without DEPS or hooks.
1274
770
  # Calling git directly because there is no way to run Gclient without
1275
771
  # invoking DEPS.
@@ -1277,10 +773,6 @@ def ensure_checkout(solutions, revisions, first_sln, target_os, target_os_only,
1277
773
 
1278
774
  git_ref = git_checkout(solutions, revisions, shallow, refs, git_cache_dir)
1279
775
 
1280
- patches = None
1281
- if patch_url:
1282
- patches = get_svn_patch(patch_url)
1283
-
1284
776
  print '===Processing patch solutions==='
1285
777
  already_patched = []
1286
778
  patch_root = patch_root or ''
@@ -1293,13 +785,11 @@ def ensure_checkout(solutions, revisions, first_sln, target_os, target_os_only,
1293
785
  relative_root = solution['name'][len(patch_root) + 1:]
1294
786
  target = '/'.join([relative_root, 'DEPS']).lstrip('/')
1295
787
  print ' relative root is %r, target is %r' % (relative_root, target)
1296
- if patches:
1297
- apply_svn_patch(patch_root, patches, whitelist=[target])
1298
- already_patched.append(target)
1299
- elif issue:
788
+ if issue:
1300
789
  apply_rietveld_issue(issue, patchset, patch_root, rietveld_server,
1301
790
  revision_mapping, git_ref, apply_issue_email_file,
1302
- apply_issue_key_file, whitelist=[target])
791
+ apply_issue_key_file, apply_issue_oauth2_file,
792
+ whitelist=[target])
1303
793
  already_patched.append(target)
1304
794
  elif gerrit_ref:
1305
795
  apply_gerrit_ref(gerrit_repo, gerrit_ref, patch_root, gerrit_reset,
@@ -1309,35 +799,36 @@ def ensure_checkout(solutions, revisions, first_sln, target_os, target_os_only,
1309
799
  # Ensure our build/ directory is set up with the correct .gclient file.
1310
800
  gclient_configure(solutions, target_os, target_os_only, git_cache_dir)
1311
801
 
802
+ # Windows sometimes has trouble deleting files. This can make git commands
803
+ # that rely on locks fail.
804
+ break_repo_locks = True if sys.platform.startswith('win') else False
805
+ # We want to pass all non-solution revisions into the gclient sync call.
806
+ solution_dirs = {sln['name'] for sln in solutions}
807
+ gc_revisions = {
808
+ dirname: rev for dirname, rev in revisions.iteritems()
809
+ if dirname not in solution_dirs}
810
+ # Gclient sometimes ignores "unmanaged": "False" in the gclient solution
811
+ # if --revision <anything> is passed (for example, for subrepos).
812
+ # This forces gclient to always treat solutions deps as unmanaged.
813
+ for solution_name in list(solution_dirs):
814
+ gc_revisions[solution_name] = 'unmanaged'
1312
815
  # Let gclient do the DEPS syncing.
1313
816
  # The branch-head refspec is a special case because its possible Chrome
1314
817
  # src, which contains the branch-head refspecs, is DEPSed in.
1315
- gclient_output = gclient_sync(buildspec or BRANCH_HEADS_REFSPEC in refs,
1316
- shallow)
818
+ gclient_output = gclient_sync(BRANCH_HEADS_REFSPEC in refs, shallow,
819
+ gc_revisions, break_repo_locks)
1317
820
 
1318
821
  # Now that gclient_sync has finished, we should revert any .DEPS.git so that
1319
822
  # presubmit doesn't complain about it being modified.
1320
- if (not buildspec and
1321
- git('ls-files', '.DEPS.git', cwd=first_sln).strip()):
823
+ if git('ls-files', '.DEPS.git', cwd=first_sln).strip():
1322
824
  git('checkout', 'HEAD', '--', '.DEPS.git', cwd=first_sln)
1323
825
 
1324
- if buildspec and runhooks:
1325
- # Run gclient runhooks if we're on an official builder.
1326
- # TODO(hinoka): Remove this when the official builders run their own
1327
- # runhooks step.
1328
- gclient_runhooks(gyp_env)
1329
-
1330
- # Finally, ensure that all DEPS are pinned to the correct revision.
1331
- dir_names = [sln['name'] for sln in solutions]
1332
- ensure_deps_revisions(gclient_output.get('solutions', {}),
1333
- dir_names, revisions)
1334
826
  # Apply the rest of the patch here (sans DEPS)
1335
- if patches:
1336
- apply_svn_patch(patch_root, patches, blacklist=already_patched)
1337
- elif issue:
827
+ if issue:
1338
828
  apply_rietveld_issue(issue, patchset, patch_root, rietveld_server,
1339
829
  revision_mapping, git_ref, apply_issue_email_file,
1340
- apply_issue_key_file, blacklist=already_patched)
830
+ apply_issue_key_file, apply_issue_oauth2_file,
831
+ blacklist=already_patched)
1341
832
  elif gerrit_ref and not applied_gerrit_patch:
1342
833
  # If gerrit_ref was for solution's main repository, it has already been
1343
834
  # applied above. This chunk is executed only for patches to DEPS-ed in
@@ -1374,15 +865,9 @@ def parse_revisions(revisions, root):
1374
865
  # This is an alt_root@revision argument.
1375
866
  current_root, current_rev = split_revision
1376
867
 
1377
- # We want to normalize svn/git urls into .git urls.
1378
868
  parsed_root = urlparse.urlparse(current_root)
1379
- if parsed_root.scheme == 'svn':
1380
- if parsed_root.path in RECOGNIZED_PATHS:
1381
- normalized_root = RECOGNIZED_PATHS[parsed_root.path]
1382
- else:
1383
- print 'WARNING: SVN path %s not recognized, ignoring' % current_root
1384
- continue
1385
- elif parsed_root.scheme in ['http', 'https']:
869
+ if parsed_root.scheme in ['http', 'https']:
870
+ # We want to normalize git urls into .git urls.
1386
871
  normalized_root = 'https://%s/%s' % (parsed_root.netloc,
1387
872
  parsed_root.path)
1388
873
  if not normalized_root.endswith('.git'):
@@ -1412,7 +897,9 @@ def parse_args():
1412
897
  parse.add_option('--apply_issue_key_file',
1413
898
  help='--private-key-file option passthrough for '
1414
899
  'apply_patch.py.')
1415
- parse.add_option('--patch_url', help='Optional URL to SVN patch.')
900
+ parse.add_option('--apply_issue_oauth2_file',
901
+ help='--auth-refresh-token-json option passthrough for '
902
+ 'apply_patch.py.')
1416
903
  parse.add_option('--root', dest='patch_root',
1417
904
  help='DEPRECATED: Use --patch_root.')
1418
905
  parse.add_option('--patch_root', help='Directory to patch on top of.')
@@ -1427,62 +914,37 @@ def parse_args():
1427
914
  parse.add_option('--gerrit_no_reset', action='store_true',
1428
915
  help='Bypass calling reset after applying a gerrit ref.')
1429
916
  parse.add_option('--specs', help='Gcilent spec.')
1430
- parse.add_option('--master',
1431
- help='Master name. If specified and it is not in '
1432
- 'bot_update\'s whitelist, bot_update will be noop.')
1433
- parse.add_option('-f', '--force', action='store_true',
1434
- help='Bypass check to see if we want to be run. '
1435
- 'Should ONLY be used locally or by smart recipes.')
1436
- parse.add_option('--revision_mapping',
1437
- help='{"path/to/repo/": "property_name"}')
1438
917
  parse.add_option('--revision_mapping_file',
1439
- help=('Same as revision_mapping, except its a path to a json'
1440
- ' file containing that format.'))
918
+ help=('Path to a json file of the form '
919
+ '{"path/to/repo/": "property_name"}'))
1441
920
  parse.add_option('--revision', action='append', default=[],
1442
- help='Revision to check out. Can be an SVN revision number, '
1443
- 'git hash, or any form of git ref. Can prepend '
1444
- 'root@<rev> to specify which repository, where root '
1445
- 'is either a filesystem path, git https url, or '
1446
- 'svn url. To specify Tip of Tree, set rev to HEAD.'
1447
- 'To specify a git branch and an SVN rev, <rev> can be '
1448
- 'set to <branch>:<revision>.')
921
+ help='Revision to check out. Can be any form of git ref. '
922
+ 'Can prepend root@<rev> to specify which repository, '
923
+ 'where root is either a filesystem path or git https '
924
+ 'url. To specify Tip of Tree, set rev to HEAD. ')
1449
925
  parse.add_option('--output_manifest', action='store_true',
1450
926
  help=('Add manifest json to the json output.'))
1451
- parse.add_option('--slave_name', default=socket.getfqdn().split('.')[0],
1452
- help='Hostname of the current machine, '
1453
- 'used for determining whether or not to activate.')
1454
- parse.add_option('--builder_name', help='Name of the builder, '
1455
- 'used for determining whether or not to activate.')
1456
- parse.add_option('--build_dir', default=os.getcwd())
1457
- parse.add_option('--flag_file', default=path.join(os.getcwd(),
1458
- 'update.flag'))
1459
- parse.add_option('--shallow', action='store_true',
1460
- help='Use shallow clones for cache repositories.')
1461
- parse.add_option('--gyp_env', action='append', default=[],
1462
- help='Environment variables to pass into gclient runhooks.')
1463
927
  parse.add_option('--clobber', action='store_true',
1464
928
  help='Delete checkout first, always')
1465
- parse.add_option('--bot_update_clobber', action='store_true', dest='clobber',
1466
- help='(synonym for --clobber)')
1467
- parse.add_option('-o', '--output_json',
929
+ parse.add_option('--output_json',
1468
930
  help='Output JSON information into a specified file')
1469
931
  parse.add_option('--no_shallow', action='store_true',
1470
932
  help='Bypass disk detection and never shallow clone. '
1471
933
  'Does not override the --shallow flag')
1472
- parse.add_option('--no_runhooks', action='store_true',
1473
- help='Do not run hooks on official builder.')
1474
934
  parse.add_option('--refs', action='append',
1475
935
  help='Also fetch this refspec for the main solution(s). '
1476
936
  'Eg. +refs/branch-heads/*')
1477
937
  parse.add_option('--with_branch_heads', action='store_true',
1478
938
  help='Always pass --with_branch_heads to gclient. This '
1479
939
  'does the same thing as --refs +refs/branch-heads/*')
1480
- parse.add_option('--git-cache-dir', default=path.join(SLAVE_DIR, 'cache_dir'),
1481
- help='Path to git cache directory.')
940
+ parse.add_option('--git-cache-dir', help='Path to git cache directory.')
1482
941
 
1483
942
 
1484
943
  options, args = parse.parse_args()
1485
944
 
945
+ if not options.git_cache_dir:
946
+ parse.error('--git-cache-dir is required')
947
+
1486
948
  if not options.refs:
1487
949
  options.refs = []
1488
950
 
@@ -1491,14 +953,11 @@ def parse_args():
1491
953
  del options.with_branch_heads
1492
954
 
1493
955
  try:
1494
- if options.revision_mapping_file:
1495
- if options.revision_mapping:
1496
- print ('WARNING: Ignoring --revision_mapping: --revision_mapping_file '
1497
- 'was set at the same time as --revision_mapping?')
1498
- with open(options.revision_mapping_file, 'r') as f:
1499
- options.revision_mapping = json.load(f)
1500
- elif options.revision_mapping:
1501
- options.revision_mapping = json.loads(options.revision_mapping)
956
+ if not options.revision_mapping_file:
957
+ parse.error('--revision_mapping_file is required')
958
+
959
+ with open(options.revision_mapping_file, 'r') as f:
960
+ options.revision_mapping = json.load(f)
1502
961
  except Exception as e:
1503
962
  print (
1504
963
  'WARNING: Caught execption while parsing revision_mapping*: %s'
@@ -1517,22 +976,10 @@ def parse_args():
1517
976
  def prepare(options, git_slns, active):
1518
977
  """Prepares the target folder before we checkout."""
1519
978
  dir_names = [sln.get('name') for sln in git_slns if 'name' in sln]
1520
- # If we're active now, but the flag file doesn't exist (we weren't active
1521
- # last run) or vice versa, blow away all checkouts.
1522
- if bool(active) != bool(check_flag(options.flag_file)):
1523
- ensure_no_checkout(dir_names, '*')
1524
- if options.output_json:
1525
- # Make sure we tell recipes that we didn't run if the script exits here.
1526
- emit_json(options.output_json, did_run=active)
1527
- if active:
1528
- if options.clobber:
1529
- ensure_no_checkout(dir_names, '*')
1530
- else:
1531
- ensure_no_checkout(dir_names, '.svn')
1532
- emit_flag(options.flag_file)
1533
- else:
1534
- delete_flag(options.flag_file)
1535
- raise Inactive # This is caught in main() and we exit cleanly.
979
+ if options.clobber:
980
+ ensure_no_checkout(dir_names)
981
+ # Make sure we tell recipes that we didn't run if the script exits here.
982
+ emit_json(options.output_json, did_run=active)
1536
983
 
1537
984
  # Do a shallow checkout if the disk is less than 100GB.
1538
985
  total_disk_space, free_disk_space = get_total_disk_space()
@@ -1545,9 +992,8 @@ def prepare(options, git_slns, active):
1545
992
  percent_used)
1546
993
  if not options.output_json:
1547
994
  print '@@@STEP_TEXT@%s@@@' % step_text
1548
- if not options.shallow:
1549
- options.shallow = (total_disk_space < SHALLOW_CLONE_THRESHOLD
1550
- and not options.no_shallow)
995
+ shallow = (total_disk_space < SHALLOW_CLONE_THRESHOLD
996
+ and not options.no_shallow)
1551
997
 
1552
998
  # The first solution is where the primary DEPS file resides.
1553
999
  first_sln = dir_names[0]
@@ -1556,11 +1002,14 @@ def prepare(options, git_slns, active):
1556
1002
  print 'Revisions: %s' % options.revision
1557
1003
  revisions = parse_revisions(options.revision, first_sln)
1558
1004
  print 'Fetching Git checkout at %s@%s' % (first_sln, revisions[first_sln])
1559
- return revisions, step_text
1005
+ return revisions, step_text, shallow
1560
1006
 
1561
1007
 
1562
- def checkout(options, git_slns, specs, buildspec, master,
1563
- svn_root, revisions, step_text):
1008
+ def checkout(options, git_slns, specs, revisions, step_text, shallow):
1009
+ print 'Checking git version...'
1010
+ ver = git('version').strip()
1011
+ print 'Using %s' % ver
1012
+
1564
1013
  first_sln = git_slns[0]['name']
1565
1014
  dir_names = [sln.get('name') for sln in git_slns if 'name' in sln]
1566
1015
  try:
@@ -1581,7 +1030,6 @@ def checkout(options, git_slns, specs, buildspec, master,
1581
1030
  patch_root=options.patch_root,
1582
1031
  issue=options.issue,
1583
1032
  patchset=options.patchset,
1584
- patch_url=options.patch_url,
1585
1033
  rietveld_server=options.rietveld_server,
1586
1034
  gerrit_repo=options.gerrit_repo,
1587
1035
  gerrit_ref=options.gerrit_ref,
@@ -1589,21 +1037,17 @@ def checkout(options, git_slns, specs, buildspec, master,
1589
1037
  revision_mapping=options.revision_mapping,
1590
1038
  apply_issue_email_file=options.apply_issue_email_file,
1591
1039
  apply_issue_key_file=options.apply_issue_key_file,
1592
-
1593
- # For official builders.
1594
- buildspec=buildspec,
1595
- gyp_env=options.gyp_env,
1596
- runhooks=not options.no_runhooks,
1040
+ apply_issue_oauth2_file=options.apply_issue_oauth2_file,
1597
1041
 
1598
1042
  # Finally, extra configurations such as shallowness of the clone.
1599
- shallow=options.shallow,
1043
+ shallow=shallow,
1600
1044
  refs=options.refs,
1601
1045
  git_cache_dir=options.git_cache_dir,
1602
1046
  gerrit_reset=not options.gerrit_no_reset)
1603
1047
  gclient_output = ensure_checkout(**checkout_parameters)
1604
1048
  except GclientSyncFailed:
1605
1049
  print 'We failed gclient sync, lets delete the checkout and retry.'
1606
- ensure_no_checkout(dir_names, '*')
1050
+ ensure_no_checkout(dir_names)
1607
1051
  gclient_output = ensure_checkout(**checkout_parameters)
1608
1052
  except PatchFailed as e:
1609
1053
  if options.output_json:
@@ -1623,11 +1067,8 @@ def checkout(options, git_slns, specs, buildspec, master,
1623
1067
  print '@@@STEP_TEXT@%s PATCH FAILED@@@' % step_text
1624
1068
  raise
1625
1069
 
1626
- # Revision is an svn revision, unless it's a git master.
1627
- use_svn_rev = master not in GIT_MASTERS
1628
-
1629
1070
  # Take care of got_revisions outputs.
1630
- revision_mapping = dict(GOT_REVISION_MAPPINGS.get(svn_root, {}))
1071
+ revision_mapping = GOT_REVISION_MAPPINGS.get(git_slns[0]['url'], {})
1631
1072
  if options.revision_mapping:
1632
1073
  revision_mapping.update(options.revision_mapping)
1633
1074
 
@@ -1637,8 +1078,7 @@ def checkout(options, git_slns, specs, buildspec, master,
1637
1078
  if not revision_mapping:
1638
1079
  revision_mapping[first_sln] = 'got_revision'
1639
1080
 
1640
- got_revisions = parse_got_revision(gclient_output, revision_mapping,
1641
- use_svn_rev)
1081
+ got_revisions = parse_got_revision(gclient_output, revision_mapping)
1642
1082
 
1643
1083
  if not got_revisions:
1644
1084
  # TODO(hinoka): We should probably bail out here, but in the interest
@@ -1663,73 +1103,42 @@ def checkout(options, git_slns, specs, buildspec, master,
1663
1103
  emit_properties(got_revisions)
1664
1104
 
1665
1105
 
1666
- def print_help_text(force, output_json, active, master, builder, slave):
1667
- """Print helpful messages to tell devs whats going on."""
1668
- if force and output_json:
1669
- recipe_force = 'Forced on by recipes'
1670
- elif active and output_json:
1671
- recipe_force = 'Off by recipes, but forced on by bot update'
1672
- elif not active and output_json:
1673
- recipe_force = 'Forced off by recipes'
1674
- else:
1675
- recipe_force = 'N/A. Was not called by recipes'
1676
-
1677
- print BOT_UPDATE_MESSAGE % {
1678
- 'master': master or 'Not specified',
1679
- 'builder': builder or 'Not specified',
1680
- 'slave': slave or 'Not specified',
1681
- 'recipe': recipe_force,
1106
+ def print_debug_info():
1107
+ print "Debugging info:"
1108
+ debug_params = {
1682
1109
  'CURRENT_DIR': CURRENT_DIR,
1683
1110
  'BUILDER_DIR': BUILDER_DIR,
1684
- 'SLAVE_DIR': SLAVE_DIR,
1685
1111
  'THIS_DIR': THIS_DIR,
1686
- 'SCRIPTS_DIR': SCRIPTS_DIR,
1687
- 'BUILD_DIR': BUILD_DIR,
1688
- 'ROOT_DIR': ROOT_DIR,
1689
1112
  'DEPOT_TOOLS_DIR': DEPOT_TOOLS_DIR,
1690
- },
1691
- print ACTIVATED_MESSAGE if active else NOT_ACTIVATED_MESSAGE
1113
+ }
1114
+ for k, v in sorted(debug_params.iteritems()):
1115
+ print "%s: %r" % (k, v)
1692
1116
 
1693
1117
 
1694
1118
  def main():
1695
1119
  # Get inputs.
1696
1120
  options, _ = parse_args()
1697
- builder = options.builder_name
1698
- slave = options.slave_name
1699
- master = options.master
1700
-
1701
- if not master:
1702
- # bot_update activation whitelist is checked only on buildbot masters.
1703
- # If there is no master, bot_update is always active.
1704
- options.force = True
1705
1121
 
1706
1122
  # Check if this script should activate or not.
1707
- active = options.force or check_valid_host(master, builder, slave)
1123
+ active = True
1708
1124
 
1709
1125
  # Print a helpful message to tell developers whats going on with this step.
1710
- print_help_text(
1711
- options.force, options.output_json, active, master, builder, slave)
1126
+ print_debug_info()
1712
1127
 
1713
- # Parse, munipulate, and print the gclient solutions.
1128
+ # Parse, manipulate, and print the gclient solutions.
1714
1129
  specs = {}
1715
1130
  exec(options.specs, specs)
1716
- svn_solutions = specs.get('solutions', [])
1717
- git_slns, svn_root, buildspec = solutions_to_git(svn_solutions)
1718
- options.revision = maybe_ignore_revision(options.revision, buildspec)
1131
+ orig_solutions = specs.get('solutions', [])
1132
+ git_slns = modify_solutions(orig_solutions)
1719
1133
 
1720
1134
  solutions_printer(git_slns)
1721
1135
 
1722
1136
  try:
1723
1137
  # Dun dun dun, the main part of bot_update.
1724
- revisions, step_text = prepare(options, git_slns, active)
1725
- checkout(options, git_slns, specs, buildspec, master, svn_root, revisions,
1726
- step_text)
1138
+ revisions, step_text, shallow = prepare(options, git_slns, active)
1139
+ checkout(options, git_slns, specs, revisions, step_text, shallow)
1727
1140
 
1728
- except Inactive:
1729
- # Not active, should count as passing.
1730
- pass
1731
1141
  except PatchFailed as e:
1732
- emit_flag(options.flag_file)
1733
1142
  # Return a specific non-zero exit code for patch failure (because it is
1734
1143
  # a failure), but make it different than other failures to distinguish
1735
1144
  # between infra failures (independent from patch author), and patch
@@ -1740,12 +1149,6 @@ def main():
1740
1149
  return 87
1741
1150
  # Genuine patch problem.
1742
1151
  return 88
1743
- except Exception:
1744
- # Unexpected failure.
1745
- emit_flag(options.flag_file)
1746
- raise
1747
- else:
1748
- emit_flag(options.flag_file)
1749
1152
 
1750
1153
 
1751
1154
  if __name__ == '__main__':