diff options
author | snermolaev <snermolaev@yandex-team.com> | 2023-09-21 10:59:51 +0300 |
---|---|---|
committer | snermolaev <snermolaev@yandex-team.com> | 2023-09-21 11:25:07 +0300 |
commit | 93cc1f8094de90bc9e0b24003fc776a3672d6923 (patch) | |
tree | 563eab62ec4c6adb8b77fdf101a4b2d2daef963b /build/ymake_conf.py | |
parent | f01adafb135b478b97c1d0fb7acc0073f37d7570 (diff) | |
download | ydb-93cc1f8094de90bc9e0b24003fc776a3672d6923.tar.gz |
ymake_conf.py customization point
Возвращаю реверт https://a.yandex-team.ru/arcadia/commit/rXXXXXX, только без переноса настроек Perl в custom_conf.py и с исправлением бага для DummyConf (удалил лишний параметр в конструкторе).
Diffstat (limited to 'build/ymake_conf.py')
-rwxr-xr-x | build/ymake_conf.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/build/ymake_conf.py b/build/ymake_conf.py index 7d13fceeab..3d1f05e074 100755 --- a/build/ymake_conf.py +++ b/build/ymake_conf.py @@ -2519,9 +2519,37 @@ class CuDNN(object): self.cudnn_version.emit() +def customization(): + if not is_positive('DISABLE_YMAKE_CONF_CUSTOMIZATION'): + try: + sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'internal')) + from custom_conf import CustomConf + logger.debug('Customization extension was successfully loaded') + return CustomConf + except Exception as e: + logger.debug('Customization extension was not found; [{}]'.format(str(e))) + else: + logger.debug('Customization extension was disabled') + + class DummyConf: + def __init__(self, options): + pass + + def print_prologue(self): + pass + + def print_epilogue(self): + pass + + return DummyConf + + def main(): options = opts() + CustomConfig = customization() + custom_conf = CustomConfig(options) + arcadia = Arcadia(options.arcadia_root) ymake = YMake(arcadia) @@ -2533,12 +2561,16 @@ def main(): if internal_conf_full_path and not is_positive('DISABLE_YMAKE_CONF_CUSTOMIZATION'): print('@import "${{CONF_ROOT}}/{}"'.format(_INTERNAL_CONF)) + custom_conf.print_prologue() + ymake.print_presets() ymake.print_settings() build = Build(arcadia, options.build_type, options.toolchain_params, force_ignore_local_files=not options.local_distbuild) build.print_build() + custom_conf.print_epilogue() + emit_with_ignore_comment('CONF_SCRIPT_DEPENDS', __file__) |