Commit Graph

9134 Commits

Author SHA1 Message Date
Justin SB
625a87fe19 Avoid passing empty options, and defend against it if we do release/GLASSER-TEST@1.0-cs1 2014-08-21 12:01:23 -07:00
David Glasser
c926cf01f0 Cache minimal constraint versions 2014-08-21 11:39:01 -07:00
David Glasser
aa53f0bfd2 Simplify ConstraintsList data structure
It now no longer has N nested 2-element hashmaps; the 2-element split
happens at the top level in the JS object.  And a nested hash_map is now
just a set (it's great that we can rely on the interned-ness of
constraints!)

8% benchmark speedup and less code.
2014-08-21 11:31:27 -07:00
David Glasser
05b6277c97 delete unused field 2014-08-21 10:52:05 -07:00
David Glasser
ff3d3d0e82 delete unused methods 2014-08-21 10:51:00 -07:00
David Glasser
f1a50bbc93 show stack if error is unexpected 2014-08-21 10:48:20 -07:00
David Glasser
13f82bb09d Keep alternatives sorted
Instead of recalculating the "edge versions", just keep the list of
alternatives for each dep sorted and look at the first and last.

Provides another 25% speedup to the benchmark, deletes a lot of
code, *AND* removes the one part of the constraint solver that tries to
have a deep understanding of the different constraint types other than
the "is this constraint satisfied" function (ie, makes it easier to add
more constraint types later).
2014-08-21 10:45:44 -07:00
David Glasser
374c1cda45 Simplify "make trivial easy choices immediately"
Instead of having two different spots where we do special checks to see
if a piece of the state might have only one alternative, we just ensure
that the ResolverState itself always eagerly converts one-alternative
dependencies into choices.
2014-08-21 02:40:02 -07:00
David Glasser
75fcdf5d3e Refactor ConstraintSolver.Resolver
Factor out the "state" into its own class, ResolverState.  The big
difference from the previous state object: it actually explicitly tracks
the set of potential UnitVersions for every active dependency.  This
essentially replaces the DependencyList class.

Because we always know exactly how many options there are for a given
dependency, we can both generalize and simplify the "propagate
transitive exact deps" optimization.  That optimization only worked on
"foo@=1.2.3" dependencies, which meant it didn't apply in any other
situation where there was only one possible package to choose. But there
are a whole lot of other situations like that: local packages, packages
that just don't have many versions, packages that already have a lot of
constraints applied to them, etc.  By tracking the set of potential
alternatives, we can just make sure to always expand 1-alternative units
first. We also maintain the aspect of the optimization where we don't
need to call the cost function until we've actually gotten to a state
with multiple neighbors.

This keeps #2410 fixed as well.

I've removed the constraintAncestor support as part of this refactoring,
so some error messages may be worse than they were before. But this
should set me up pretty well to improve error messages tomorrow.
2014-08-21 01:28:55 -07:00
David Glasser
f96d00932b Merge branch 'constraint-solver-errors-ancestor' into release-0.9.0
Improves the #2410 fix to (at least for the particular case) be a little
less hacky: it's now OK if bad packages exist somewhere in the graph as
long as there's a way to avoid them.
2014-08-20 23:22:37 -07:00
David Glasser
6e325247d5 Prefer to explore local packages first
(Or other packages where there is literally one version in existence.)
2014-08-20 23:21:30 -07:00
David Glasser
e98cd49b3b A more specific error for nonexistent package
This helps with #2410 though that particular case doesn't work since
paths are explored in a bad order.
2014-08-20 23:21:30 -07:00
David Glasser
eb101e90b8 Also use mori for choices
Now there's no _.clone in resolver.js!
2014-08-20 23:21:30 -07:00
David Glasser
8d72be167b track ancestry as chain, not just root
switch constraintAncestor to be a nested mori.hash_map/mori.list
2014-08-20 23:21:30 -07:00
David Glasser
7e32a1cba4 Revert "one weird hack to maybe have better messages for nonexistent packages"
This reverts commit 75df1097e0.
2014-08-20 23:21:30 -07:00
David Glasser
4586d60e7d Revert "bad merge diffs"
This reverts commit 7946be9f9b.
2014-08-20 23:21:30 -07:00
Matthew Arbesfeld
d771fdbf2a Fix uniload for packages with plugins 2014-08-20 20:54:58 -07:00
David Glasser
080f6f60dd Lower version numbers of some third-party packages
We haven't yet decided how we want to do versioning for packages that
mostly just wrap non-Meteor code that has its own version numbers. We
might stick to totally-unrelated version numbers (and maybe add a
"wrapped version" field that gets displayed in the upgrade/downgrade
messages?), or change to matching upstream versions (with techniques for
dealing with changes to packaging, a la debian_revision), or something
different.

But since changing to match upstream versions is a possibility, let's
make sure that that operation won't be viewed as a "downgrade" by
updating the wrapped packages whose upstream versions are 0.*.
2014-08-20 17:14:57 -07:00
ekatek
7946be9f9b bad merge diffs 2014-08-20 16:20:29 -07:00
ekatek
75df1097e0 one weird hack to maybe have better messages for nonexistent packages 2014-08-20 16:19:24 -07:00
David Glasser
0bc445e8d2 Make slow operations more bearable with Patience
Introduces a "Patience" class which lets CPU-bound operations like the
constraint solver yield every so often, and print messages if an
operation (CPU-bound or not) are taken or not.
2014-08-20 15:49:58 -07:00
ekatek
019d3d289e don't crash when removing a nonexistent package 2014-08-20 15:20:22 -07:00
Emily Stark
4ce2888596 Change meetup /members URL.
Apparently secure.meetup.com doesn't work anymore.
2014-08-20 11:53:03 -07:00
David Glasser
6f1c74465b adjust which tests are from checkout 2014-08-19 19:34:26 -07:00
ekatek
b28a84cca2 wrap opennign server connection in a try/catch block from refresh 2014-08-19 18:47:37 -07:00
Matthew Arbesfeld
0df7bdc378 Fix client side reload race condition
There was a race condition between the bundle process and when we established
the client watch set. We now store the future for the old bundle process so
that it cannot be invalidated.
2014-08-19 18:38:36 -07:00
David Glasser
2866a2018f version bump for rc10 release/METEOR-CORE@0.9.0-rc10 2014-08-19 17:31:18 -07:00
ekatek
ff8498dd1b mark tests from checkout if they use the test server due to release duplication issues 2014-08-19 17:07:53 -07:00
ekatek
6e6a48a913 output safety 2014-08-19 15:33:38 -07:00
David Glasser
6d353044d4 Merge branch 'upgrade-tar-fstream' into devel 2014-08-19 14:11:46 -07:00
David Glasser
ec3ecb3523 Remove work-around for fstream bug
Now fixed upstream.
2014-08-19 14:10:00 -07:00
David Glasser
9fefcb2a6f update fstream/tar to fix tarball crash
https://github.com/npm/fstream/issues/26

We were working around this before, but this is a better fix. Plus might
be a (probably unobservable?) performance improvement since we do fewer
fs ops.
2014-08-19 12:58:32 -07:00
David Glasser
fceacf2885 Use 15-second timeout for service connections
This should reduce failures to send package stats.
2014-08-19 12:41:00 -07:00
ekatek
52e3eafa5c tests and minor fixes for --name 2014-08-19 12:32:16 -07:00
ekatek
b29a4cc439 more detaled wip on name coming from package.js 2014-08-19 12:32:16 -07:00
David Greenspan
63f984c5e5 Fix stack trace fix after testing in Safari 2014-08-19 11:08:13 -07:00
David Greenspan
187c86b3e5 Improve Deps error reporting for Cordova
In Chrome, the built-in, non-standard property `e.stack` starts with `“Error: ”+e.message`.  So we said `(e.stack || e.message)`.  However, in Cordova, e.stack does not include e.message.  So detect whether e.stack includes e.message or not and act accordingly (to avoid losing the message or printing it twice).

Also add some comments and stop printing “Exception from Deps afterFlush function function”.
2014-08-19 10:56:19 -07:00
David Glasser
84955c7ff4 selftest.fail instead of faux expectEqual 2014-08-19 10:39:56 -07:00
David Glasser
d8ff20103d version bumps (pre rc10)
We'll make rc10 tomorrow, but I want to build a release just to play
with built releases again.
release/GLASSER-TEST@maybe-rc10
2014-08-18 20:48:43 -07:00
David Glasser
69cf01a138 don't leak readstream 2014-08-18 20:11:47 -07:00
David Glasser
883fc8516d files.OfflineError prettier than [object Object]
(It should also be caught at every httpHelpers.getUrl call and handled
properly, but this is a start.)
2014-08-18 20:10:52 -07:00
David Glasser
196089ae33 package-client: Help users without usernames
- If they're in deferred-registration state, give them their
  registration link and exit.

- Before running the login prompt, mention that it's a Meteor developer
  account which you can sign up for on www.meteor.com.
2014-08-18 19:13:06 -07:00
David Glasser
9054effdeb Fix ServiceConnection DDP negotiation
Now ServiceConnection's guarantee is that once a DDP connection is
successfully negotiated, it won't restart. This relies on the assumption
that the only use of reconnect({_force: true}) is DDP protocol
negotiation!

Drop some unnecessary (and flawed, for this application) `disconnect`
stream events.

Also, remove some unnecessary `new` calls.

Fixes 'meteor mongo some-galaxy app'.
2014-08-18 17:09:04 -07:00
David Glasser
f3085db2d2 Work around a node-tar bug
See https://github.com/npm/fstream/issues/26
2014-08-18 15:10:15 -07:00
David Glasser
b1b1520f3e Remove lots of pre-packaging scripts/admin stuff
You can still find it on release-0.8.3! :)
2014-08-18 00:40:00 -07:00
David Glasser
9ed6204acc Remove awssum submodule 2014-08-18 00:37:14 -07:00
David Glasser
4ac638d60b oops, didn't mean to add blank line 2014-08-18 00:32:15 -07:00
David Glasser
558fb92651 state that package stat error is only in checkout 2014-08-18 00:31:12 -07:00
David Glasser
4af87eadb1 old test app version bump (this is silly) 2014-08-18 00:28:37 -07:00
David Glasser
73b33ee4da note about why official.refresh uses buildmessage 2014-08-18 00:28:23 -07:00