also looking at this
fix(install): keep .env-inferred services out of pantry.lock
#254
4 files
+286
-70
| @@ -652,7 +652,19 @@ pub fn canSkipFromLockfile( | ||
| 652 | 652 | if (!found) return false; |
| 653 | 653 | } |
| 654 | 654 | |
| 655 | // Check if destination directory actually exists (use stack buffer + access instead of openDir) | |
| 655 | return isPackageInstalled(proj_dir, modules_dir, clean_name); | |
| 656 | } | |
| 657 | ||
| 658 | /// Is this package present and usable under `proj_dir/modules_dir`? | |
| 659 | /// | |
| 660 | /// The half of `canSkipFromLockfile` that does not consult the lock, for the | |
| 661 | /// packages that are deliberately not in it: a service inferred from `.env` | |
| 662 | /// is installed but never locked (#253), so the lock cannot answer whether | |
| 663 | /// this install still has work to do. | |
| 664 | pub fn isPackageInstalled(proj_dir: []const u8, modules_dir: []const u8, dep_name: []const u8) bool { | |
| 665 | const clean_name = resolvePackageAlias(normalizePackageName(dep_name)); | |
| 666 | // Stack buffer + access instead of openDir: this runs per dependency on | |
| 667 | // the fast path. | |
| 656 | 668 | var dest_buf: [std.fs.max_path_bytes]u8 = undefined; |
| 657 | 669 | const dest_dir = std.fmt.bufPrint(&dest_buf, "{s}/{s}/{s}", .{ proj_dir, modules_dir, clean_name }) catch return false; |
| 658 | 670 | io_helper.accessAbsolute(dest_dir, .{}) catch return false; |