This will be useful when we want to be smart with windows file paths later
Also, all of the file calls are asynchronous with fibers now, which comes with
many benefits.
This is a combination of 23 commits. Original messages:
Wrap a large number of fs calls inside files.*
Convert a few more fs calls to files.*
More moving fs.* to files
Implement read/write streams and open/read/close
Get rid of fs from auth.js
Remove fs and unused imports from catalog-local and catalog-remote
Remove unused imports from catalog.js
Replace a whole lot of fs calls
Fix error
Migrate a lot more fs. calls to files.
Add a temporary symlink method
Convert old test to files.*
Use files.pathX instead of path.x everywhere
Replace path.x to files.pathX in tests
Small fixes to files.js and one rename
Make cleanup run in a fiber
Make wrapping functions take function name in case we need it
Add some timeouts and stuff to HCP tests
wrapFsFunc also makes a sync version of the function
Sometimes you just don't want to yield!
Make sure JsImage readFromDisk doesn't yield
Remove unused imports from npm test
Change order of test now that some things don't yield
Fix missing files import, and add a debug error printout
It's still in unmigrated commands.
Remove tropohouse's catalog. It was there to stop you from downloading
local packages but downloadPackagesMissingFromMap does that based on the
PackageMap now.
There is no longer a uniload catalog when running from a release, since
the release contains whole isopackets (programs) not
isopacks (packages).
We only need a uniload-specific catalog when we're actually rebuilding
isopackets (not in order to load them), so we now have it as a local
variable in the two places that build isopackets.
The deleted code in package-loader.js was specific to the prebuilt
uniload package which no longer exists.
- Simplify internal data structure to just have one map of name ->
various data instead of a whole bunch of different unsynchronized data
structures (most of which were used with frequent O(n) operations).
- Move the getLoadPathForPackage logic which combines local and remote
packages into LayeredCatalog from LocalCatalog, and delete the
unnecessary copy in BootstrapCatalogCheckout.
- Rename a bunch of fields to make it explicit which ones contain
package objects, which ones contain package directories, and which
ones contain package *search* directories
- Replace random version IDs and a long comment about why random is safe
with sequential. (I don't think these version IDs are ever used
anyway.)
- Drop unused "initializing" option to refresh
- Drop redundant call to _recomputeEffectiveLocalPackages in
addLocalPackage (it is called immediately below by refresh).
It used to need buildmessage because catalog.official.getReleaseVersion
used to be capable of rebuilding local packages. Now it can't! Simplify
all call sites.
Note that buildmessage was not actually used to express "no such
release", before or now.
If we don't clean up the tarball, then the following command (`meteor
build`) fails ("Couldn't create tarball"), but for some reason still
exits with code 0. So we then go on to successfully untar the output of
`meteor build`. If we clean up the tarball from `meteor bundle`, we at
least catch the failure by trying to untar a nonexistent file.
Actually verify that uniloaded packages are in the list. Add missing
'ejson'. Remove (ah well) test that relies on ability to uniload an app
package (which shouldn't work anyway, but it would be nice to test
uniload Assets...)
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.