Skip to content

Commit 4e65e5d

Browse files
authored
[easy][bug] Fix install if package has no storepaths in lockfile (#2081)
## Summary Fixes issue introduced in https://github.com/jetify-com/devbox/blame/main/internal/devbox/packages.go#L558-L558 ## How was it tested? Removed store paths from lock file, ensured package was still installed.
1 parent 70e3e02 commit 4e65e5d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

internal/devbox/packages.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,16 +555,17 @@ func (d *Devbox) packagesToInstallInStore(ctx context.Context, mode installMode)
555555
if err != nil {
556556
return nil, err
557557
}
558-
if resolvedStorePaths != nil {
558+
if len(resolvedStorePaths) > 0 {
559559
storePathsForPackage[pkg] = append(storePathsForPackage[pkg], resolvedStorePaths...)
560560
continue
561561
}
562562

563-
storePathsForPackage[pkg], err = nix.StorePathsFromInstallable(
563+
storePathsForInstallable, err := nix.StorePathsFromInstallable(
564564
ctx, installable, pkg.HasAllowInsecure())
565565
if err != nil {
566566
return nil, packageInstallErrorHandler(err, pkg, installable)
567567
}
568+
storePathsForPackage[pkg] = append(storePathsForPackage[pkg], storePathsForInstallable...)
568569
}
569570
}
570571

internal/devpkg/package.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ func (p *Package) GetOutputsWithCache() ([]Output, error) {
718718

719719
// GetResolvedStorePaths returns the store paths that are resolved (in lockfile)
720720
func (p *Package) GetResolvedStorePaths() ([]string, error) {
721-
names, err := p.outputs.GetNames(p)
721+
names, err := p.GetOutputNames()
722722
if err != nil {
723723
return nil, err
724724
}

0 commit comments

Comments
 (0)