Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: scripts/slave/recipes/chromium_gn_upload.py

Issue 2033513002: recipes: Switch from 3 ways for requesting clobber builds to 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build@master
Patch Set: presubmit2 Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 from recipe_engine.types import freeze 5 from recipe_engine.types import freeze
6 6
7 DEPS = [ 7 DEPS = [
8 'depot_tools/bot_update', 8 'depot_tools/bot_update',
9 'chromium', 9 'chromium',
10 'file', 10 'file',
11 'gsutil', 11 'gsutil',
12 'recipe_engine/path', 12 'recipe_engine/path',
13 'recipe_engine/platform', 13 'recipe_engine/platform',
14 'recipe_engine/properties', 14 'recipe_engine/properties',
15 'recipe_engine/python', 15 'recipe_engine/python',
16 'recipe_engine/step', 16 'recipe_engine/step',
17 ] 17 ]
18 18
19 19
20 BUILDERS = freeze({ 20 BUILDERS = freeze({
21 'tryserver.chromium.linux': { 21 'tryserver.chromium.linux': {
22 'builders': { 22 'builders': {
23 'linux_chromium_gn_upload': { 23 'linux_chromium_gn_upload': {
24 'chromium_config_kwargs': { 24 'chromium_config_kwargs': {
25 'BUILD_CONFIG': 'Release', 25 'BUILD_CONFIG': 'Release',
26 'TARGET_PLATFORM': 'linux', 26 'TARGET_PLATFORM': 'linux',
27 'TARGET_BITS': 64, 27 'TARGET_BITS': 64,
28 }, 28 },
29 'chromium_apply_config': ['clobber'],
29 30
30 # We need this to pull the Linux sysroots. 31 # We need this to pull the Linux sysroots.
31 'gclient_apply_config': ['chrome_internal'], 32 'gclient_apply_config': ['chrome_internal'],
32 }, 33 },
33 }, 34 },
34 }, 35 },
35 'tryserver.chromium.mac': { 36 'tryserver.chromium.mac': {
36 'builders': { 37 'builders': {
37 'mac_chromium_gn_upload': { 38 'mac_chromium_gn_upload': {
38 'chromium_config_kwargs': { 39 'chromium_config_kwargs': {
39 'BUILD_CONFIG': 'Release', 40 'BUILD_CONFIG': 'Release',
40 'TARGET_PLATFORM': 'mac', 41 'TARGET_PLATFORM': 'mac',
41 'TARGET_BITS': 64, 42 'TARGET_BITS': 64,
42 }, 43 },
44 'chromium_apply_config': ['clobber'],
43 }, 45 },
44 }, 46 },
45 }, 47 },
46 'tryserver.chromium.win': { 48 'tryserver.chromium.win': {
47 'builders': { 49 'builders': {
48 'win8_chromium_gn_upload': { 50 'win8_chromium_gn_upload': {
49 'chromium_config_kwargs': { 51 'chromium_config_kwargs': {
50 'BUILD_CONFIG': 'Release', 52 'BUILD_CONFIG': 'Release',
51 'TARGET_PLATFORM': 'win', 53 'TARGET_PLATFORM': 'win',
52 'TARGET_BITS': 32, 54 'TARGET_BITS': 32,
53 }, 55 },
56 'chromium_apply_config': ['clobber'],
54 }, 57 },
55 }, 58 },
56 }, 59 },
57 }) 60 })
58 61
59 62
60 def RunSteps(api): 63 def RunSteps(api):
61 mastername = api.m.properties['mastername'] 64 mastername = api.m.properties['mastername']
62 buildername, bot_config = api.chromium.configure_bot(BUILDERS, 65 buildername, bot_config = api.chromium.configure_bot(BUILDERS,
63 ['gn_for_uploads', 'mb']) 66 ['gn_for_uploads', 'mb'])
64 67
65 api.bot_update.ensure_checkout( 68 api.bot_update.ensure_checkout(
66 force=True, patch_root=bot_config.get('root_override')) 69 force=True, patch_root=bot_config.get('root_override'))
67 70
68 api.chromium.runhooks() 71 api.chromium.runhooks()
69 72
70 api.chromium.run_mb(mastername, buildername) 73 api.chromium.run_mb(mastername, buildername)
71 74
72 api.chromium.compile(targets=['gn', 'gn_unittests'], force_clobber=True) 75 api.chromium.compile(targets=['gn', 'gn_unittests'])
73 76
74 path_to_binary = str(api.path['checkout'].join('out', 'Release', 'gn')) 77 path_to_binary = str(api.path['checkout'].join('out', 'Release', 'gn'))
75 if api.platform.is_win: 78 if api.platform.is_win:
76 path_to_binary += '.exe' 79 path_to_binary += '.exe'
77 80
78 api.step('gn version', [path_to_binary, '--version']) 81 api.step('gn version', [path_to_binary, '--version'])
79 82
80 api.chromium.runtest('gn_unittests') 83 api.chromium.runtest('gn_unittests')
81 84
82 if not api.platform.is_win: 85 if not api.platform.is_win:
83 api.m.step('gn strip', cmd=['strip', path_to_binary]) 86 api.m.step('gn strip', cmd=['strip', path_to_binary])
84 87
85 api.python('upload', 88 api.python('upload',
86 api.path['depot_tools'].join('upload_to_google_storage.py'), 89 api.path['depot_tools'].join('upload_to_google_storage.py'),
87 ['-b', 'chromium-gn', path_to_binary]) 90 ['-b', 'chromium-gn', path_to_binary])
88 91
89 sha1 = api.file.read('gn sha1', path_to_binary + '.sha1', 92 sha1 = api.file.read('gn sha1', path_to_binary + '.sha1',
90 test_data='0123456789abcdeffedcba987654321012345678') 93 test_data='0123456789abcdeffedcba987654321012345678')
91 api.step.active_result.presentation.step_text = sha1 94 api.step.active_result.presentation.step_text = sha1
92 95
93 96
94 def GenTests(api): 97 def GenTests(api):
95 for test in api.chromium.gen_tests_for_builders(BUILDERS): 98 for test in api.chromium.gen_tests_for_builders(BUILDERS):
96 yield test 99 yield test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698