| OLD | NEW | 
|---|
| 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 slave.recipe_config import config_item_context, ConfigGroup | 5 from slave.recipe_config import config_item_context, ConfigGroup | 
| 6 from slave.recipe_config import Dict, Set, Single, Static | 6 from slave.recipe_config import Dict, Set, Single, Static | 
| 7 from slave.recipe_config_types import Path | 7 from slave.recipe_config_types import Path | 
| 8 from slave.skia import slaves_cfg |  | 
| 9 from common.skia import builder_name_schema | 8 from common.skia import builder_name_schema | 
| 10 | 9 | 
| 11 | 10 | 
| 12 CONFIG_DEBUG = 'Debug' | 11 CONFIG_DEBUG = 'Debug' | 
| 13 CONFIG_RELEASE = 'Release' | 12 CONFIG_RELEASE = 'Release' | 
| 14 VALID_CONFIGS = (CONFIG_DEBUG, CONFIG_RELEASE) | 13 VALID_CONFIGS = (CONFIG_DEBUG, CONFIG_RELEASE) | 
| 15 | 14 | 
| 16 | 15 | 
| 17 def BaseConfig(BUILDER_NAME, MASTER_NAME, SLAVE_NAME, **_kwargs): | 16 def BaseConfig(BUILDER_NAME, MASTER_NAME, SLAVE_NAME, **_kwargs): | 
| 18   equal_fn = lambda tup: ('%s=%s' % tup) | 17   equal_fn = lambda tup: ('%s=%s' % tup) | 
| 19   return ConfigGroup( | 18   return ConfigGroup( | 
| 20     BUILDER_NAME = Static(str(BUILDER_NAME)), | 19     BUILDER_NAME = Static(str(BUILDER_NAME)), | 
| 21     MASTER_NAME = Static(str(MASTER_NAME)), | 20     MASTER_NAME = Static(str(MASTER_NAME)), | 
| 22     SLAVE_NAME = Static(str(SLAVE_NAME)), | 21     SLAVE_NAME = Static(str(SLAVE_NAME)), | 
| 23     build_targets = Single(list), | 22     build_targets = Single(list), | 
| 24     builder_cfg = Single(dict), | 23     builder_cfg = Single(dict), | 
| 25     configuration = Single(str), | 24     configuration = Single(str), | 
| 26     do_test_steps = Single(bool), | 25     do_test_steps = Single(bool), | 
| 27     do_perf_steps = Single(bool), | 26     do_perf_steps = Single(bool), | 
| 28     extra_env_vars = Single(dict), | 27     extra_env_vars = Single(dict), | 
| 29     gyp_env = ConfigGroup( | 28     gyp_env = ConfigGroup( | 
| 30       GYP_DEFINES = Dict(equal_fn, ' '.join, (basestring,int,Path)), | 29       GYP_DEFINES = Dict(equal_fn, ' '.join, (basestring,int,Path)), | 
| 31     ), | 30     ), | 
| 32     is_trybot = Single(bool), | 31     is_trybot = Single(bool), | 
| 33     role = Single(str), | 32     role = Single(str), | 
| 34     slave_cfg = Single(dict) |  | 
| 35   ) | 33   ) | 
| 36 | 34 | 
| 37 | 35 | 
| 38 VAR_TEST_MAP = { | 36 VAR_TEST_MAP = { | 
| 39   'BUILDER_NAME': (u'Build-Ubuntu-GCC-x86_64-Debug', | 37   'BUILDER_NAME': (u'Build-Ubuntu-GCC-x86_64-Debug', | 
| 40                    u'Build-Ubuntu-GCC-x86_64-Release-Mesa', | 38                    u'Build-Ubuntu-GCC-x86_64-Release-Mesa', | 
| 41                    u'Build-Win-MSVC-x86-Release', | 39                    u'Build-Win-MSVC-x86-Release', | 
| 42                    u'Build-Win-MSVC-x86-Debug-Exceptions', | 40                    u'Build-Win-MSVC-x86-Debug-Exceptions', | 
| 43                    u'Housekeeper-PerCommit', | 41                    u'Housekeeper-PerCommit', | 
| 44                    u'Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Debug', | 42                    u'Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Debug', | 
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 98   if builder_dict.get('cpu_or_gpu') == 'CPU': | 96   if builder_dict.get('cpu_or_gpu') == 'CPU': | 
| 99     gyp_defs['skia_gpu'] = '0' | 97     gyp_defs['skia_gpu'] = '0' | 
| 100 | 98 | 
| 101   # skia_warnings_as_errors. | 99   # skia_warnings_as_errors. | 
| 102   werr = False | 100   werr = False | 
| 103   if builder_dict['role'] == builder_name_schema.BUILDER_ROLE_BUILD: | 101   if builder_dict['role'] == builder_name_schema.BUILDER_ROLE_BUILD: | 
| 104     if 'Win' in builder_dict.get('os', ''):  # pragma: no cover | 102     if 'Win' in builder_dict.get('os', ''):  # pragma: no cover | 
| 105       if not ('GDI' in builder_dict.get('extra_config', '') or | 103       if not ('GDI' in builder_dict.get('extra_config', '') or | 
| 106               'Exceptions' in builder_dict.get('extra_config', '')): | 104               'Exceptions' in builder_dict.get('extra_config', '')): | 
| 107         werr = True | 105         werr = True | 
| 108     elif 'Mac' in builder_dict.get('os', ''): |  | 
| 109       if 'iOS' in builder_dict.get('extra_config', ''):  # pragma: no cover |  | 
| 110         werr = True |  | 
| 111     else: | 106     else: | 
| 112       werr = True | 107       werr = True | 
| 113   gyp_defs['skia_warnings_as_errors'] = str(int(werr))  # True/False -> '1'/'0' | 108   gyp_defs['skia_warnings_as_errors'] = str(int(werr))  # True/False -> '1'/'0' | 
| 114 | 109 | 
| 115   # Win debugger. | 110   # Win debugger. | 
| 116   if 'Win' in builder_dict.get('os', ''): | 111   if 'Win' in builder_dict.get('os', ''): | 
| 117     gyp_defs['skia_win_debuggers_path'] = 'c:/DbgHelp' | 112     gyp_defs['skia_win_debuggers_path'] = 'c:/DbgHelp' | 
| 118 | 113 | 
| 119   # Qt SDK (Win). | 114   # Qt SDK (Win). | 
| 120   if 'Win' in builder_dict.get('os', ''): | 115   if 'Win' in builder_dict.get('os', ''): | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
| 142     gyp_defs['skia_os'] = 'ios'  # pragma: no cover | 137     gyp_defs['skia_os'] = 'ios'  # pragma: no cover | 
| 143 | 138 | 
| 144   # Shared library build. | 139   # Shared library build. | 
| 145   if builder_dict.get('extra_config') == 'Shared': | 140   if builder_dict.get('extra_config') == 'Shared': | 
| 146     gyp_defs['skia_shared_lib'] = '1'  # pragma: no cover | 141     gyp_defs['skia_shared_lib'] = '1'  # pragma: no cover | 
| 147 | 142 | 
| 148   # PDF viewer in GM. | 143   # PDF viewer in GM. | 
| 149   if (builder_dict.get('os') == 'Mac10.8' and | 144   if (builder_dict.get('os') == 'Mac10.8' and | 
| 150       builder_dict.get('arch') == 'x86_64' and | 145       builder_dict.get('arch') == 'x86_64' and | 
| 151       builder_dict.get('configuration') == 'Release'): | 146       builder_dict.get('configuration') == 'Release'): | 
| 152     gyp_defs['skia_run_pdfviewer_in_gm'] = '1'  # pragma: no cover | 147     gyp_defs['skia_run_pdfviewer_in_gm'] = '1' | 
| 153 | 148 | 
| 154   # Clang. | 149   # Clang. | 
| 155   if builder_dict.get('compiler') == 'Clang': | 150   if builder_dict.get('compiler') == 'Clang': | 
| 156     gyp_defs['skia_clang_build'] = '1'  # pragma: no cover | 151     gyp_defs['skia_clang_build'] = '1'  # pragma: no cover | 
| 157 | 152 | 
| 158   # Valgrind. | 153   # Valgrind. | 
| 159   if 'Valgrind' in builder_dict.get('extra_config', ''): | 154   if 'Valgrind' in builder_dict.get('extra_config', ''): | 
| 160     gyp_defs['skia_release_optimization_level'] = '1' | 155     gyp_defs['skia_release_optimization_level'] = '1' | 
| 161 | 156 | 
| 162   # Link-time code generation just wastes time on compile-only bots. | 157   # Link-time code generation just wastes time on compile-only bots. | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 196   if c.role == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: | 191   if c.role == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: | 
| 197     c.configuration = CONFIG_RELEASE | 192     c.configuration = CONFIG_RELEASE | 
| 198   else: | 193   else: | 
| 199     c.configuration = c.builder_cfg.get('configuration', CONFIG_DEBUG) | 194     c.configuration = c.builder_cfg.get('configuration', CONFIG_DEBUG) | 
| 200   c.do_test_steps = c.role == builder_name_schema.BUILDER_ROLE_TEST | 195   c.do_test_steps = c.role == builder_name_schema.BUILDER_ROLE_TEST | 
| 201   c.do_perf_steps = (c.role == builder_name_schema.BUILDER_ROLE_PERF or | 196   c.do_perf_steps = (c.role == builder_name_schema.BUILDER_ROLE_PERF or | 
| 202                      (c.role == builder_name_schema.BUILDER_ROLE_TEST and | 197                      (c.role == builder_name_schema.BUILDER_ROLE_TEST and | 
| 203                       c.configuration == CONFIG_DEBUG) or | 198                       c.configuration == CONFIG_DEBUG) or | 
| 204                      'Valgrind' in c.BUILDER_NAME) | 199                      'Valgrind' in c.BUILDER_NAME) | 
| 205   c.gyp_env.GYP_DEFINES.update(gyp_defs_from_builder_dict(c.builder_cfg)) | 200   c.gyp_env.GYP_DEFINES.update(gyp_defs_from_builder_dict(c.builder_cfg)) | 
| 206   c.slave_cfg = slaves_cfg.get(c.MASTER_NAME)[c.SLAVE_NAME] |  | 
| 207   c.is_trybot = builder_name_schema.IsTrybot(c.BUILDER_NAME) | 201   c.is_trybot = builder_name_schema.IsTrybot(c.BUILDER_NAME) | 
| 208   c.extra_env_vars = get_extra_env_vars(c.builder_cfg) | 202   c.extra_env_vars = get_extra_env_vars(c.builder_cfg) | 
| 209   arch = (c.builder_cfg.get('arch') or c.builder_cfg.get('target_arch')) | 203   arch = (c.builder_cfg.get('arch') or c.builder_cfg.get('target_arch')) | 
| 210   if ('Win' in c.builder_cfg.get('os', '') and arch == 'x86_64'): | 204   if ('Win' in c.builder_cfg.get('os', '') and arch == 'x86_64'): | 
| 211     c.configuration += '_x64' | 205     c.configuration += '_x64' | 
| 212 | 206 | 
| OLD | NEW | 
|---|