aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins
diff options
context:
space:
mode:
authorprime <prime@yandex-team.ru>2022-02-10 16:46:00 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:00 +0300
commit3695a7cd42b74a4987d8d5a8f2e2443556998943 (patch)
treeee79ee9294a61ee00e647684b3700d0a87e102a3 /build/plugins
parent4d8b546b89b5afc08cf3667e176271c7ba935f33 (diff)
downloadydb-3695a7cd42b74a4987d8d5a8f2e2443556998943.tar.gz
Restoring authorship annotation for <prime@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/plugins')
-rw-r--r--build/plugins/gobuild.py68
1 files changed, 34 insertions, 34 deletions
diff --git a/build/plugins/gobuild.py b/build/plugins/gobuild.py
index 8df96ebc55..774320363d 100644
--- a/build/plugins/gobuild.py
+++ b/build/plugins/gobuild.py
@@ -78,8 +78,8 @@ def go_package_name(unit):
else:
name = unit.get('REALPRJNAME')
return name
-
-
+
+
def need_lint(path):
return not path.startswith('$S/vendor/') and not path.startswith('$S/contrib/')
@@ -265,7 +265,7 @@ def on_go_process_srcs(unit):
unit.onsrc([f[:-2] + 'cgo2.c'] + cgo_cflags + cgo2_cflags)
else:
ymake.report_configure_error('file {} should not be listed in CGO_SRCS() macros'.format(f))
- args = [go_package_name(unit)] + cgo_files
+ args = [go_package_name(unit)] + cgo_files
if len(c_files) > 0:
args += ['C_FILES'] + c_files
if len(s_files) > 0:
@@ -273,37 +273,37 @@ def on_go_process_srcs(unit):
if len(syso_files) > 0:
args += ['OBJ_FILES'] + syso_files
unit.on_go_compile_cgo2(args)
-
-
-def on_go_resource(unit, *args):
- args = list(args)
- files = args[::2]
- keys = args[1::2]
+
+
+def on_go_resource(unit, *args):
+ args = list(args)
+ files = args[::2]
+ keys = args[1::2]
suffix_md5 = md5.new('@'.join(args)).hexdigest()
resource_go = os.path.join("resource.{}.res.go".format(suffix_md5))
-
- unit.onpeerdir(["library/go/core/resource"])
-
- if len(files) != len(keys):
- ymake.report_configure_error("last file {} is missing resource key".format(files[-1]))
-
- for i, (key, filename) in enumerate(zip(keys, files)):
- if not key:
- ymake.report_configure_error("file key must be non empty")
- return
-
- if filename == "-" and "=" not in key:
- ymake.report_configure_error("key \"{}\" must contain = sign".format(key))
- return
-
- # quote key, to avoid automatic substitution of filename by absolute
- # path in RUN_PROGRAM
- args[2*i+1] = "notafile" + args[2*i+1]
-
+
+ unit.onpeerdir(["library/go/core/resource"])
+
+ if len(files) != len(keys):
+ ymake.report_configure_error("last file {} is missing resource key".format(files[-1]))
+
+ for i, (key, filename) in enumerate(zip(keys, files)):
+ if not key:
+ ymake.report_configure_error("file key must be non empty")
+ return
+
+ if filename == "-" and "=" not in key:
+ ymake.report_configure_error("key \"{}\" must contain = sign".format(key))
+ return
+
+ # quote key, to avoid automatic substitution of filename by absolute
+ # path in RUN_PROGRAM
+ args[2*i+1] = "notafile" + args[2*i+1]
+
files = [file for file in files if file != "-"]
- unit.onrun_program([
- "library/go/core/resource/cc",
- "-package", go_package_name(unit),
- "-o", resource_go] + list(args) + [
- "IN"] + files + [
- "OUT", resource_go])
+ unit.onrun_program([
+ "library/go/core/resource/cc",
+ "-package", go_package_name(unit),
+ "-o", resource_go] + list(args) + [
+ "IN"] + files + [
+ "OUT", resource_go])