diff options
author | somov <somov@yandex-team.ru> | 2022-02-10 16:45:47 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:47 +0300 |
commit | a5950576e397b1909261050b8c7da16db58f10b1 (patch) | |
tree | 7ba7677f6a4c3e19e2cefab34d16df2c8963b4d4 /build/plugins | |
parent | 81eddc8c0b55990194e112b02d127b87d54164a9 (diff) | |
download | ydb-a5950576e397b1909261050b8c7da16db58f10b1.tar.gz |
Restoring authorship annotation for <somov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/plugins')
-rw-r--r-- | build/plugins/pybuild.py | 30 | ||||
-rw-r--r-- | build/plugins/rodata.py | 2 | ||||
-rw-r--r-- | build/plugins/swig.py | 26 |
3 files changed, 29 insertions, 29 deletions
diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py index f32a2d39a0..e75e730e7b 100644 --- a/build/plugins/pybuild.py +++ b/build/plugins/pybuild.py @@ -237,15 +237,15 @@ def onpy_srcs(unit, *args): fbss = [] py_namespaces = {} - dump_dir = unit.get('PYTHON_BUILD_DUMP_DIR') - dump_output = None - if dump_dir: - import thread - pid = os.getpid() - tid = thread.get_ident() - dump_name = '{}-{}.dump'.format(pid, tid) - dump_output = open(os.path.join(dump_dir, dump_name), 'a') - + dump_dir = unit.get('PYTHON_BUILD_DUMP_DIR') + dump_output = None + if dump_dir: + import thread + pid = os.getpid() + tid = thread.get_ident() + dump_name = '{}-{}.dump'.format(pid, tid) + dump_output = open(os.path.join(dump_dir, dump_name), 'a') + args = iter(args) for arg in args: # Namespace directives. @@ -325,9 +325,9 @@ def onpy_srcs(unit, *args): pathmod = (path, mod) - if dump_output is not None: - dump_output.write('{path}\t{module}\n'.format(path=rootrel_arc_src(path, unit), module=mod)) - + if dump_output is not None: + dump_output.write('{path}\t{module}\n'.format(path=rootrel_arc_src(path, unit), module=mod)) + if path.endswith('.py'): if cythonize_py: pyxs.append(pathmod) @@ -349,9 +349,9 @@ def onpy_srcs(unit, *args): else: ymake.report_configure_error('in PY_SRCS: unrecognized arg {!r}'.format(path)) - if dump_output is not None: - dump_output.close() - + if dump_output is not None: + dump_output.close() + if pyxs: files2res = set() # Include map stores files which were included in the processing pyx file, diff --git a/build/plugins/rodata.py b/build/plugins/rodata.py index 3ecb0f9a83..c0448d247f 100644 --- a/build/plugins/rodata.py +++ b/build/plugins/rodata.py @@ -158,7 +158,7 @@ class RODataCXX(iw.CustomCommand): def ro_data(path, unit): - if unit.enabled('ARCH_AARCH64') or unit.enabled('ARCH_ARM') or unit.enabled('ARCH_PPC64LE'): + if unit.enabled('ARCH_AARCH64') or unit.enabled('ARCH_ARM') or unit.enabled('ARCH_PPC64LE'): return RODataCXX(path, unit) return ROData(path, unit) diff --git a/build/plugins/swig.py b/build/plugins/swig.py index 32a37204a6..b9a54f5eaf 100644 --- a/build/plugins/swig.py +++ b/build/plugins/swig.py @@ -1,5 +1,5 @@ import os -import posixpath +import posixpath import re import _import_wrapper as iw @@ -12,10 +12,10 @@ def init(): class Swig(iw.CustomCommand): def __init__(self, path, unit): - self._tool = unit.get('SWIG_TOOL') - self._library_dir = unit.get('SWIG_LIBRARY') or 'contrib/tools/swig/Lib' - self._local_swig = unit.get('USE_LOCAL_SWIG') == "yes" - + self._tool = unit.get('SWIG_TOOL') + self._library_dir = unit.get('SWIG_LIBRARY') or 'contrib/tools/swig/Lib' + self._local_swig = unit.get('USE_LOCAL_SWIG') == "yes" + self._path = path self._flags = ['-cpperraswarn'] @@ -44,17 +44,17 @@ class Swig(iw.CustomCommand): lang_specific_incl_dir = 'java' incl_dirs = [ "FOR", "swig", - posixpath.join(self._library_dir, lang_specific_incl_dir), + posixpath.join(self._library_dir, lang_specific_incl_dir), "FOR", "swig", - self._library_dir + self._library_dir ] - self._incl_dirs = ['$S', '$B'] + [posixpath.join('$S', d) for d in incl_dirs] + self._incl_dirs = ['$S', '$B'] + [posixpath.join('$S', d) for d in incl_dirs] modname = unit.get('REALPRJNAME') self._flags.extend(['-module', modname]) - if not self._local_swig: - unit.onaddincl(incl_dirs) + if not self._local_swig: + unit.onaddincl(incl_dirs) if self._swig_lang == 'python': self._out_name = modname + '.py' @@ -83,7 +83,7 @@ class Swig(iw.CustomCommand): return self._flags def tools(self): - return ['contrib/tools/swig'] if not self._tool else [] + return ['contrib/tools/swig'] if not self._tool else [] def input(self): return [ @@ -105,8 +105,8 @@ class Swig(iw.CustomCommand): return [(self._out_header, [])] if self._swig_lang in ['java', 'jni_cpp'] else [] def run(self, extra_args, binary): - if self._local_swig: - binary = self._tool + if self._local_swig: + binary = self._tool return self.do_run_java(binary, self._path) if self._swig_lang in ['java', 'jni_cpp', 'jni_java'] else self.do_run(binary, self._path) def _incl_flags(self): |