perf(pm): skip binary mirror work when scripts are ignored#2841
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements conditional binary mirror skipping for the official npm registry and refactors the installation service to only update package binaries when install scripts are enabled. Feedback was provided to handle errors gracefully for optional dependencies during the binary update process to ensure that failures in non-essential packages do not interrupt the overall installation.
| if update_binary { | ||
| update_package_binary(&target_path, &name).await?; | ||
| } |
There was a problem hiding this comment.
When an optional dependency fails to update its binary, the error should be handled gracefully to maintain consistency with the cloning step. Currently, a failure in update_package_binary will propagate an error via ?, causing the entire installation task to fail even if is_optional is true. It is recommended to wrap this call in a check that logs a warning for optional dependencies instead of returning an error.
if update_binary {
if let Err(e) = update_package_binary(&target_path, &name).await {
if is_optional {
tracing::warn!("Optional dependency {name} binary update failed (ignored): {e}");
} else {
return Err(e);
}
}
}|
Closing as stale: this draft is a one-off agent experiment from 2026-04-27 with no follow-up, and overlaps with sibling PRs exploring the same optimization. Reopen if revisited. |
Summary
Verification
Risk