Skip to content

Commit

Permalink
fix: ensure missing package dependencies trigger a sync (#340)
Browse files Browse the repository at this point in the history
This manifested because the gradle package depends on "jre". The
installed JRE satisfied this constraint initially but was later
upgraded. Because dependency resolving didn't set syncOnMissing, this
resulted in a "package not found" error.
  • Loading branch information
alecthomas authored Nov 9, 2022
1 parent 7a5229c commit b678983
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/exec_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func (e *execCmd) Run(l *ui.UI, cache *cache.Cache, sta *state.State, env *hermi
return errors.WithStack(err)
}

// Collect dependencies we might have to install
// if they are not in the cache
// Collect dependencies we might have to install if they are not in the
// cache
deps := map[string]*manifest.Package{}
err = env.ResolveWithDeps(l, installed, manifest.ExactSelector(pkg.Reference), deps)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion env.go
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ func (e *Env) ResolveWithDeps(l *ui.UI, installed []manifest.Reference, selector
return nil
}
}
pkg, err := e.Resolve(l, selector, false)
pkg, err := e.Resolve(l, selector, true)
if err != nil {
return errors.WithStack(err)
}
Expand Down

0 comments on commit b678983

Please sign in to comment.