aboutsummaryrefslogtreecommitdiff
path: root/src/install/install.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/install/install.zig')
-rw-r--r--src/install/install.zig34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/install/install.zig b/src/install/install.zig
index 131adb00e..6689b05ac 100644
--- a/src/install/install.zig
+++ b/src/install/install.zig
@@ -1764,7 +1764,7 @@ pub const PackageManager = struct {
pub fn sleep(this: *PackageManager) void {
if (this.wait_count.swap(0, .Monotonic) > 0) return;
- bun.Mimalloc.mi_collect(false);
+ Output.flush();
_ = this.waiter.wait() catch 0;
}
@@ -1829,7 +1829,7 @@ pub const PackageManager = struct {
switch (this.options.log_level) {
inline else => |log_level| {
if (log_level.showProgress()) this.startProgressBarIfNone();
- while (this.pending_tasks > 0) : (this.sleep()) {
+ while (this.pending_tasks > 0) {
this.runTasks(
void,
{},
@@ -1843,6 +1843,13 @@ pub const PackageManager = struct {
) catch |err| {
return .{ .failure = err };
};
+
+ if (PackageManager.verbose_install and this.pending_tasks > 0) {
+ Output.prettyErrorln("<d>[PackageManager]<r> waiting for {d} tasks\n", .{this.pending_tasks});
+ }
+
+ if (this.pending_tasks > 0)
+ this.sleep();
}
},
}
@@ -7297,7 +7304,10 @@ pub const PackageManager = struct {
// We use this file descriptor to know where to put it.
installer.node_modules_folder = cwd.openIterableDir(node_modules.relative_path, .{}) catch brk: {
// Avoid extra mkdir() syscall
- try cwd.makePath(bun.span(node_modules.relative_path));
+ //
+ // note: this will recursively delete any dangling symlinks
+ // in the next.js repo, it encounters a dangling symlink in node_modules/@next/codemod/node_modules/cheerio
+ try bun.makePath(cwd, bun.span(node_modules.relative_path));
break :brk try cwd.openIterableDir(node_modules.relative_path, .{});
};
@@ -7351,7 +7361,7 @@ pub const PackageManager = struct {
if (!installer.options.do.install_packages) return error.InstallFailed;
}
- while (this.pending_tasks > 0 and installer.options.do.install_packages) : (this.sleep()) {
+ while (this.pending_tasks > 0 and installer.options.do.install_packages) {
try this.runTasks(
*PackageInstaller,
&installer,
@@ -7363,6 +7373,13 @@ pub const PackageManager = struct {
},
log_level,
);
+
+ if (PackageManager.verbose_install and this.pending_tasks > 0) {
+ Output.prettyErrorln("<d>[PackageManager]<r> waiting for {d} tasks\n", .{this.pending_tasks});
+ }
+
+ if (this.pending_tasks > 0)
+ this.sleep();
}
if (!installer.options.do.install_packages) return error.InstallFailed;
@@ -7733,7 +7750,7 @@ pub const PackageManager = struct {
Output.flush();
}
- while (manager.pending_tasks > 0) : (manager.sleep()) {
+ while (manager.pending_tasks > 0) {
try manager.runTasks(
*PackageManager,
manager,
@@ -7746,6 +7763,13 @@ pub const PackageManager = struct {
},
log_level,
);
+
+ if (PackageManager.verbose_install and manager.pending_tasks > 0) {
+ Output.prettyErrorln("<d>[PackageManager]<r> waiting for {d} tasks\n", .{manager.pending_tasks});
+ }
+
+ if (manager.pending_tasks > 0)
+ manager.sleep();
}
if (comptime log_level.showProgress()) {