diff options
author | 2021-12-07 05:11:50 -0800 | |
---|---|---|
committer | 2021-12-16 19:18:51 -0800 | |
commit | 8df49bc8230623aaa4320e8562385a3f71ac71c9 (patch) | |
tree | 621096fe1ec5c3f983aa1366dffd83ef0ed0947c | |
parent | ab4129061e0ace1edcef42e3991c956a38c386ef (diff) | |
download | bun-8df49bc8230623aaa4320e8562385a3f71ac71c9.tar.gz bun-8df49bc8230623aaa4320e8562385a3f71ac71c9.tar.zst bun-8df49bc8230623aaa4320e8562385a3f71ac71c9.zip |
Update install.zig
-rw-r--r-- | src/install/install.zig | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/install/install.zig b/src/install/install.zig index f9281ecc9..f9c79ad2e 100644 --- a/src/install/install.zig +++ b/src/install/install.zig @@ -642,7 +642,15 @@ pub const Lockfile = struct { // Go through *already* resolved package versions // Ask, do any of those versions happen to match a lower version? // If yes, choose that version instead. - // The intent is to + // Why lower? + // + // Normally, the problem is looks like this: + // Package A: "react@^17" + // Package B: "react@17.0.1 + // + // Now you have two copies of React. + // When you really only wanted one. + // Since _typically_ the issue is that Semver ranges with "^" or "~" say "choose latest", we end up with latest if (options.enable.deduplicate_packages) { var resolutions = old.buffers.resolutions.items; var dependencies: []Dependency = old.buffers.dependencies.items; @@ -658,7 +666,6 @@ pub const Lockfile = struct { if (old.package_index.get(dependency.name_hash)) |entry| { const package_ids = std.mem.span(entry.PackageIDMultiple); - // First: try min for (package_ids) |id| { if (resolved_package_id == id or id >= max_package_id) continue; const package_resolution = package_resolutions[id]; |