Chromium Code Reviews| 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 12 matching lines...) Expand all Loading... | |
| 23 deps_file = Single(basestring, empty_val=deps, required=False, | 23 deps_file = Single(basestring, empty_val=deps, required=False, |
| 24 hidden=False), | 24 hidden=False), |
| 25 managed = Single(bool, empty_val=True, required=False, hidden=False), | 25 managed = Single(bool, empty_val=True, required=False, hidden=False), |
| 26 custom_deps = Dict(value_type=(basestring, types.NoneType)), | 26 custom_deps = Dict(value_type=(basestring, types.NoneType)), |
| 27 custom_vars = Dict(value_type=basestring), | 27 custom_vars = Dict(value_type=basestring), |
| 28 safesync_url = Single(basestring, required=False), | 28 safesync_url = Single(basestring, required=False), |
| 29 | 29 |
| 30 revision = Single( | 30 revision = Single( |
| 31 (basestring, gclient_api.RevisionResolver), | 31 (basestring, gclient_api.RevisionResolver), |
| 32 required=False, hidden=True), | 32 required=False, hidden=True), |
| 33 | |
| 34 # Maps patch_project to (solution, revision). | |
| 35 # - solution is used also as patch root. | |
| 36 # - if revision is given, it's passed to bot_update. | |
| 37 # This is essentially a whitelist of which projects inside a solution | |
| 38 # can be patched automatically by bot_update based on PATCH_PROJECT | |
| 39 # property. | |
| 40 # For example, bare chromium solution has this entry in patch_projects | |
| 41 # 'v8': ('v8', 'HEAD') | |
|
Michael Achenbach
2016/04/25 09:32:42
Stay in sync with below (includes src). Maybe prov
tandrii(chromium)
2016/04/25 11:39:50
Done.
| |
| 42 # then a v8 patch can be applied on a chromium checkout after synching v 8 | |
| 43 # to it's master HEAD. | |
| 44 patch_projects = Dict(value_type=tuple), | |
| 33 ) | 45 ) |
| 34 ), | 46 ), |
| 35 deps_os = Dict(value_type=basestring), | 47 deps_os = Dict(value_type=basestring), |
| 36 hooks = List(basestring), | 48 hooks = List(basestring), |
| 37 target_os = Set(basestring), | 49 target_os = Set(basestring), |
| 38 target_os_only = Single(bool, empty_val=False, required=False), | 50 target_os_only = Single(bool, empty_val=False, required=False), |
| 39 cache_dir = Static(cache_dir, hidden=False), | 51 cache_dir = Static(cache_dir, hidden=False), |
| 40 | 52 |
| 41 # If supplied, use this as the source root (instead of the first solution's | 53 # If supplied, use this as the source root (instead of the first solution's |
| 42 # checkout). | 54 # checkout). |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 m['src/third_party/webrtc'] = 'got_webrtc_revision' | 151 m['src/third_party/webrtc'] = 'got_webrtc_revision' |
| 140 | 152 |
| 141 p = c.parent_got_revision_mapping | 153 p = c.parent_got_revision_mapping |
| 142 p['parent_got_revision'] = None | 154 p['parent_got_revision'] = None |
| 143 p['parent_got_angle_revision'] = 'angle_revision' | 155 p['parent_got_angle_revision'] = 'angle_revision' |
| 144 p['parent_got_nacl_revision'] = 'nacl_revision' | 156 p['parent_got_nacl_revision'] = 'nacl_revision' |
| 145 p['parent_got_swarming_client_revision'] = 'swarming_revision' | 157 p['parent_got_swarming_client_revision'] = 'swarming_revision' |
| 146 p['parent_got_v8_revision'] = 'v8_revision' | 158 p['parent_got_v8_revision'] = 'v8_revision' |
| 147 p['parent_got_webrtc_revision'] = 'webrtc_revision' | 159 p['parent_got_webrtc_revision'] = 'webrtc_revision' |
| 148 | 160 |
| 149 # Patch project revisions are applied whenever patch_project is set. E.g. if | 161 p = s.patch_projects |
|
Michael Achenbach
2016/04/25 09:32:42
I'd make this global, i.e. c.patch_projects, as th
tandrii(chromium)
2016/04/25 11:39:50
Done.
| |
| 150 # a v8 stand-alone patch is sent to a chromium trybot, patch_project is v8 | 162 p['v8'] = ('src/v8', 'HEAD') |
|
tandrii(chromium)
2016/04/22 15:59:10
for gerrit, this row would be duplicated with
'v
| |
| 151 # and can be used to sync v8 to HEAD instead of the pinned chromium | 163 p['angle/angle'] = ('src/third_party/angle', None) |
|
tandrii(chromium)
2016/04/22 15:59:10
this is how gerrit looks.
| |
| 152 # version. | 164 p['blink'] = ('src/third_party/WebKit', None) |
|
tandrii(chromium)
2016/04/22 15:59:10
machenbach@ i decided to specify the the full path
Michael Achenbach
2016/04/25 09:32:42
Does blink still exist in this context? Keep it ar
tandrii(chromium)
2016/04/25 11:39:50
kept as is, but yes, i think i'll clean it up with
| |
| 153 patch_project_revisions = { | 165 # TODO(tandrii): can this be done automatically for all solutions, |
| 154 'v8': ('src/v8', 'HEAD'), | 166 # instead of copy-pasting these 3 lines to very solution? |
| 155 } | 167 # If so, remove occurrencies in this file. |
| 156 | 168 path, revision = s.patch_projects.get(c.PATCH_PROJECT, (None, None)) |
|
Michael Achenbach
2016/04/25 09:32:42
Move to bot_update ensure_checkout and maybe to gc
tandrii(chromium)
2016/04/25 11:39:50
Done.
| |
| 157 patch_revision = patch_project_revisions.get(c.PATCH_PROJECT) | 169 if path and revision: |
| 158 # TODO(phajdan.jr): Move to proper repo and add coverage. | 170 c.revisions[path] = revision |
| 159 if patch_revision: # pragma: no cover | |
| 160 c.revisions[patch_revision[0]] = patch_revision[1] | |
| 161 | 171 |
| 162 @config_ctx(includes=['chromium_bare']) | 172 @config_ctx(includes=['chromium_bare']) |
| 163 def chromium_empty(c): | 173 def chromium_empty(c): |
| 164 c.solutions[0].deps_file = '' # pragma: no cover | 174 c.solutions[0].deps_file = '' # pragma: no cover |
| 165 | 175 |
| 166 @config_ctx(includes=['chromium_bare']) | 176 @config_ctx(includes=['chromium_bare']) |
| 167 def chromium(c): | 177 def chromium(c): |
| 168 s = c.solutions[0] | 178 s = c.solutions[0] |
| 169 s.custom_deps = mirror_only(c, {}) | 179 s.custom_deps = mirror_only(c, {}) |
| 170 | 180 |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 531 soln.deps_file = 'DEPS' | 541 soln.deps_file = 'DEPS' |
| 532 soln.managed = False | 542 soln.managed = False |
| 533 | 543 |
| 534 @config_ctx(config_vars={'GIT_MODE': True}) | 544 @config_ctx(config_vars={'GIT_MODE': True}) |
| 535 def infra(c): | 545 def infra(c): |
| 536 soln = c.solutions.add() | 546 soln = c.solutions.add() |
| 537 soln.name = 'infra' | 547 soln.name = 'infra' |
| 538 soln.url = 'https://chromium.googlesource.com/infra/infra.git' | 548 soln.url = 'https://chromium.googlesource.com/infra/infra.git' |
| 539 c.got_revision_mapping['infra'] = 'got_revision' | 549 c.got_revision_mapping['infra'] = 'got_revision' |
| 540 | 550 |
| 551 p = soln.patch_projects | |
| 552 p['luci-py'] = ('infra/luci', 'HEAD') | |
| 553 p['recipes-py'] = ('infra/recipes-py', 'HEAD') | |
| 554 # TODO(tandrii): can this be done automatically for all solutions, | |
| 555 # instead of copy-pasting these 3 lines to very solution? | |
| 556 # If so, remove occurrencies in this file. | |
| 557 path, revision = soln.patch_projects.get(c.PATCH_PROJECT, (None, None)) | |
| 558 if path and revision: | |
| 559 c.revisions[path] = revision | |
| 560 | |
| 541 @config_ctx(config_vars={'GIT_MODE': True}) | 561 @config_ctx(config_vars={'GIT_MODE': True}) |
| 542 def infra_internal(c): # pragma: no cover | 562 def infra_internal(c): # pragma: no cover |
| 543 soln = c.solutions.add() | 563 soln = c.solutions.add() |
| 544 soln.name = 'infra_internal' | 564 soln.name = 'infra_internal' |
| 545 soln.url = 'https://chrome-internal.googlesource.com/infra/infra_internal.git' | 565 soln.url = 'https://chrome-internal.googlesource.com/infra/infra_internal.git' |
| 546 c.got_revision_mapping['infra_internal'] = 'got_revision' | 566 c.got_revision_mapping['infra_internal'] = 'got_revision' |
| 547 | 567 |
| 548 @config_ctx(includes=['infra']) | 568 @config_ctx(includes=['infra']) |
| 549 def luci_gae(c): | 569 def luci_gae(c): |
| 550 # luci/gae is checked out as a part of infra.git solution at HEAD. | 570 # 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')) | 585 gclient_api.RevisionFallbackChain('origin/master')) |
| 566 m = c.got_revision_mapping | 586 m = c.got_revision_mapping |
| 567 del m['infra'] | 587 del m['infra'] |
| 568 m['infra/go/src/github.com/luci/luci-go'] = 'got_revision' | 588 m['infra/go/src/github.com/luci/luci-go'] = 'got_revision' |
| 569 | 589 |
| 570 @config_ctx(includes=['infra']) | 590 @config_ctx(includes=['infra']) |
| 571 def luci_py(c): | 591 def luci_py(c): |
| 572 # luci-py is checked out as part of infra just to have appengine | 592 # 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. | 593 # pre-installed, as that's what luci-py PRESUBMIT relies on. |
| 574 c.revisions['infra'] = 'origin/master' | 594 c.revisions['infra'] = 'origin/master' |
| 595 # TODO(tandrii): make use of c.patch_projects. | |
| 575 c.revisions['infra/luci'] = ( | 596 c.revisions['infra/luci'] = ( |
| 576 gclient_api.RevisionFallbackChain('origin/master')) | 597 gclient_api.RevisionFallbackChain('origin/master')) |
| 577 m = c.got_revision_mapping | 598 m = c.got_revision_mapping |
| 578 del m['infra'] | 599 del m['infra'] |
| 579 m['infra/luci'] = 'got_revision' | 600 m['infra/luci'] = 'got_revision' |
| 580 | 601 |
| 581 @config_ctx(includes=['infra']) | 602 @config_ctx(includes=['infra']) |
| 582 def recipes_py(c): | 603 def recipes_py(c): |
| 583 c.revisions['infra'] = 'origin/master' | 604 c.revisions['infra'] = 'origin/master' |
| 605 # TODO(tandrii): make use of c.patch_projects. | |
| 584 c.revisions['infra/recipes-py'] = ( | 606 c.revisions['infra/recipes-py'] = ( |
| 585 gclient_api.RevisionFallbackChain('origin/master')) | 607 gclient_api.RevisionFallbackChain('origin/master')) |
| 586 m = c.got_revision_mapping | 608 m = c.got_revision_mapping |
| 587 del m['infra'] | 609 del m['infra'] |
| 588 m['infra/recipes-py'] = 'got_revision' | 610 m['infra/recipes-py'] = 'got_revision' |
| 589 | 611 |
| 590 @config_ctx() | 612 @config_ctx() |
| 591 def chrome_from_buildspec(c): # pragma: no cover | 613 def chrome_from_buildspec(c): # pragma: no cover |
| 592 soln = c.solutions.add() | 614 soln = c.solutions.add() |
| 593 soln.name = 'chrome_from_buildspec' | 615 soln.name = 'chrome_from_buildspec' |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 627 'GoogleChrome/custom-tabs-client.git') | 649 'GoogleChrome/custom-tabs-client.git') |
| 628 c.got_revision_mapping['custom_tabs_client'] = 'got_revision' | 650 c.got_revision_mapping['custom_tabs_client'] = 'got_revision' |
| 629 | 651 |
| 630 # TODO(phajdan.jr): Move to proper repo and add coverage. | 652 # TODO(phajdan.jr): Move to proper repo and add coverage. |
| 631 @config_ctx() | 653 @config_ctx() |
| 632 def angle_top_of_tree(c): # pragma: no cover | 654 def angle_top_of_tree(c): # pragma: no cover |
| 633 """Configures the top-of-tree ANGLE in a Chromium checkout. | 655 """Configures the top-of-tree ANGLE in a Chromium checkout. |
| 634 | 656 |
| 635 Sets up ToT instead of the DEPS-pinned revision for ANGLE. | 657 Sets up ToT instead of the DEPS-pinned revision for ANGLE. |
| 636 """ | 658 """ |
| 659 # TODO(tandrii): I think patch_projects in bare_chromium fixed this. | |
| 637 c.solutions[0].revision = 'HEAD' | 660 c.solutions[0].revision = 'HEAD' |
| 638 c.revisions['src/third_party/angle'] = 'HEAD' | 661 c.revisions['src/third_party/angle'] = 'HEAD' |
| 639 | 662 |
| 640 @config_ctx() | 663 @config_ctx() |
| 641 def gerrit_test_cq_normal(c): | 664 def gerrit_test_cq_normal(c): |
| 642 soln = c.solutions.add() | 665 soln = c.solutions.add() |
| 643 soln.name = 'gerrit-test-cq-normal' | 666 soln.name = 'gerrit-test-cq-normal' |
| 644 soln.url = 'https://chromium.googlesource.com/playground/gerrit-cq/normal.git' | 667 soln.url = 'https://chromium.googlesource.com/playground/gerrit-cq/normal.git' |
| 645 | 668 |
| 646 # TODO(phajdan.jr): Move to proper repo and add coverage. | 669 # TODO(phajdan.jr): Move to proper repo and add coverage. |
| 647 @config_ctx() | 670 @config_ctx() |
| 648 def valgrind(c): # pragma: no cover | 671 def valgrind(c): # pragma: no cover |
| 649 """Add Valgrind binaries to the gclient solution.""" | 672 """Add Valgrind binaries to the gclient solution.""" |
| 650 c.solutions[0].custom_deps['src/third_party/valgrind'] = \ | 673 c.solutions[0].custom_deps['src/third_party/valgrind'] = \ |
| 651 ChromiumGitURL(c, 'chromium', 'deps', 'valgrind', 'binaries') | 674 ChromiumGitURL(c, 'chromium', 'deps', 'valgrind', 'binaries') |
| OLD | NEW |