aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Alex Lam S.L <alexlamsl@gmail.com> 2023-06-26 01:43:58 +0300
committerGravatar GitHub <noreply@github.com> 2023-06-26 01:43:58 +0300
commit33903ea892db861416f1f68d4c40536540719f4e (patch)
treecf9e3b4f10a7deb03982c08a1025234d2b5a0fcb /src
parent5bd94b8f47efab5ca736e6ec76b72e991df1da11 (diff)
downloadbun-33903ea892db861416f1f68d4c40536540719f4e.tar.gz
bun-33903ea892db861416f1f68d4c40536540719f4e.tar.zst
bun-33903ea892db861416f1f68d4c40536540719f4e.zip
[install] fix hang in `bun install --production` (#3406)
Diffstat (limited to 'src')
-rw-r--r--src/install/lockfile.zig13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/install/lockfile.zig b/src/install/lockfile.zig
index ce9199ab3..b17691853 100644
--- a/src/install/lockfile.zig
+++ b/src/install/lockfile.zig
@@ -2033,19 +2033,20 @@ pub const Package = extern struct {
cloner.trees_count += @as(u32, @intFromBool(old_resolutions.len > 0));
- for (old_resolutions, 0..) |old_resolution, i| {
- if (old_resolution >= max_package_id) continue;
+ for (old_resolutions, resolutions, 0..) |old_resolution, *resolution, i| {
+ if (old_resolution >= max_package_id) {
+ resolution.* = invalid_package_id;
+ continue;
+ }
const mapped = package_id_mapping[old_resolution];
- const resolve_id = new_package.resolutions.off + @intCast(PackageID, i);
-
if (mapped < max_package_id) {
- resolutions[i] = mapped;
+ resolution.* = mapped;
} else {
try cloner.clone_queue.append(.{
.old_resolution = old_resolution,
.parent = new_package.meta.id,
- .resolve_id = resolve_id,
+ .resolve_id = new_package.resolutions.off + @intCast(PackageID, i),
});
}
}