aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2024-10-28 20:34:11 +0000
committerAlexander Smirnov <alex@ydb.tech>2024-10-28 20:34:11 +0000
commitef9875b11a33dbd25e92bc6b4cf692c18c9ba0ce (patch)
tree1f2fd4e4d9e585da35937b42fbda5f854af04728 /build/scripts
parent37ae9cc90160b53eb0e22021c47b3996a01cd656 (diff)
parente3c8507a3d1cb090278f211232ddfde3bedc54d4 (diff)
downloadydb-ef9875b11a33dbd25e92bc6b4cf692c18c9ba0ce.tar.gz
Merge branch 'rightlib' into mergelibs-241028-2033
Diffstat (limited to 'build/scripts')
-rw-r--r--build/scripts/Readme.md9
-rw-r--r--build/scripts/c_templates/svn_interface.c1
-rw-r--r--build/scripts/compile_java.py3
-rw-r--r--build/scripts/copy_clang_profile_rt.py5
-rw-r--r--build/scripts/copy_docs_files.py6
-rw-r--r--build/scripts/copy_docs_files_to_dir.py6
-rw-r--r--build/scripts/copy_files_to_dir.py6
-rw-r--r--build/scripts/extract_docs.py6
-rwxr-xr-xbuild/scripts/fetch_from.py3
-rw-r--r--build/scripts/fetch_from_archive.py3
-rw-r--r--build/scripts/fetch_from_mds.py4
-rwxr-xr-xbuild/scripts/fetch_from_sandbox.py4
-rw-r--r--build/scripts/fix_msvc_output.py5
-rw-r--r--build/scripts/fix_py2_protobuf.py5
-rw-r--r--build/scripts/fs_tools.py3
-rw-r--r--build/scripts/gen_join_srcs.py5
-rw-r--r--build/scripts/generate_mf.py3
-rw-r--r--build/scripts/go_tool.py3
-rw-r--r--build/scripts/link_dyn_lib.py3
-rw-r--r--build/scripts/link_exe.py3
-rw-r--r--build/scripts/link_fat_obj.py5
-rw-r--r--build/scripts/make_container.py3
-rw-r--r--build/scripts/make_java_classpath_file.py3
-rw-r--r--build/scripts/make_java_srclists.py3
-rw-r--r--build/scripts/move.py3
-rw-r--r--build/scripts/process_whole_archive_option.py5
-rw-r--r--build/scripts/run_javac.py3
-rw-r--r--build/scripts/run_msvc_wine.py3
-rw-r--r--build/scripts/sky.py5
-rw-r--r--build/scripts/writer.py5
30 files changed, 111 insertions, 13 deletions
diff --git a/build/scripts/Readme.md b/build/scripts/Readme.md
new file mode 100644
index 0000000000..bed6615ba0
--- /dev/null
+++ b/build/scripts/Readme.md
@@ -0,0 +1,9 @@
+# Note
+При добавлении новых скриптов в данную директорию не забывайте указывать две вещи:
+
+1. Явное разрешать импорт модулей из текущей директории, если это вам необходимо, с помощью строк:
+```python3
+import os.path, sys
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+```
+2. В командах вызова скриптов прописывать все их зависимые модули через `${input:"build/scripts/module_1.py"}`, `${input:"build/scripts/module_2.py"}` ...
diff --git a/build/scripts/c_templates/svn_interface.c b/build/scripts/c_templates/svn_interface.c
index 65fd97f9b2..8baf1d197b 100644
--- a/build/scripts/c_templates/svn_interface.c
+++ b/build/scripts/c_templates/svn_interface.c
@@ -1,6 +1,7 @@
// Used indirectly. See build/scripts/vcs_info.py
// ya-bin dump vcs-info > vcs.json
// python build/scripts/vcs_info.py vcs.json out.c build/scripts/c_templates/svn_interface.c <any_prefix>library/cpp/svnversion<any_suffix>
+// DO_NOT_STYLE because this script is sometimes implicilty added as a styling target to STYLE_CPP
#include "build/scripts/c_templates/svnversion.h"
diff --git a/build/scripts/compile_java.py b/build/scripts/compile_java.py
index 654543f976..a28d737195 100644
--- a/build/scripts/compile_java.py
+++ b/build/scripts/compile_java.py
@@ -8,6 +8,9 @@ import tarfile
import zipfile
import sys
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
import java_command_file as jcf
diff --git a/build/scripts/copy_clang_profile_rt.py b/build/scripts/copy_clang_profile_rt.py
index f8058e9e64..84444b9dbf 100644
--- a/build/scripts/copy_clang_profile_rt.py
+++ b/build/scripts/copy_clang_profile_rt.py
@@ -1,7 +1,10 @@
import optparse
-import os
+import sys, os
import shutil
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
# List is a temporary thing to ensure that nothing breaks before and after switching to newer clang
diff --git a/build/scripts/copy_docs_files.py b/build/scripts/copy_docs_files.py
index 4ad70997c1..2428b5fddf 100644
--- a/build/scripts/copy_docs_files.py
+++ b/build/scripts/copy_docs_files.py
@@ -2,9 +2,13 @@ import argparse
import codecs
import errno
import os
+import sys
+
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
import shutil
-import sys
def parse_args():
diff --git a/build/scripts/copy_docs_files_to_dir.py b/build/scripts/copy_docs_files_to_dir.py
index 8ac23b0700..ea9fd7fccb 100644
--- a/build/scripts/copy_docs_files_to_dir.py
+++ b/build/scripts/copy_docs_files_to_dir.py
@@ -2,9 +2,13 @@ import argparse
import codecs
import errno
import os
+import sys
+
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
import shutil
-import sys
def parse_args():
diff --git a/build/scripts/copy_files_to_dir.py b/build/scripts/copy_files_to_dir.py
index 2403f0a683..a597eb987d 100644
--- a/build/scripts/copy_files_to_dir.py
+++ b/build/scripts/copy_files_to_dir.py
@@ -1,9 +1,13 @@
import argparse
import errno
import os
+import sys
+
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
import shutil
-import sys
def parse_args():
diff --git a/build/scripts/extract_docs.py b/build/scripts/extract_docs.py
index 5bf19f8866..8ab835b720 100644
--- a/build/scripts/extract_docs.py
+++ b/build/scripts/extract_docs.py
@@ -1,9 +1,13 @@
import argparse
import os
-import process_command_files as pcf
import tarfile
import sys
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+import process_command_files as pcf
+
def parse_args():
parser = argparse.ArgumentParser()
diff --git a/build/scripts/fetch_from.py b/build/scripts/fetch_from.py
index bd27d75d8e..0e543c810a 100755
--- a/build/scripts/fetch_from.py
+++ b/build/scripts/fetch_from.py
@@ -22,6 +22,9 @@ except (ImportError, ModuleNotFoundError):
# Python 3
import urllib.request as urllib_request
from urllib.error import HTTPError, URLError
+ # Explicitly enable local imports
+ # Don't forget to add imported scripts to inputs of the calling command!
+ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import retry
diff --git a/build/scripts/fetch_from_archive.py b/build/scripts/fetch_from_archive.py
index 3214b78dc8..c5513c48d1 100644
--- a/build/scripts/fetch_from_archive.py
+++ b/build/scripts/fetch_from_archive.py
@@ -4,6 +4,9 @@ import sys
import logging
import argparse
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import fetch_from
diff --git a/build/scripts/fetch_from_mds.py b/build/scripts/fetch_from_mds.py
index 559cf8350d..b7126d0b4b 100644
--- a/build/scripts/fetch_from_mds.py
+++ b/build/scripts/fetch_from_mds.py
@@ -1,11 +1,13 @@
from __future__ import print_function
-from __future__ import print_function
import os
import sys
import logging
import argparse
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import fetch_from
diff --git a/build/scripts/fetch_from_sandbox.py b/build/scripts/fetch_from_sandbox.py
index a8f0fc5997..2995d4df71 100755
--- a/build/scripts/fetch_from_sandbox.py
+++ b/build/scripts/fetch_from_sandbox.py
@@ -11,6 +11,10 @@ import time
import urllib2
import uuid
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+
import fetch_from
diff --git a/build/scripts/fix_msvc_output.py b/build/scripts/fix_msvc_output.py
index c9694afbc8..49df9aee3b 100644
--- a/build/scripts/fix_msvc_output.py
+++ b/build/scripts/fix_msvc_output.py
@@ -1,6 +1,9 @@
import subprocess
-import sys
+import os, sys
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
import process_whole_archive_option as pwa
diff --git a/build/scripts/fix_py2_protobuf.py b/build/scripts/fix_py2_protobuf.py
index 06e81ed648..b2e9ed028b 100644
--- a/build/scripts/fix_py2_protobuf.py
+++ b/build/scripts/fix_py2_protobuf.py
@@ -1,6 +1,9 @@
import subprocess
-import os
+import os, sys
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
diff --git a/build/scripts/fs_tools.py b/build/scripts/fs_tools.py
index 63ca00932e..74ca8fef29 100644
--- a/build/scripts/fs_tools.py
+++ b/build/scripts/fs_tools.py
@@ -6,6 +6,9 @@ import sys
import shutil
import errno
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
diff --git a/build/scripts/gen_join_srcs.py b/build/scripts/gen_join_srcs.py
index e0c2df161a..dfb12e7733 100644
--- a/build/scripts/gen_join_srcs.py
+++ b/build/scripts/gen_join_srcs.py
@@ -1,5 +1,8 @@
-import sys
+import os, sys
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
diff --git a/build/scripts/generate_mf.py b/build/scripts/generate_mf.py
index 447215c723..14db77c7b6 100644
--- a/build/scripts/generate_mf.py
+++ b/build/scripts/generate_mf.py
@@ -6,6 +6,9 @@ import io
import six
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
diff --git a/build/scripts/go_tool.py b/build/scripts/go_tool.py
index f1dbc9731e..e73fa7e7f9 100644
--- a/build/scripts/go_tool.py
+++ b/build/scripts/go_tool.py
@@ -13,6 +13,9 @@ import traceback
from contextlib import contextmanager
from functools import reduce
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
import process_whole_archive_option as pwa
diff --git a/build/scripts/link_dyn_lib.py b/build/scripts/link_dyn_lib.py
index 3e62f4c407..53757a7c75 100644
--- a/build/scripts/link_dyn_lib.py
+++ b/build/scripts/link_dyn_lib.py
@@ -7,6 +7,9 @@ import collections
import optparse
import pipes
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import thinlto_cache
import link_exe
diff --git a/build/scripts/link_exe.py b/build/scripts/link_exe.py
index 6ea2f91c3d..634840cf90 100644
--- a/build/scripts/link_exe.py
+++ b/build/scripts/link_exe.py
@@ -6,6 +6,9 @@ import subprocess
import optparse
import textwrap
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
import thinlto_cache
diff --git a/build/scripts/link_fat_obj.py b/build/scripts/link_fat_obj.py
index aeafea58c4..1b6f59777d 100644
--- a/build/scripts/link_fat_obj.py
+++ b/build/scripts/link_fat_obj.py
@@ -1,7 +1,10 @@
import argparse
import subprocess
-import sys
+import sys, os
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
from process_whole_archive_option import ProcessWholeArchiveOption
diff --git a/build/scripts/make_container.py b/build/scripts/make_container.py
index 2c07177fdb..05a310a5fc 100644
--- a/build/scripts/make_container.py
+++ b/build/scripts/make_container.py
@@ -5,6 +5,9 @@ import struct
import subprocess
import sys
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import container # 1
diff --git a/build/scripts/make_java_classpath_file.py b/build/scripts/make_java_classpath_file.py
index fbd9eb1358..0219a386f1 100644
--- a/build/scripts/make_java_classpath_file.py
+++ b/build/scripts/make_java_classpath_file.py
@@ -1,6 +1,9 @@
import os
import sys
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
diff --git a/build/scripts/make_java_srclists.py b/build/scripts/make_java_srclists.py
index ccf4027b0d..02a9da78e0 100644
--- a/build/scripts/make_java_srclists.py
+++ b/build/scripts/make_java_srclists.py
@@ -2,6 +2,9 @@ import os
import sys
import argparse
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
import java_pack_to_file as jcov
diff --git a/build/scripts/move.py b/build/scripts/move.py
index f38e88a406..0154294505 100644
--- a/build/scripts/move.py
+++ b/build/scripts/move.py
@@ -1,6 +1,9 @@
import os
import sys
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
# /script/move.py <src-1> <tgt-1> <src-2> <tgt-2> ... <src-n> <tgt-n>
diff --git a/build/scripts/process_whole_archive_option.py b/build/scripts/process_whole_archive_option.py
index 3e4458a8c7..0f5c3bf4c4 100644
--- a/build/scripts/process_whole_archive_option.py
+++ b/build/scripts/process_whole_archive_option.py
@@ -1,5 +1,8 @@
-import os
+import os, sys
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
diff --git a/build/scripts/run_javac.py b/build/scripts/run_javac.py
index a7c2296197..a3c91da13c 100644
--- a/build/scripts/run_javac.py
+++ b/build/scripts/run_javac.py
@@ -4,6 +4,9 @@ import optparse
import os
import re
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import build_java_with_error_prone2 as java_error_prone
import setup_java_tmpdir as java_tmpdir
diff --git a/build/scripts/run_msvc_wine.py b/build/scripts/run_msvc_wine.py
index 3a498d7388..d7ede556d2 100644
--- a/build/scripts/run_msvc_wine.py
+++ b/build/scripts/run_msvc_wine.py
@@ -9,6 +9,9 @@ import json
import argparse
import errno
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf
import process_whole_archive_option as pwa
diff --git a/build/scripts/sky.py b/build/scripts/sky.py
index b703af7ed1..89ee2e8d36 100644
--- a/build/scripts/sky.py
+++ b/build/scripts/sky.py
@@ -1,7 +1,10 @@
import logging
-import os
+import os, sys
import subprocess
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import fetch_from
diff --git a/build/scripts/writer.py b/build/scripts/writer.py
index ce88e35693..08c47c9f5c 100644
--- a/build/scripts/writer.py
+++ b/build/scripts/writer.py
@@ -1,6 +1,9 @@
-import sys
+import sys, os
import argparse
+# Explicitly enable local imports
+# Don't forget to add imported scripts to inputs of the calling command!
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import process_command_files as pcf