aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/fix_msvc_output.py
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-03-28 22:25:04 +0300
committeralexv-smirnov <alex@ydb.tech>2023-03-28 22:25:04 +0300
commitb8a17f9b1c166d2e9a26b99348a4c29d972caf55 (patch)
tree1a2d881f1a9452b9c6103dbf69d73da7624e98e5 /build/scripts/fix_msvc_output.py
parent25659221f18577ea38430a8ec3349836f5626b6a (diff)
downloadydb-b8a17f9b1c166d2e9a26b99348a4c29d972caf55.tar.gz
Revert ymake build from ydb oss export
Diffstat (limited to 'build/scripts/fix_msvc_output.py')
-rw-r--r--build/scripts/fix_msvc_output.py43
1 files changed, 0 insertions, 43 deletions
diff --git a/build/scripts/fix_msvc_output.py b/build/scripts/fix_msvc_output.py
deleted file mode 100644
index 183a442e1f..0000000000
--- a/build/scripts/fix_msvc_output.py
+++ /dev/null
@@ -1,43 +0,0 @@
-import subprocess
-import sys
-
-import process_command_files as pcf
-import process_whole_archive_option as pwa
-
-
-def out2err(cmd):
- return subprocess.Popen(cmd, stdout=sys.stderr).wait()
-
-
-def decoding_needed(strval):
- if sys.version_info >= (3, 0, 0):
- return isinstance(strval, bytes)
- else:
- return False
-
-
-def out2err_cut_first_line(cmd):
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
- first_line = True
- while True:
- line = p.stdout.readline()
- line = line.decode('utf-8') if decoding_needed(line) else line
- if not line:
- break
- if first_line:
- sys.stdout.write(line)
- first_line = False
- else:
- sys.stderr.write(line)
- return p.wait()
-
-
-if __name__ == '__main__':
- mode = sys.argv[1]
- args, wa_peers, wa_libs = pwa.get_whole_archive_peers_and_libs(pcf.skip_markers(sys.argv[2:]))
- cmd = pwa.ProcessWholeArchiveOption('WINDOWS', wa_peers, wa_libs).construct_cmd(args)
- run = out2err
- if mode in ('cl', 'ml'):
- # First line of cl.exe and ml64.exe stdout is useless: it prints input file
- run = out2err_cut_first_line
- sys.exit(run(cmd))