(ctx context.Context)
| 724 | } |
| 725 | |
| 726 | func (d *Devbox) FixMissingStorePaths(ctx context.Context) error { |
| 727 | packages := d.InstallablePackages() |
| 728 | for _, pkg := range packages { |
| 729 | if !pkg.IsDevboxPackage || pkg.IsRunX() { |
| 730 | continue |
| 731 | } |
| 732 | existingStorePaths, err := pkg.GetResolvedStorePaths() |
| 733 | if err != nil { |
| 734 | return err |
| 735 | } |
| 736 | |
| 737 | if len(existingStorePaths) > 0 { |
| 738 | continue |
| 739 | } |
| 740 | |
| 741 | installables, err := pkg.Installables() |
| 742 | if err != nil { |
| 743 | return err |
| 744 | } |
| 745 | |
| 746 | outputs := []lock.Output{} |
| 747 | for _, installable := range installables { |
| 748 | storePaths, err := nix.StorePathsFromInstallable(ctx, installable, pkg.HasAllowInsecure()) |
| 749 | if err != nil { |
| 750 | return err |
| 751 | } |
| 752 | if len(storePaths) == 0 { |
| 753 | return fmt.Errorf("no store paths found for package %s", pkg.Raw) |
| 754 | } |
| 755 | for _, storePath := range storePaths { |
| 756 | parts := nix.NewStorePathParts(storePath) |
| 757 | outputs = append(outputs, lock.Output{ |
| 758 | Path: storePath, |
| 759 | Name: parts.Output, |
| 760 | // Ugh, not sure this is true, but it's more true than not. |
| 761 | Default: true, |
| 762 | }) |
| 763 | } |
| 764 | } |
| 765 | if err = d.lockfile.SetOutputsForPackage(pkg.Raw, outputs); err != nil { |
| 766 | return err |
| 767 | } |
| 768 | } |
| 769 | return d.lockfile.Save() |
| 770 | } |
no test coverage detected