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

Side by Side Diff: scripts/slave/recipes/swarming/deterministic_build.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 """Recipe to test the deterministic build. 5 """Recipe to test the deterministic build.
6 6
7 Waterfall page: https://build.chromium.org/p/chromium.swarm/waterfall 7 Waterfall page: https://build.chromium.org/p/chromium.swarm/waterfall
8 8
9 """ 9 """
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 if os.path.exists(sys.argv[2]): 72 if os.path.exists(sys.argv[2]):
73 shutil.rmtree(sys.argv[2]) 73 shutil.rmtree(sys.argv[2])
74 shutil.move(sys.argv[1], sys.argv[2])""", 74 shutil.move(sys.argv[1], sys.argv[2])""",
75 args=[src_dir, dst_dir]) 75 args=[src_dir, dst_dir])
76 76
77 77
78 def ConfigureChromiumBuilder(api, recipe_config): 78 def ConfigureChromiumBuilder(api, recipe_config):
79 api.chromium.set_config(recipe_config['chromium_config'], 79 api.chromium.set_config(recipe_config['chromium_config'],
80 **recipe_config.get('chromium_config_kwargs', 80 **recipe_config.get('chromium_config_kwargs',
81 {'BUILD_CONFIG': 'Release'})) 81 {'BUILD_CONFIG': 'Release'}))
82 api.chromium.apply_config('clobber')
82 api.gclient.set_config(recipe_config['gclient_config'], 83 api.gclient.set_config(recipe_config['gclient_config'],
83 **recipe_config.get('gclient_config_kwargs', {})) 84 **recipe_config.get('gclient_config_kwargs', {}))
84 85
85 api.chromium.cleanup_temp() 86 api.chromium.cleanup_temp()
86 87
87 # Checkout chromium. 88 # Checkout chromium.
88 api.bot_update.ensure_checkout(force=True) 89 api.bot_update.ensure_checkout(force=True)
89 90
90 91
91 def ConfigureAndroidBuilder(api, recipe_config): 92 def ConfigureAndroidBuilder(api, recipe_config):
92 kwargs = { 93 kwargs = {
93 'REPO_NAME': 'src', 94 'REPO_NAME': 'src',
94 'REPO_URL': 'https://chromium.googlesource.com/chromium/src.git', 95 'REPO_URL': 'https://chromium.googlesource.com/chromium/src.git',
95 'Internal': False, 96 'Internal': False,
96 } 97 }
97 kwargs.update(recipe_config.get('chromium_config_kwargs', 98 kwargs.update(recipe_config.get('chromium_config_kwargs',
98 {'BUILD_CONFIG': 'Release'})) 99 {'BUILD_CONFIG': 'Release'}))
99 100
100 api.chromium_android.configure_from_properties( 101 api.chromium_android.configure_from_properties(
101 'base_config', **kwargs) 102 'base_config', **kwargs)
102 api.chromium.set_config('base_config', **kwargs) 103 api.chromium.set_config('base_config', **kwargs)
103 api.chromium.apply_config(recipe_config['chromium_config']) 104 api.chromium.apply_config(recipe_config['chromium_config'])
105 api.chromium.apply_config('clobber')
104 106
105 PROPERTIES = { 107 PROPERTIES = {
106 'buildername': Property(), 108 'buildername': Property(),
107 } 109 }
108 110
109 111
110 def RunSteps(api, buildername): 112 def RunSteps(api, buildername):
111 recipe_config = DETERMINISTIC_BUILDERS[buildername] 113 recipe_config = DETERMINISTIC_BUILDERS[buildername]
112 enable_isolate = True 114 enable_isolate = True
113 115
(...skipping 11 matching lines...) Expand all
125 enable_isolate = False 127 enable_isolate = False
126 ConfigureAndroidBuilder(api, recipe_config) 128 ConfigureAndroidBuilder(api, recipe_config)
127 api.chromium_android.init_and_sync() 129 api.chromium_android.init_and_sync()
128 130
129 if enable_isolate: 131 if enable_isolate:
130 # Enable test isolation. Modifies GYP_DEFINES used in 'runhooks' below. 132 # Enable test isolation. Modifies GYP_DEFINES used in 'runhooks' below.
131 api.isolate.set_isolate_environment(api.chromium.c) 133 api.isolate.set_isolate_environment(api.chromium.c)
132 134
133 # Do a first build and move the build artifact to the temp directory. 135 # Do a first build and move the build artifact to the temp directory.
134 api.chromium.runhooks() 136 api.chromium.runhooks()
135 api.chromium.compile(targets, force_clobber=True, name='First build') 137 api.chromium.compile(targets, name='First build')
136 api.isolate.remove_build_metadata() 138 api.isolate.remove_build_metadata()
137 if enable_isolate: 139 if enable_isolate:
138 # This archives the results and regenerate the .isolated files. 140 # This archives the results and regenerate the .isolated files.
139 api.isolate.isolate_tests(api.chromium.output_dir) 141 api.isolate.isolate_tests(api.chromium.output_dir)
140 MoveBuildDirectory(api, str(api.chromium.output_dir), 142 MoveBuildDirectory(api, str(api.chromium.output_dir),
141 str(api.chromium.output_dir).rstrip('\\/') + '.1') 143 str(api.chromium.output_dir).rstrip('\\/') + '.1')
142 144
143 # Do the second build and move the build artifact to the temp directory. 145 # Do the second build and move the build artifact to the temp directory.
144 api.chromium.runhooks() 146 api.chromium.runhooks()
145 api.chromium.compile(targets, force_clobber=True, name='Second build') 147 api.chromium.compile(targets, name='Second build')
146 api.isolate.remove_build_metadata() 148 api.isolate.remove_build_metadata()
147 if enable_isolate: 149 if enable_isolate:
148 # This should be quick if the build is indeed deterministic. 150 # This should be quick if the build is indeed deterministic.
149 api.isolate.isolate_tests(api.chromium.output_dir) 151 api.isolate.isolate_tests(api.chromium.output_dir)
150 MoveBuildDirectory(api, str(api.chromium.output_dir), 152 MoveBuildDirectory(api, str(api.chromium.output_dir),
151 str(api.chromium.output_dir).rstrip('\\/') + '.2') 153 str(api.chromium.output_dir).rstrip('\\/') + '.2')
152 154
153 # Compare the artifacts from the 2 builds, raise an exception if they're 155 # Compare the artifacts from the 2 builds, raise an exception if they're
154 # not equals. 156 # not equals.
155 # TODO(sebmarchand): Do a smarter comparison. 157 # TODO(sebmarchand): Do a smarter comparison.
(...skipping 13 matching lines...) Expand all
169 _sanitize_nonalpha(buildername)) 171 _sanitize_nonalpha(buildername))
170 yield ( 172 yield (
171 api.test(test_name) + 173 api.test(test_name) +
172 api.properties.scheduled() + 174 api.properties.scheduled() +
173 api.properties.generic(buildername=buildername, 175 api.properties.generic(buildername=buildername,
174 mastername=mastername) + 176 mastername=mastername) +
175 api.platform(DETERMINISTIC_BUILDERS[buildername]['platform'], 32) + 177 api.platform(DETERMINISTIC_BUILDERS[buildername]['platform'], 32) +
176 api.properties(configuration='Release') + 178 api.properties(configuration='Release') +
177 api.step_data('remove_build_metadata', retcode=1) 179 api.step_data('remove_build_metadata', retcode=1)
178 ) 180 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698