summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvturov <[email protected]>2024-11-08 00:55:51 +0300
committervturov <[email protected]>2024-11-08 01:10:25 +0300
commit8ba254ef940b749a6cbed68c3465bc73a2094539 (patch)
tree7ba1f5def4f7c0e1ebafcc65463c8d13478dd032
parenta3a9b728cb98deccbc84a2e75d67755832de4813 (diff)
fix: duplicate peers block node_modules pack/unpack
Duplicate paths for transitive peers should not block the bundling / installing commit_hash:53d3e2dfbd7e68234dcf318e16ba982f5353eda1
-rw-r--r--build/plugins/lib/nots/package_manager/base/node_modules_bundler.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/build/plugins/lib/nots/package_manager/base/node_modules_bundler.py b/build/plugins/lib/nots/package_manager/base/node_modules_bundler.py
index 6339342594c..03ad72c2bae 100644
--- a/build/plugins/lib/nots/package_manager/base/node_modules_bundler.py
+++ b/build/plugins/lib/nots/package_manager/base/node_modules_bundler.py
@@ -31,6 +31,7 @@ def bundle_node_modules(build_root, peers, node_modules_path, bundle_path):
# Peers' node_modules.
added_peers = []
+ peers = set(peers)
for p in peers:
peer_nm_path = build_nm_path(os.path.join(build_root, p))
peer_bundled_nm_path = build_nm_path(os.path.join(PEERS_DIR, p))
@@ -47,7 +48,7 @@ def bundle_node_modules(build_root, peers, node_modules_path, bundle_path):
peers_index.write("\n".join(added_peers))
paths_to_pack.append((peers_index_tmppath, peers_index_relpath))
- archive.tar(paths_to_pack, bundle_path, compression_filter=None, compression_level=None, fixed_mtime=0)
+ archive.tar(set(paths_to_pack), bundle_path, compression_filter=None, compression_level=None, fixed_mtime=0)
def extract_node_modules(build_root, node_modules_path, bundle_path):
@@ -77,7 +78,7 @@ def extract_node_modules(build_root, node_modules_path, bundle_path):
os.rename(bundled_nm_path, nm_path)
except FileNotFoundError as e:
logging.error(f"exists={os.path.exists(bundled_nm_path)} : {bundled_nm_path}")
- logging.error(f"exists={os.path.exists(nm_path)} : {bundled_nm_path}")
+ logging.error(f"exists={os.path.exists(nm_path)} : {nm_path}")
raise e
return True