What is the difference between Pkg.resolve and Pkg.instantiate?

If you don’t have a Manifest.toml, then they’re equivalent. If you do, then:

  • instantiate will download and precompile any packages that are listed in the Manifest.toml
  • resolve will first check that the Manifest.toml is consistent with the Project.tomls of the current project and all its dependencies, updating it if necessary, then instantiate.
    • this is particularly useful during development: e.g. if you’re using a dev-ed dependency of a package and add a new dependency to it, then you need to go resolve your top project to make sure these changes are reflected in its Manifest
  • update will use the newest possible dependencies (subject to compatibility constraints)
8 Likes