Commit Graph

5056 Commits

Author SHA1 Message Date
David Glasser
6cf7addcdc rc22 2014-08-25 22:50:33 -07:00
David Glasser
0030c3a1d7 rc21 2014-08-25 21:23:49 -07:00
David Glasser
5c5092eeae Test for bfb8359
This only tests the resolver part of the change, not the change that
gets the right data from "meteor add" into the solver.
2014-08-25 21:05:12 -07:00
David Glasser
bfb8359499 Only choose prerelease package versions if asked
Make sure 'meteor add foo' gives the same constraint to the solver as
'foo' from .meteor/packages: namely, '>=0.0.0' not
'unconstrained' (since the first rules out rcs and the second doesn't)
2014-08-25 19:57:28 -07:00
David Glasser
521f724e16 bump, rc20 2014-08-25 17:39:39 -07:00
David Glasser
23a57a9648 bump tool version again 2014-08-25 17:27:07 -07:00
David Glasser
96e606ab89 bump tool version 2014-08-25 16:47:37 -07:00
David Glasser
4e017c5938 rc18 2014-08-25 14:33:52 -07:00
David Glasser
f0890205ae rc16 2014-08-25 14:17:56 -07:00
David Glasser
6c7a29683c rc15! 2014-08-25 14:06:50 -07:00
David Glasser
0542a3a9ea 0.9.0-rc13, now on METEOR@ 2014-08-24 21:21:09 -07:00
David Glasser
e07aedb0fa Don't pin packages we're trying to upgrade
Now meteor update will actually upgrade the packages it's trying to
upgrade
2014-08-23 15:05:59 -07:00
David Glasser
75310c9493 vbump for rc12 2014-08-22 19:07:01 -07:00
David Glasser
f9744e5d93 Reduce size of less module by 60% 2014-08-22 18:32:00 -07:00
David Glasser
ff63e4fdb6 Revert "Lower version numbers of some third-party packages"
This reverts commit 080f6f60dd.

Unfortunately, this broke all packages that were published with
`api.versionsFrom('METEOR-CORE@0.9.0-atm')` that used one of these
packages.
2014-08-22 02:15:03 -07:00
David Glasser
55d1901729 Remove dormant "no-downgrade constraint" code
Also removes 'update --minor' and 'add --force'.

In the constraint solver, previousSolution (ie, .meteor/versions) was
intended to be used for three purposes:

  (a) The *heuristic* used in the state graph walk to decide what state
      to look at next:
       - VERY STRONGLY prefers not to downgrade *root* dependencies or
         change them to incompatible newer versions
       - Kinda Strongly prefers not to upgrade root dependencies far
       - mildy prefers not to change transitive dependencies (in any
         direction)

  (b) Actual *constraints* are added to the set of constraints we are
      trying to solve, which state that *root* dependencies are not
      to be downgraded.  Additionally, in most invocation contexts,
      constraints are added that say that *root* dependencies are
      not to be upgraded to incompatible versions (1.3.0 -> 2.0.0).
      The only contexts that lack the secondary constraints are
      part of 'update --minor', and 'add --force'.

  (c) A more recent change (past few weeks): When running the constraint
      solver, we actually run the core constraint solving algorithm
      twice. The first time, we add *equality* constraints for all
      of the previous versions.  If that succeeds, great!  We're not
      changing any versions (we may add packages that we didn't have
      before or drop packages that are no longer needed, though).

      Otherwise, we run the constraint solver again without the equality
      constraints.

However, due to a bug introduced in May in 0760ffbc36, (b) actually
*never happened*.  The commit was the one that intended to make the
(b) constraints only be for root dependencies. But the line:

     if (! _.contains(dependencies, uv.name))

is comparing 'uv.name' (something like 'foo#web.browser') to
'dependencies' (a list of things like 'foo'). So in fact, it thinks that
no dependencies are root and doesn't apply the constraints.

That's actually good, because this code is used in many more places than
just 'meteor update', and applying these things as strong constraints
would actually be problematic; eg, it would break 'meteor --release
slightlyolderrelease'!

In addition, the `update --minor` flag was actually not implemented (it
was not in the command declaration).

So for now, we're removing this dead code.  We may reintroduce 'update
--minor' or 'add --force' later.  We trust that the heuristic will do a
decent job of preventing unnecessary downgrades or incompatible upgrades
while still allowing you to run updates to an older version, eg.

(And in the future, we may change 'meteor update' to use the constraint
solver to figure out which release to update to, rather than going for
the latest one that there exists any solution for.)
2014-08-21 23:20:17 -07:00
David Glasser
53a844770f version bump for rc11 2014-08-21 18:45:08 -07:00
David Glasser
ceb8be5776 Remove distracting #web.browser from CS errors
You can get them back with $METEOR_SHOW_UNIBUILDS.
2014-08-21 17:53:37 -07:00
David Glasser
5295907f99 Make unknown package failure better
We throw a better (eg, constraintSolverError-tagged) "package not found"
at the appropriate spot later.
2014-08-21 17:47:00 -07:00
David Glasser
628be93f61 fix tests that tested lies! 2014-08-21 17:09:23 -07:00
David Glasser
5d5d1876da De-dup package name/constraint parsing code
Now we can all any of them from even before uniload is ready in the tool

I <3 symlinks
2014-08-21 17:00:21 -07:00
David Glasser
5bc415c51a Improve package name/version parsing errors
We now throw more specific errors, consistent between both tools and
package-version-parser (copy-and-pasted code, sadly, but we really do
have to make this check before uniload-from-checkout).
2014-08-21 16:21:12 -07:00
Justin SB
625a87fe19 Avoid passing empty options, and defend against it if we do 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
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
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
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
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
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
2866a2018f version bump for rc10 2014-08-19 17:31:18 -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
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
d8ff20103d version bumps (pre rc10)
We'll make rc10 tomorrow, but I want to build a release just to play
with built releases again.
2014-08-18 20:48:43 -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
3b3e8d7b93 Simplify ServiceConnection.
- ServiceConnection should never try to reconnect. It's already the case
  that we don't hold open ServiceConnections over long periods while
  idle; it makes the class much simpler if it corresponds to a single
  TCP connection. This also means that as soon as we have one connection
  failure (eg you're offline) we can fail instantly instead of retrying
  pointlessly.

- Drop the explicit timeout code in ServiceConnection. There's already
  timeout handling in stream_client, and now that we don't retry, it
  actually takes effect.

- Be more rigorous about uses of Future in ServiceConnection. Ensure
  that each Future is only used once (ie, avoid "Future resolved more
  than once" errors).  Hopefully fixes #2390.

- ServiceConnection constructor now blocks until it's connected (and
  throws if there's a connection failure).  Maybe this introduces a tiny
  bit more latency to the connection, but it makes it much easier to
  handle errors properly.

- In packageClient.handlePackageServerConnectionError, show the error
  message corresponding to the connection failure.

- In Node, the (newish) error passed to the Stream callback is now a
  "DDP.ConnectionError" object. We can detect this in the tool (and we
  don't even need to do some complex uniload/instanceof dance, since
  error classes made with Meteor.makeErrorType label themselves with a
  string errorType).  We also no longer have a special
  ServiceConnection.ConnectionTimeoutError.
2014-08-17 21:34:57 -07:00
David Glasser
87b3748ec5 node ddp client: send errors to disconnect event
this includes the timeout one
2014-08-17 20:30:34 -07:00
David Glasser
b4039173a6 Status shouldn't be "waiting" unless we will retry 2014-08-17 20:19:57 -07:00
David Glasser
2115eed79a Revert "include a backtrace for "got open from inactive""
This reverts commit 4378d9f5d0.

The previous commit switches to a version of Faye which fixes the bug
that causes this error to be thrown.
2014-08-17 20:16:54 -07:00
David Glasser
6aae5086e5 Switch to a fork of faye fixing close-before-start
This should stop all the "Got open from inactive client" errors.
2014-08-17 20:15:32 -07:00
David Greenspan
e897539adb Work-around for Safari JIT bug 2014-08-16 20:39:24 -07:00
David Greenspan
b5715a9621 Stop trying to fetch an MP4 file in tests
We test event capturing using the <video> “play” event, because it is a non-bubbling event native to modern browsers.  We previously had the src URL be a video on the Internet, but even if the video could not be accessed, the test still seemed to work.

So now set the “src” to “”.  Seems to work in IE 9, Firefox, Safari, Chrome.
2014-08-16 11:21:45 -07:00