diff options
author | zaverden <zaverden@yandex-team.com> | 2024-05-15 11:03:12 +0300 |
---|---|---|
committer | zaverden <zaverden@yandex-team.com> | 2024-05-15 11:15:20 +0300 |
commit | 12837025f426afdef854ca6b7c67bad68cd5d9d5 (patch) | |
tree | 8c9ffbc9e38000007ca9dca9dce29edbb91aa89d /build/plugins/lib/nots | |
parent | eebf8029b4691377a05db9d94dc5d8ac75266b90 (diff) | |
download | ydb-12837025f426afdef854ca6b7c67bad68cd5d9d5.tar.gz |
feat(nots/cli, builder): copy patches to `pnpm install` directory
e71f3730f57e720d6efb18f42adbd2006606844e
Diffstat (limited to 'build/plugins/lib/nots')
-rw-r--r-- | build/plugins/lib/nots/package_manager/pnpm/package_manager.py | 12 |
1 files changed, 12 insertions, 0 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 da70be303f..3620ce8e6c 100644 --- a/build/plugins/lib/nots/package_manager/pnpm/package_manager.py +++ b/build/plugins/lib/nots/package_manager/pnpm/package_manager.py @@ -43,6 +43,8 @@ class PnpmPackageManager(BasePackageManager): """ ws = self._prepare_workspace() + self._copy_pnpm_patches() + # Pure `tier 0` logic - isolated stores in the `build_root` (works in `distbuild` and `CI autocheck`) store_dir = self._nm_path(self._STORE_NM_PATH) virtual_store_dir = self._nm_path(self._VSTORE_NM_PATH) @@ -240,6 +242,16 @@ class PnpmPackageManager(BasePackageManager): shutil.copyfile(original_lf_path, vs_lf_path) + def _copy_pnpm_patches(self): + pj = self.load_package_json_from_dir(self.sources_path) + patchedDependencies: dict[str, str] = pj.data.get("pnpm", {}).get("patchedDependencies", {}) + + for p in patchedDependencies.values(): + patch_source_path = os.path.join(self.sources_path, p) + patch_build_path = os.path.join(self.build_path, p) + os.makedirs(os.path.dirname(patch_build_path), exist_ok=True) + shutil.copyfile(patch_source_path, patch_build_path) + def _get_default_options(self): return super(PnpmPackageManager, self)._get_default_options() + [ "--stream", |