aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorzaverden <zaverden@yandex-team.com>2024-10-21 20:00:43 +0300
committerzaverden <zaverden@yandex-team.com>2024-10-21 20:23:16 +0300
commite0af5b9afc8f45ef84531f0969123fb7e4e382d0 (patch)
tree7cdfd3fd25d21d9077acc9b26f9368b1bc76c258 /build
parent22932b7a367f32e8b00cb0fe464327008a6b6726 (diff)
downloadydb-e0af5b9afc8f45ef84531f0969123fb7e4e382d0.tar.gz
conf(feat): do not inputs from peers' outputs
commit_hash:2310b62b5ef95f4fc7ee6b278d8d4a71a9c3817c
Diffstat (limited to 'build')
-rw-r--r--build/conf/ts/ts_test.conf10
-rw-r--r--build/plugins/lib/nots/package_manager/base/package_manager.py2
-rw-r--r--build/plugins/lib/nots/package_manager/npm/npm_package_manager.py16
-rw-r--r--build/plugins/lib/nots/package_manager/pnpm/package_manager.py19
-rw-r--r--build/plugins/nots.py5
5 files changed, 15 insertions, 37 deletions
diff --git a/build/conf/ts/ts_test.conf b/build/conf/ts/ts_test.conf
index 46887b8cd2..be683c6ff1 100644
--- a/build/conf/ts/ts_test.conf
+++ b/build/conf/ts/ts_test.conf
@@ -32,7 +32,7 @@ module TS_TEST_JEST_FOR: _TS_TEST_BASE {
.CMD=TS_TEST_JEST_CMD
# for multimodule peers we should choose NODE_MODULES
- SET(PEERDIR_TAGS TS)
+ SET(PEERDIR_TAGS TS TS_PROTO)
# compatibility with old TS_TEST_SRCS
SET(TS_TEST_EXTENSION test.(ts|tsx|js|jsx))
@@ -46,7 +46,7 @@ module TS_TEST_JEST_FOR: _TS_TEST_BASE {
_TS_ADD_NODE_MODULES_FOR_BUILDER()
}
-TS_TEST_HERMIONE_CMD=$TOUCH_UNIT \
+TS_TEST_HERMIONE_CMD=$TOUCH_UNIT ${hide:PEERS} \
&& ${cwd:BINDIR} $MOVE_FILE ${input:TS_TEST_NM} ${output:"workspace_node_modules.tar"} \
${hide;kv:"p TSHRM"} ${hide;kv:"pc magenta"}
@@ -67,7 +67,7 @@ module TS_TEST_HERMIONE_FOR: _TS_TEST_BASE {
.CMD=TS_TEST_HERMIONE_CMD
# for multimodule peers we should choose TS
- SET(PEERDIR_TAGS TS)
+ SET(PEERDIR_TAGS TS TS_PROTO)
# compatibility with old TS_TEST_SRCS
SET(TS_TEST_EXTENSION hermione.(ts|js))
@@ -101,7 +101,7 @@ module TS_TEST_PLAYWRIGHT_FOR: _TS_TEST_BASE {
.CMD=TS_TEST_PLAYWRIGHT_CMD
# for multimodule peers we should choose TS
- SET(PEERDIR_TAGS TS)
+ SET(PEERDIR_TAGS TS TS_PROTO)
# compatibility with old TS_TEST_SRCS
SET(TS_TEST_EXTENSION (playwright|spec).(ts|js))
@@ -134,7 +134,7 @@ module TS_TEST_PLAYWRIGHT_LARGE_FOR: _TS_TEST_BASE {
.CMD=TS_TEST_PLAYWRIGHT_LARGE_CMD
# for multimodule peers we should choose TS
- SET(PEERDIR_TAGS TS)
+ SET(PEERDIR_TAGS TS TS_PROTO)
# compatibility with old TS_TEST_SRCS
SET(TS_TEST_EXTENSION (playwright|spec).(ts|js))
diff --git a/build/plugins/lib/nots/package_manager/base/package_manager.py b/build/plugins/lib/nots/package_manager/base/package_manager.py
index efd5038d27..fbe4a16436 100644
--- a/build/plugins/lib/nots/package_manager/base/package_manager.py
+++ b/build/plugins/lib/nots/package_manager/base/package_manager.py
@@ -102,7 +102,7 @@ class BasePackageManager(object):
pass
@abstractmethod
- def calc_node_modules_inouts(self, local_cli=False) -> tuple[list[str], list[str]]:
+ def calc_node_modules_inouts(self, local_cli: bool, has_deps: bool) -> tuple[list[str], list[str]]:
pass
@abstractmethod
diff --git a/build/plugins/lib/nots/package_manager/npm/npm_package_manager.py b/build/plugins/lib/nots/package_manager/npm/npm_package_manager.py
index 3de14b1d7c..1d251ee1c8 100644
--- a/build/plugins/lib/nots/package_manager/npm/npm_package_manager.py
+++ b/build/plugins/lib/nots/package_manager/npm/npm_package_manager.py
@@ -64,38 +64,28 @@ class NpmPackageManager(BasePackageManager):
resources = []
if has_deps:
- for dep_path in self.get_local_peers_from_package_json():
- ins.append(b_rooted(build_ws_config_path(dep_path)))
-
for pkg in self.extract_packages_meta_from_lockfiles([build_lockfile_path(self.sources_path)]):
resources.append(pkg.to_uri())
outs.append(b_rooted(self._tarballs_store_path(pkg, store_path)))
return ins, outs, resources
- def calc_node_modules_inouts(self, local_cli=False) -> tuple[list[str], list[str]]:
+ def calc_node_modules_inouts(self, local_cli: bool, has_deps: bool) -> tuple[list[str], list[str]]:
"""
Returns input and output paths for command that creates `node_modules` bundle.
It relies on .PEERDIRSELF=TS_PREPARE_DEPS
Inputs:
- source package.json
- - merged pre-lockfiles and workspace configs of TS_PREPARE_DEPS
Outputs:
- created node_modules bundle
"""
ins = [
s_rooted(build_pj_path(self.module_path)),
- b_rooted(build_ws_config_path(self.module_path)),
]
outs = []
- pj = self.load_package_json_from_dir(self.sources_path)
- if pj.has_dependencies():
- ins.append(b_rooted(build_pre_lockfile_path(self.module_path)))
- if not local_cli:
- outs.append(b_rooted(build_nm_bundle_path(self.module_path)))
- for dep_path in self.get_local_peers_from_package_json():
- ins.append(b_rooted(build_pj_path(dep_path)))
+ if not local_cli and has_deps:
+ outs.append(b_rooted(build_nm_bundle_path(self.module_path)))
return ins, outs
diff --git a/build/plugins/lib/nots/package_manager/pnpm/package_manager.py b/build/plugins/lib/nots/package_manager/pnpm/package_manager.py
index 8be7a2dddb..ec8bb3db61 100644
--- a/build/plugins/lib/nots/package_manager/pnpm/package_manager.py
+++ b/build/plugins/lib/nots/package_manager/pnpm/package_manager.py
@@ -106,39 +106,26 @@ class PnpmPackageManager(BasePackageManager):
resources = []
if has_deps:
- for dep_path in self.get_local_peers_from_package_json():
- ins.append(b_rooted(build_ws_config_path(dep_path)))
- ins.append(b_rooted(build_pre_lockfile_path(dep_path)))
-
for pkg in self.extract_packages_meta_from_lockfiles([build_lockfile_path(self.sources_path)]):
resources.append(pkg.to_uri())
outs.append(b_rooted(self._tarballs_store_path(pkg, store_path)))
return ins, outs, resources
- # TODO: FBP-1254
- # def calc_node_modules_inouts(self, local_cli=False) -> (list[str], list[str]):
- def calc_node_modules_inouts(self, local_cli=False):
+ def calc_node_modules_inouts(self, local_cli: bool, has_deps: bool) -> tuple[list[str], list[str]]:
"""
Returns input and output paths for command that creates `node_modules` bundle.
It relies on .PEERDIRSELF=TS_PREPARE_DEPS
Inputs:
- source package.json
- - merged pre-lockfiles and workspace configs of TS_PREPARE_DEPS
Outputs:
- created node_modules bundle
"""
ins = [s_rooted(build_pj_path(self.module_path))]
outs = []
- pj = self.load_package_json_from_dir(self.sources_path)
- if pj.has_dependencies():
- ins.append(b_rooted(build_pre_lockfile_path(self.module_path)))
- ins.append(b_rooted(build_ws_config_path(self.module_path)))
- if not local_cli:
- outs.append(b_rooted(build_nm_bundle_path(self.module_path)))
- for dep_path in self.get_local_peers_from_package_json():
- ins.append(b_rooted(build_pj_path(dep_path)))
+ if not local_cli and has_deps:
+ outs.append(b_rooted(build_nm_bundle_path(self.module_path)))
return ins, outs
diff --git a/build/plugins/nots.py b/build/plugins/nots.py
index f6824b67e7..2f49030375 100644
--- a/build/plugins/nots.py
+++ b/build/plugins/nots.py
@@ -795,11 +795,12 @@ def on_prepare_deps_configure(unit: NotsUnitType) -> None:
def on_node_modules_configure(unit: NotsUnitType) -> None:
pm = _create_pm(unit)
pj = pm.load_package_json_from_dir(pm.sources_path)
+ has_deps = pj.has_dependencies()
- if pj.has_dependencies():
+ if has_deps:
unit.onpeerdir(pm.get_local_peers_from_package_json())
local_cli = unit.get("TS_LOCAL_CLI") == "yes"
- ins, outs = pm.calc_node_modules_inouts(local_cli)
+ ins, outs = pm.calc_node_modules_inouts(local_cli, has_deps)
__set_append(unit, "_NODE_MODULES_INOUTS", _build_directives("input", ["hide"], sorted(ins)))
if not unit.get("TS_TEST_FOR"):