diff options
author | Mikhail Borisov <borisov.mikhail@gmail.com> | 2022-02-10 16:45:40 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:40 +0300 |
commit | 5d50718e66d9c037dc587a0211110b7d25a66185 (patch) | |
tree | e98df59de24d2ef7c77baed9f41e4875a2fef972 /build/scripts | |
parent | a6a92afe03e02795227d2641b49819b687f088f8 (diff) | |
download | ydb-5d50718e66d9c037dc587a0211110b7d25a66185.tar.gz |
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'build/scripts')
-rw-r--r-- | build/scripts/find_time_trace.py | 34 | ||||
-rw-r--r-- | build/scripts/gen_yql_python_udf.py | 56 | ||||
-rw-r--r-- | build/scripts/link_dyn_lib.py | 42 | ||||
-rw-r--r-- | build/scripts/link_exe.py | 28 | ||||
-rwxr-xr-x | build/scripts/py_compile.py | 32 |
5 files changed, 96 insertions, 96 deletions
diff --git a/build/scripts/find_time_trace.py b/build/scripts/find_time_trace.py index 3eb0854403..954d203caa 100644 --- a/build/scripts/find_time_trace.py +++ b/build/scripts/find_time_trace.py @@ -1,17 +1,17 @@ -import os -import sys - -# /scripts/find_time_trace.py <object_file> <destination> -# clang generates `-ftime-trace` output file path based on main output file path - - -def main(): - assert len(sys.argv) == 3 - obj_path = sys.argv[1] - trace_path = sys.argv[2] - orig_trace_path = obj_path.rpartition('.o')[0] + '.json' - os.rename(orig_trace_path, trace_path) - - -if __name__ == '__main__': - main() +import os +import sys + +# /scripts/find_time_trace.py <object_file> <destination> +# clang generates `-ftime-trace` output file path based on main output file path + + +def main(): + assert len(sys.argv) == 3 + obj_path = sys.argv[1] + trace_path = sys.argv[2] + orig_trace_path = obj_path.rpartition('.o')[0] + '.json' + os.rename(orig_trace_path, trace_path) + + +if __name__ == '__main__': + main() diff --git a/build/scripts/gen_yql_python_udf.py b/build/scripts/gen_yql_python_udf.py index 5613f58366..13b5898117 100644 --- a/build/scripts/gen_yql_python_udf.py +++ b/build/scripts/gen_yql_python_udf.py @@ -1,18 +1,18 @@ -import sys - -TEMPLATE=""" +import sys + +TEMPLATE=""" #include <yql/udfs/common/python/python_udf/python_udf.h> - + #include <ydb/library/yql/public/udf/udf_registrator.h> - + #if @WITH_LIBRA@ #include <yql/udfs/quality/libra/module/module.h> #endif -using namespace NKikimr::NUdf; - -#ifdef BUILD_UDF - +using namespace NKikimr::NUdf; + +#ifdef BUILD_UDF + #if @WITH_LIBRA@ LIBRA_MODULE(TLibraModule, "Libra@MODULE_NAME@"); #endif @@ -23,7 +23,7 @@ extern "C" UDF_API void Register(IRegistrator& registrator, ui32 flags) { RegisterHelper<TLibraModule>(registrator); #endif } - + extern "C" UDF_API ui32 AbiVersion() { return CurrentAbiVersion(); } @@ -32,24 +32,24 @@ extern "C" UDF_API void SetBackTraceCallback(TBackTraceCallback callback) { SetBackTraceCallbackImpl(callback); } -#endif -""" - - -def main(): +#endif +""" + + +def main(): assert len(sys.argv) == 6 flavor, module_name, package_name, path, libra_flag = sys.argv[1:] - with open(path, 'w') as f: - f.write( - TEMPLATE - .strip() - .replace('@MODULE_NAME@', module_name) - .replace('@PACKAGE_NAME@', package_name) - .replace('@FLAVOR@', flavor) + with open(path, 'w') as f: + f.write( + TEMPLATE + .strip() + .replace('@MODULE_NAME@', module_name) + .replace('@PACKAGE_NAME@', package_name) + .replace('@FLAVOR@', flavor) .replace('@WITH_LIBRA@', libra_flag) - ) - f.write('\n') - - -if __name__ == "__main__": - main() + ) + f.write('\n') + + +if __name__ == "__main__": + main() diff --git a/build/scripts/link_dyn_lib.py b/build/scripts/link_dyn_lib.py index ddd3d6d658..23487f5c1e 100644 --- a/build/scripts/link_dyn_lib.py +++ b/build/scripts/link_dyn_lib.py @@ -4,19 +4,19 @@ import subprocess import tempfile import collections import optparse -import pipes +import pipes from process_whole_archive_option import ProcessWholeArchiveOption -def shlex_join(cmd): - # equivalent to shlex.join() in python 3 - return ' '.join( - pipes.quote(part) - for part in cmd - ) - - +def shlex_join(cmd): + # equivalent to shlex.join() in python 3 + return ' '.join( + pipes.quote(part) + for part in cmd + ) + + def parse_export_file(p): with open(p, 'r') as f: for l in f: @@ -165,7 +165,7 @@ def parse_args(): parser.add_option('--target') parser.add_option('--soname') parser.add_option('--fix-elf') - parser.add_option('--linker-output') + parser.add_option('--linker-output') parser.add_option('--musl', action='store_true') parser.add_option('--whole-archive-peers', action='append') parser.add_option('--whole-archive-libs', action='append') @@ -180,18 +180,18 @@ if __name__ == '__main__': cmd = fix_cmd(opts.arch, opts.musl, args) cmd = ProcessWholeArchiveOption(opts.arch, opts.whole_archive_peers, opts.whole_archive_libs).construct_cmd(cmd) - - if opts.linker_output: - stdout = open(opts.linker_output, 'w') - else: - stdout = sys.stdout - - proc = subprocess.Popen(cmd, shell=False, stderr=sys.stderr, stdout=stdout) + + if opts.linker_output: + stdout = open(opts.linker_output, 'w') + else: + stdout = sys.stdout + + proc = subprocess.Popen(cmd, shell=False, stderr=sys.stderr, stdout=stdout) proc.communicate() if proc.returncode: - print >>sys.stderr, 'linker has failed with retcode:', proc.returncode - print >>sys.stderr, 'linker command:', shlex_join(cmd) + print >>sys.stderr, 'linker has failed with retcode:', proc.returncode + print >>sys.stderr, 'linker command:', shlex_join(cmd) sys.exit(proc.returncode) if opts.fix_elf: @@ -200,8 +200,8 @@ if __name__ == '__main__': proc.communicate() if proc.returncode: - print >>sys.stderr, 'fix_elf has failed with retcode:', proc.returncode - print >>sys.stderr, 'fix_elf command:', shlex_join(cmd) + print >>sys.stderr, 'fix_elf has failed with retcode:', proc.returncode + print >>sys.stderr, 'fix_elf command:', shlex_join(cmd) sys.exit(proc.returncode) if opts.soname and opts.soname != opts.target: diff --git a/build/scripts/link_exe.py b/build/scripts/link_exe.py index ff0f63337e..f469e3b442 100644 --- a/build/scripts/link_exe.py +++ b/build/scripts/link_exe.py @@ -51,7 +51,7 @@ def parse_args(): parser.add_option('--python') parser.add_option('--source-root') parser.add_option('--arch') - parser.add_option('--linker-output') + parser.add_option('--linker-output') parser.add_option('--whole-archive-peers', action='append') parser.add_option('--whole-archive-libs', action='append') return parser.parse_args() @@ -59,24 +59,24 @@ def parse_args(): if __name__ == '__main__': opts, args = parse_args() - + cmd = fix_cmd(opts.musl, args) cmd = ProcessWholeArchiveOption(opts.arch, opts.whole_archive_peers, opts.whole_archive_libs).construct_cmd(cmd) - + if opts.custom_step: assert opts.python subprocess.check_call([opts.python] + [opts.custom_step] + args) - - supp, cmd = get_leaks_suppressions(cmd) - if supp: + + supp, cmd = get_leaks_suppressions(cmd) + if supp: src_file = "default_suppressions.cpp" gen_default_suppressions(supp, src_file, opts.source_root) - cmd += [src_file] - - if opts.linker_output: - stdout = open(opts.linker_output, 'w') - else: - stdout = sys.stdout - - rc = subprocess.call(cmd, shell=False, stderr=sys.stderr, stdout=stdout) + cmd += [src_file] + + if opts.linker_output: + stdout = open(opts.linker_output, 'w') + else: + stdout = sys.stdout + + rc = subprocess.call(cmd, shell=False, stderr=sys.stderr, stdout=stdout) sys.exit(rc) diff --git a/build/scripts/py_compile.py b/build/scripts/py_compile.py index 5e80045062..936dbe8816 100755 --- a/build/scripts/py_compile.py +++ b/build/scripts/py_compile.py @@ -1,24 +1,24 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from __future__ import print_function, absolute_import, division - -import marshal -import sys - - -def main(): +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from __future__ import print_function, absolute_import, division + +import marshal +import sys + + +def main(): srcpathx, in_fname, out_fname = sys.argv[1:] srcpath = srcpathx[:-1] with open(in_fname, 'r') as in_file: - source = in_file.read() + source = in_file.read() code = compile(source, srcpath, 'exec', dont_inherit=True) with open(out_fname, 'wb') as out_file: - marshal.dump(code, out_file) - - -if __name__ == "__main__": - main() + marshal.dump(code, out_file) + + +if __name__ == "__main__": + main() |