This fixes a corner case where if you synced the catalog between the
creation of a release and the creation of its tool's build for your
platform, running `meteor --release R` would fail.
Fixes#3317.
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
Fixes#2846. Fixes#2847. Fixes#2979.
Errors in the build process that could be fixed by refreshing the
catalog now cause the catalog to refresh, assuming we have not already
refreshed it recently and that we are not offline.
These commands now don't need to refresh at startup: remove, run, debug,
create, build, bundle, deploy, test-packages, rebuild, and self-test
It should be OK for create to throw SpringboardToLatestRelease even
without refreshing, since release.latestKnown is still something we know
about.
No need to introduce the LayeredCatalog anywhere it's not needed.
Simplify some more things about LayeredCatalog:
- remove unused containingCatalog link from localCatalog to
layeredCatalog
- because of that, simplify LayeredCatalog initialization to occur after
localCatalog (no more circular references required)
- drop some other dead LayeredCatalog methods
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.
Also remove the subclass of LocalCatalog used for the isopacket building
catalog... it can just use LocalCatalog and set a flag (which is only
checked in one place).
This one won't be a singleton. Eventually project.js will be moved into
here.
Add a 'meteor prep' command which exercises new codepaths. It will be
deleted eventually.
So far, it converts .meteor/packages directly into the format that the
constraint solver wants. (Unlike the existing code which has several
intermediate formats.)
This is the first step in removing all references to
PACKAGESOURCE/.build.packagename caches. We will then implement a new
package cache from the ground up.
This was an undocumented and entirely unused feature (only two dummy
packages on the package server have this set to a non-default value).
No attempt is being made to remove the field from existing isopacks or
catalog entries. To continue to support existing clients, the package
server has been modified to ignore any provided
earliestCompatibleVersion and instead always write the default ECV to
the catalog.
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.
You can only request a named set of packages, not a random assortment.
In future commits, we will pre-build these packages into JsImages and
load them from that. Building packages for uniload will eventually not
involve the .build.foo directories at all. (All saved packages will be
built in app context, eventually.)
- Errors in merging the cordova branch against 273b70bea4 left
in an unnecessary getLocalPackages function
- LocalCatalog.getLocalPackageNames is unnecessary (it's the same as
getAllPackageNames!) CompleteCatalog.getLocalPackageNames is OK I
guess.
- getPackagesForTest returned some extra data that was only used to call
the nonexistent catalog.removeLocalPackage method. Meh, we don't
clean up the catalog when the command ends now (which doesn't happens
unless you're using --once anyway). We'll probably fix this by making
catalog.complete less global soon anyway (ie, it should be build-specific).
- Fix a duplicate test runner app cp_r
- 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).
They are unused (and were accidentally introduced in 0.9.4 with the
sqlite branch). The only thing you're allowed to query for releases is
the official catalog, since the complete catalog doesn't actually
augment releases with anything.
(If we later implement some sort of "local release", we should probably
also introduce a new release-specific interface that can be backed
either by sqlite or by sqlite-plus-local, analogous to catalog. There's
no real reason that it should be the same interface as catalog.)
These errors should look like connection errors, not clean closes:
- Heartbeat timeout (DDP-level or SockJS-level)
- Connection timeout (SockJS implementation)
The "disconnected with no error while waiting for something we asked
for" error in ServiceConnection is now a DDP.ConnectionError so that it
prints better.
If a command refuses to run due to a catalog sync error, it should print
the error. (Commands that merely warn that they could not sync don't
print that error, unless METEOR_LOG=debug.)
Since release.load no longer refreshes, we now need to manually
refresh. This is actually a great thing! It lets us look at modern
releases before legacy releases, which is the proper order anyway!