diff options
author | miripiruni <miripiruni@yandex-team.com> | 2023-06-29 11:31:40 +0300 |
---|---|---|
committer | miripiruni <miripiruni@yandex-team.com> | 2023-06-29 11:31:40 +0300 |
commit | e439f7d9c2cd360529054bbb5f13a6cab80f3123 (patch) | |
tree | a743685bc20e96ff332b9fd064a4efe18db2eb17 | |
parent | 6592029be25834b4bfbc3fac74c3bbc346ed22e6 (diff) | |
download | ydb-e439f7d9c2cd360529054bbb5f13a6cab80f3123.tar.gz |
Всегда перечислять pnpm-lock.yaml во входах модуля
Issues:
* https://st.yandex-team.ru/
* https://st.yandex-team.ru/
-rw-r--r-- | build/plugins/lib/nots/package_manager/pnpm/package_manager.py | 14 | ||||
-rw-r--r-- | build/plugins/nots.py | 18 |
2 files changed, 25 insertions, 7 deletions
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 3960f6498c..52c6ab1b27 100644 --- a/build/plugins/lib/nots/package_manager/pnpm/package_manager.py +++ b/build/plugins/lib/nots/package_manager/pnpm/package_manager.py @@ -69,6 +69,7 @@ class PnpmPackageManager(BasePackageManager): def calc_node_modules_inouts(self): """ Returns input and output paths for command that creates `node_modules` bundle. + Errors: errors catched while processing lockfiles Inputs: - source package.json and lockfile, - built package.jsons of all deps, @@ -78,7 +79,7 @@ class PnpmPackageManager(BasePackageManager): - merged lockfile, - generated workspace config, - created node_modules bundle. - :rtype: (list of str, list of str) + :rtype: (list of errors, list of str, list of str) """ ins = [ s_rooted(build_pj_path(self.module_path)), @@ -109,10 +110,15 @@ class PnpmPackageManager(BasePackageManager): ins.append(b_rooted(build_ws_config_path(dep_mod_path))) ins.append(b_rooted(build_lockfile_path(dep_mod_path))) - for pkg in self.extract_packages_meta_from_lockfiles(src_lf_paths): - ins.append(b_rooted(self._contrib_tarball_path(pkg))) + errors = [] + try: + for pkg in self.extract_packages_meta_from_lockfiles(src_lf_paths): + ins.append(b_rooted(self._contrib_tarball_path(pkg))) + except Exception as e: + errors.append(e) + pass - return (ins, outs) + return (errors, ins, outs) def extract_packages_meta_from_lockfiles(self, lf_paths): """ diff --git a/build/plugins/nots.py b/build/plugins/nots.py index 994512a108..fff1ea3608 100644 --- a/build/plugins/nots.py +++ b/build/plugins/nots.py @@ -121,8 +121,15 @@ def on_from_npm_lockfiles(unit, *args): elif unit.get("TS_STRICT_FROM_NPM_LOCKFILES") == "yes": ymake.report_configure_error("lockfile not found: {}".format(lf_path)) - for pkg in pm.extract_packages_meta_from_lockfiles(lf_paths): - unit.on_from_npm([pkg.name, pkg.version, pkg.sky_id, pkg.integrity, pkg.integrity_algorithm, pkg.tarball_path]) + try: + for pkg in pm.extract_packages_meta_from_lockfiles(lf_paths): + unit.on_from_npm([pkg.name, pkg.version, pkg.sky_id, pkg.integrity, pkg.integrity_algorithm, pkg.tarball_path]) + except Exception as e: + if unit.get("TS_RAISE") == "yes": + raise e + else: + unit.message(["WARN", "on_from_npm_lockfiles exception: {}".format(e)]) + pass @_with_report_configure_error @@ -426,7 +433,12 @@ def on_node_modules_configure(unit): if pj.has_dependencies(): unit.onpeerdir(pm.get_local_peers_from_package_json()) - ins, outs = pm.calc_node_modules_inouts() + message_level = "ERROR" if unit.get("TS_RAISE") == "yes" else "WARN" + errors, ins, outs = pm.calc_node_modules_inouts() + + for err in errors: + unit.message([message_level, "calc_node_modules_inouts exception: {}".format(err)]) + unit.on_set_node_modules_ins_outs(["IN"] + sorted(ins) + ["OUT"] + sorted(outs)) else: # default "noop" command |