We're going to make uniload use a different flavor of "complete" catalog
soon. So we need to reduce the number of singleton-ish references to
it.
Also, we need one PackageCache per catalog, so stop it from being a
singleton too.
Moving towards a world where all things that might invoke buildmessage.error are
encouraged to be in a buildmessage.capture.
This commit is the answer to the question "how many small changes need to be
made to add buildmessage.assertInCapture to PackageCache.loadPackageAtPath?"
Next steps include:
- Making catalog.resolveConstraints ALWAYS buildmessage.assertInCapture
(not just when ignoreProjectDeps isn't passed)
- Then changing resolveConstraints to complain using buildmessage
- Removing the process.exit(1) in _ensureDepsUpToDate
- Adding a more structured way to ensure that most commands
call _ensureDepsUpToDate at an unsurprising location
we changed the effective format without changing the name a while ago
anyway. Technically we didn't need this before because we also changed
the .build dir name to .build.foo but this is still reasonable.
We used to keep the `packageDirectoryForBuildInfo` of every package that
a package directly depends on in its buildinfo.json; if direct
dependencies change, then we might need to rebuild because they could
have registered or unregistered a plugin. Now we just keep the package
name and version (including build for our local packages) of our direct
dependencies.