MCPcopy Index your code
hub / github.com/jetify-com/devbox / installPackages

Method installPackages

internal/devbox/packages.go:465–482  ·  view source on GitHub ↗
(ctx context.Context, mode installMode)

Source from the content-addressed store, hash-verified

463}
464
465func (d *Devbox) installPackages(ctx context.Context, mode installMode) error {
466 defer debug.FunctionTimer().End()
467 // Create plugin directories first because packages might need them
468 for _, pluginConfig := range d.Config().IncludedPluginConfigs() {
469 if err := d.PluginManager().CreateFilesForConfig(pluginConfig); err != nil {
470 return err
471 }
472 }
473
474 if err := d.installNixPackagesToStore(ctx, mode); err != nil {
475 if caches, _ := nixcache.CachedReadCaches(ctx); len(caches) > 0 {
476 err = d.handleInstallFailure(ctx, mode)
477 }
478 return err
479 }
480
481 return d.InstallRunXPackages(ctx)
482}
483
484func (d *Devbox) handleInstallFailure(ctx context.Context, mode installMode) error {
485 ux.Fwarningf(d.stderr, "Failed to build from cache, building from source.\n")

Callers 1

ensureStateIsUpToDateMethod · 0.95

Calls 10

ConfigMethod · 0.95
PluginManagerMethod · 0.95
handleInstallFailureMethod · 0.95
InstallRunXPackagesMethod · 0.95
FunctionTimerFunction · 0.92
CachedReadCachesFunction · 0.92
EndMethod · 0.80
IncludedPluginConfigsMethod · 0.80
CreateFilesForConfigMethod · 0.80

Tested by

no test coverage detected