| OLD | NEW | 
|---|
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be | 
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. | 
| 4 | 4 | 
| 5 import types | 5 import types | 
| 6 | 6 | 
| 7 from recipe_engine.config import config_item_context, ConfigGroup, BadConf | 7 from recipe_engine.config import config_item_context, ConfigGroup, BadConf | 
| 8 from recipe_engine.config import ConfigList, Dict, Single, Static, Set, List | 8 from recipe_engine.config import ConfigList, Dict, Single, Static, Set, List | 
| 9 | 9 | 
| 10 from . import api as gclient_api | 10 from . import api as gclient_api | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 56     #   to the solution.revision field is really terrible. I mostly blame | 56     #   to the solution.revision field is really terrible. I mostly blame | 
| 57     #   gclient. | 57     #   gclient. | 
| 58     # Maps 'parent_build_property' -> 'custom_var_name' | 58     # Maps 'parent_build_property' -> 'custom_var_name' | 
| 59     # Maps 'parent_build_property' -> None | 59     # Maps 'parent_build_property' -> None | 
| 60     # If value is None, the property value will be applied to | 60     # If value is None, the property value will be applied to | 
| 61     # solutions[0].revision. Otherwise, it will be applied to | 61     # solutions[0].revision. Otherwise, it will be applied to | 
| 62     # solutions[0].custom_vars['custom_var_name'] | 62     # solutions[0].custom_vars['custom_var_name'] | 
| 63     parent_got_revision_mapping = Dict(hidden=True), | 63     parent_got_revision_mapping = Dict(hidden=True), | 
| 64     delete_unversioned_trees = Single(bool, empty_val=True, required=False), | 64     delete_unversioned_trees = Single(bool, empty_val=True, required=False), | 
| 65 | 65 | 
|  | 66     # Maps patch_project to (solution/path, revision). | 
|  | 67     #  - solution/path is then used to apply patches as patch root in | 
|  | 68     #    bot_update. | 
|  | 69     #  - if revision is given, it's passed verbatim to bot_update for | 
|  | 70     #    corresponding dependency. | 
|  | 71     # This is essentially a whitelist of which projects inside a solution | 
|  | 72     # can be patched automatically by bot_update based on PATCH_PROJECT | 
|  | 73     # property. | 
|  | 74     # For example, bare chromium solution has this entry in patch_projects | 
|  | 75     #     'angle/angle': ('src/third_party/angle', 'HEAD') | 
|  | 76     # then a patch to Angle project can be applied to a chromium src's | 
|  | 77     # checkout after first updating Angle's repo to its master's HEAD. | 
|  | 78     patch_projects = Dict(value_type=tuple, hidden=True), | 
|  | 79 | 
| 66     # Check out refs/branch-heads. | 80     # Check out refs/branch-heads. | 
| 67     # TODO (machenbach): Only implemented for bot_update atm. | 81     # TODO (machenbach): Only implemented for bot_update atm. | 
| 68     with_branch_heads = Single( | 82     with_branch_heads = Single( | 
| 69         bool, | 83         bool, | 
| 70         empty_val=False, | 84         empty_val=False, | 
| 71         required=False, | 85         required=False, | 
| 72         hidden=True), | 86         hidden=True), | 
| 73 | 87 | 
| 74     GIT_MODE = Static(bool(GIT_MODE)), | 88     GIT_MODE = Static(bool(GIT_MODE)), | 
| 75     USE_MIRROR = Static(bool(USE_MIRROR)), | 89     USE_MIRROR = Static(bool(USE_MIRROR)), | 
|  | 90     # TODO(tandrii): remove PATCH_PROJECT field. | 
|  | 91     # DON'T USE THIS. WILL BE REMOVED. | 
| 76     PATCH_PROJECT = Static(str(PATCH_PROJECT), hidden=True), | 92     PATCH_PROJECT = Static(str(PATCH_PROJECT), hidden=True), | 
| 77     BUILDSPEC_VERSION= Static(BUILDSPEC_VERSION, hidden=True), | 93     BUILDSPEC_VERSION= Static(BUILDSPEC_VERSION, hidden=True), | 
| 78   ) | 94   ) | 
| 79 | 95 | 
| 80 config_ctx = config_item_context(BaseConfig) | 96 config_ctx = config_item_context(BaseConfig) | 
| 81 | 97 | 
| 82 def ChromiumSvnSubURL(c, *pieces): | 98 def ChromiumSvnSubURL(c, *pieces): | 
| 83   BASES = ('https://src.chromium.org', | 99   BASES = ('https://src.chromium.org', | 
| 84            'svn://svn-mirror.golo.chromium.org') | 100            'svn://svn-mirror.golo.chromium.org') | 
| 85   return '/'.join((BASES[c.USE_MIRROR],) + pieces) | 101   return '/'.join((BASES[c.USE_MIRROR],) + pieces) | 
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 139   m['src/third_party/webrtc'] = 'got_webrtc_revision' | 155   m['src/third_party/webrtc'] = 'got_webrtc_revision' | 
| 140 | 156 | 
| 141   p = c.parent_got_revision_mapping | 157   p = c.parent_got_revision_mapping | 
| 142   p['parent_got_revision'] = None | 158   p['parent_got_revision'] = None | 
| 143   p['parent_got_angle_revision'] = 'angle_revision' | 159   p['parent_got_angle_revision'] = 'angle_revision' | 
| 144   p['parent_got_nacl_revision'] = 'nacl_revision' | 160   p['parent_got_nacl_revision'] = 'nacl_revision' | 
| 145   p['parent_got_swarming_client_revision'] = 'swarming_revision' | 161   p['parent_got_swarming_client_revision'] = 'swarming_revision' | 
| 146   p['parent_got_v8_revision'] = 'v8_revision' | 162   p['parent_got_v8_revision'] = 'v8_revision' | 
| 147   p['parent_got_webrtc_revision'] = 'webrtc_revision' | 163   p['parent_got_webrtc_revision'] = 'webrtc_revision' | 
| 148 | 164 | 
| 149   # Patch project revisions are applied whenever patch_project is set. E.g. if | 165   p = c.patch_projects | 
| 150   # a v8 stand-alone patch is sent to a chromium trybot, patch_project is v8 | 166   p['v8'] = ('src/v8', 'HEAD') | 
| 151   # and can be used to sync v8 to HEAD instead of the pinned chromium | 167   p['angle/angle'] = ('src/third_party/angle', None) | 
| 152   # version. | 168   p['blink'] = ('src/third_party/WebKit', None) | 
| 153   patch_project_revisions = { |  | 
| 154     'v8': ('src/v8', 'HEAD'), |  | 
| 155   } |  | 
| 156 |  | 
| 157   patch_revision = patch_project_revisions.get(c.PATCH_PROJECT) |  | 
| 158   # TODO(phajdan.jr): Move to proper repo and add coverage. |  | 
| 159   if patch_revision:  # pragma: no cover |  | 
| 160     c.revisions[patch_revision[0]] = patch_revision[1] |  | 
| 161 | 169 | 
| 162 @config_ctx(includes=['chromium_bare']) | 170 @config_ctx(includes=['chromium_bare']) | 
| 163 def chromium_empty(c): | 171 def chromium_empty(c): | 
| 164   c.solutions[0].deps_file = ''  # pragma: no cover | 172   c.solutions[0].deps_file = ''  # pragma: no cover | 
| 165 | 173 | 
| 166 @config_ctx(includes=['chromium_bare']) | 174 @config_ctx(includes=['chromium_bare']) | 
| 167 def chromium(c): | 175 def chromium(c): | 
| 168   s = c.solutions[0] | 176   s = c.solutions[0] | 
| 169   s.custom_deps = mirror_only(c, {}) | 177   s.custom_deps = mirror_only(c, {}) | 
| 170 | 178 | 
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 531   soln.deps_file = 'DEPS' | 539   soln.deps_file = 'DEPS' | 
| 532   soln.managed = False | 540   soln.managed = False | 
| 533 | 541 | 
| 534 @config_ctx(config_vars={'GIT_MODE': True}) | 542 @config_ctx(config_vars={'GIT_MODE': True}) | 
| 535 def infra(c): | 543 def infra(c): | 
| 536   soln = c.solutions.add() | 544   soln = c.solutions.add() | 
| 537   soln.name = 'infra' | 545   soln.name = 'infra' | 
| 538   soln.url = 'https://chromium.googlesource.com/infra/infra.git' | 546   soln.url = 'https://chromium.googlesource.com/infra/infra.git' | 
| 539   c.got_revision_mapping['infra'] = 'got_revision' | 547   c.got_revision_mapping['infra'] = 'got_revision' | 
| 540 | 548 | 
|  | 549   p = c.patch_projects | 
|  | 550   p['luci-py'] = ('infra/luci', 'HEAD') | 
|  | 551   p['recipes-py'] = ('infra/recipes-py', 'HEAD') | 
|  | 552 | 
| 541 @config_ctx(config_vars={'GIT_MODE': True}) | 553 @config_ctx(config_vars={'GIT_MODE': True}) | 
| 542 def infra_internal(c):  # pragma: no cover | 554 def infra_internal(c):  # pragma: no cover | 
| 543   soln = c.solutions.add() | 555   soln = c.solutions.add() | 
| 544   soln.name = 'infra_internal' | 556   soln.name = 'infra_internal' | 
| 545   soln.url = 'https://chrome-internal.googlesource.com/infra/infra_internal.git' | 557   soln.url = 'https://chrome-internal.googlesource.com/infra/infra_internal.git' | 
| 546   c.got_revision_mapping['infra_internal'] = 'got_revision' | 558   c.got_revision_mapping['infra_internal'] = 'got_revision' | 
| 547 | 559 | 
| 548 @config_ctx(includes=['infra']) | 560 @config_ctx(includes=['infra']) | 
| 549 def luci_gae(c): | 561 def luci_gae(c): | 
| 550   # luci/gae is checked out as a part of infra.git solution at HEAD. | 562   # luci/gae is checked out as a part of infra.git solution at HEAD. | 
| (...skipping 14 matching lines...) Expand all  Loading... | 
| 565       gclient_api.RevisionFallbackChain('origin/master')) | 577       gclient_api.RevisionFallbackChain('origin/master')) | 
| 566   m = c.got_revision_mapping | 578   m = c.got_revision_mapping | 
| 567   del m['infra'] | 579   del m['infra'] | 
| 568   m['infra/go/src/github.com/luci/luci-go'] = 'got_revision' | 580   m['infra/go/src/github.com/luci/luci-go'] = 'got_revision' | 
| 569 | 581 | 
| 570 @config_ctx(includes=['infra']) | 582 @config_ctx(includes=['infra']) | 
| 571 def luci_py(c): | 583 def luci_py(c): | 
| 572   # luci-py is checked out as part of infra just to have appengine | 584   # luci-py is checked out as part of infra just to have appengine | 
| 573   # pre-installed, as that's what luci-py PRESUBMIT relies on. | 585   # pre-installed, as that's what luci-py PRESUBMIT relies on. | 
| 574   c.revisions['infra'] = 'origin/master' | 586   c.revisions['infra'] = 'origin/master' | 
|  | 587   # TODO(tandrii): make use of c.patch_projects. | 
| 575   c.revisions['infra/luci'] = ( | 588   c.revisions['infra/luci'] = ( | 
| 576       gclient_api.RevisionFallbackChain('origin/master')) | 589       gclient_api.RevisionFallbackChain('origin/master')) | 
| 577   m = c.got_revision_mapping | 590   m = c.got_revision_mapping | 
| 578   del m['infra'] | 591   del m['infra'] | 
| 579   m['infra/luci'] = 'got_revision' | 592   m['infra/luci'] = 'got_revision' | 
| 580 | 593 | 
| 581 @config_ctx(includes=['infra']) | 594 @config_ctx(includes=['infra']) | 
| 582 def recipes_py(c): | 595 def recipes_py(c): | 
| 583   c.revisions['infra'] = 'origin/master' | 596   c.revisions['infra'] = 'origin/master' | 
|  | 597   # TODO(tandrii): make use of c.patch_projects. | 
| 584   c.revisions['infra/recipes-py'] = ( | 598   c.revisions['infra/recipes-py'] = ( | 
| 585       gclient_api.RevisionFallbackChain('origin/master')) | 599       gclient_api.RevisionFallbackChain('origin/master')) | 
| 586   m = c.got_revision_mapping | 600   m = c.got_revision_mapping | 
| 587   del m['infra'] | 601   del m['infra'] | 
| 588   m['infra/recipes-py'] = 'got_revision' | 602   m['infra/recipes-py'] = 'got_revision' | 
| 589 | 603 | 
| 590 @config_ctx() | 604 @config_ctx() | 
| 591 def chrome_from_buildspec(c):  # pragma: no cover | 605 def chrome_from_buildspec(c):  # pragma: no cover | 
| 592   soln = c.solutions.add() | 606   soln = c.solutions.add() | 
| 593   soln.name = 'chrome_from_buildspec' | 607   soln.name = 'chrome_from_buildspec' | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 627               'GoogleChrome/custom-tabs-client.git') | 641               'GoogleChrome/custom-tabs-client.git') | 
| 628   c.got_revision_mapping['custom_tabs_client'] = 'got_revision' | 642   c.got_revision_mapping['custom_tabs_client'] = 'got_revision' | 
| 629 | 643 | 
| 630 # TODO(phajdan.jr): Move to proper repo and add coverage. | 644 # TODO(phajdan.jr): Move to proper repo and add coverage. | 
| 631 @config_ctx() | 645 @config_ctx() | 
| 632 def angle_top_of_tree(c):  # pragma: no cover | 646 def angle_top_of_tree(c):  # pragma: no cover | 
| 633   """Configures the top-of-tree ANGLE in a Chromium checkout. | 647   """Configures the top-of-tree ANGLE in a Chromium checkout. | 
| 634 | 648 | 
| 635   Sets up ToT instead of the DEPS-pinned revision for ANGLE. | 649   Sets up ToT instead of the DEPS-pinned revision for ANGLE. | 
| 636   """ | 650   """ | 
|  | 651   # TODO(tandrii): I think patch_projects in bare_chromium fixed this. | 
| 637   c.solutions[0].revision = 'HEAD' | 652   c.solutions[0].revision = 'HEAD' | 
| 638   c.revisions['src/third_party/angle'] = 'HEAD' | 653   c.revisions['src/third_party/angle'] = 'HEAD' | 
| 639 | 654 | 
| 640 @config_ctx() | 655 @config_ctx() | 
| 641 def gerrit_test_cq_normal(c): | 656 def gerrit_test_cq_normal(c): | 
| 642   soln = c.solutions.add() | 657   soln = c.solutions.add() | 
| 643   soln.name = 'gerrit-test-cq-normal' | 658   soln.name = 'gerrit-test-cq-normal' | 
| 644   soln.url = 'https://chromium.googlesource.com/playground/gerrit-cq/normal.git' | 659   soln.url = 'https://chromium.googlesource.com/playground/gerrit-cq/normal.git' | 
| 645 | 660 | 
| 646 # TODO(phajdan.jr): Move to proper repo and add coverage. | 661 # TODO(phajdan.jr): Move to proper repo and add coverage. | 
| 647 @config_ctx() | 662 @config_ctx() | 
| 648 def valgrind(c):  # pragma: no cover | 663 def valgrind(c):  # pragma: no cover | 
| 649   """Add Valgrind binaries to the gclient solution.""" | 664   """Add Valgrind binaries to the gclient solution.""" | 
| 650   c.solutions[0].custom_deps['src/third_party/valgrind'] = \ | 665   c.solutions[0].custom_deps['src/third_party/valgrind'] = \ | 
| 651     ChromiumGitURL(c, 'chromium', 'deps', 'valgrind', 'binaries') | 666     ChromiumGitURL(c, 'chromium', 'deps', 'valgrind', 'binaries') | 
| OLD | NEW | 
|---|