Commit Graph

5072 Commits

Author SHA1 Message Date
Emily Stark
b0e0ccb5a4 Bump package versions for 0.9.0.1 2014-08-27 15:16:49 -07:00
Emily Stark
1b639e5853 Bump package versions for 0.9.0.1-rc1 2014-08-27 14:28:03 -07:00
Justin SB
f1a7455d4c Spiderable now uses a flag to determine when the initial JS has loaded
Other approaches seemed to be heuristics that broke down in edge cases:
a timeout wasn't guaranteed if your JS was slow; page.load in PhantomJS
wasn't firing reliably because of long polling.
2014-08-27 12:25:45 -07:00
Matthew Arbesfeld
68c8a84155 Fix for SIGUSR2 signals during startup.
There was a rare race condition where SIGUSR2 can fire before the
  server starts listening, causing some functions to fail. We added
  a future to the synchronous queue to ensure that SIGUSR2 calls
  are queued to run after onListen.
2014-08-27 12:20:40 -07:00
Avital Oliver
9c9eadc079 Add COMPAT WITH 0.8.3 comment 2014-08-26 23:16:03 -07:00
Matthew Arbesfeld
a5eea24d47 Update autoupdate description 2014-08-26 23:05:59 -07:00
Avital Oliver
8373507288 Fix hot code push from pre-0.9.0 apps
For 0.9.0, we changed the structure of documents in the
ClientVersions collection. So now we just throw in a single
dummy document in the old format, triggering a reload.

Fixes #2447
2014-08-26 22:23:11 -07:00
David Glasser
6a6837e32c Fix constraint solver benchmark 2014-08-26 22:16:09 -07:00
David Glasser
43e01c09eb Improve treatment of prerelease (dashed) packages
Drop the "at-least" constraint type entirely. It was not user-accessible
and was only used in the form ">=0.0.0" to represent a constraint with
no version constraint at all. This type of constraint is now called
"any-reasonable".

The definition of "any-reasonable" is:

  - Any version that is not a pre-release (has no dash)
  - Or a pre-release version that is explicitly mentioned in a TOP-LEVEL
    constraint passed to the constraint solver

For example, constraints from .meteor/packages, constraints from the
release, and constraints from the command line of "meteor add" end up
being top-level.

Why only top-level-constrained pre-release versions, and not versions we
find explicitly desired by some other desired version while walking the
graph?

The constraint solver assumes that adding a constraint to the resolver
state can't make previously impossible choices now possible.  If
pre-releases mentioned anywhere worked, then applying the constraints
"any reasonable" followed by "1.2.3-rc1" would result in "1.2.3-rc1"
ruled first impossible and then possible again. That's no good, so we
have to fix the meaning based on something at the start.  (We could try
to apply our prerelease-avoidance tactics solely in the cost functions,
but then it becomes a much less strict rule.)

At the very least, this change should allow you to run meteor on a
preview branch like cordova-hcp without getting a conflict between the
prerelease package on the branch/release and the lack of an explicit
constraint in .meteor/packages on that package, because we are
reintepreting the .meteor/packages constraint as meaning "anything
reasonable" and the in-the-release version counts as reasonable.
2014-08-26 21:54:48 -07:00
David Glasser
c2c67b128e Fix infinite reload *AND* no-reload bugs in tests
The root of the problem David Greenspan tried to fix was that
__meteor_runtime_config__.autoupdateVersion was incorrectly 'unknown'
when running tests (due to packages/test-in-browser/autoupdate.js being
handled wrong by autoupdate_server.js).  Turns out the right solution is
to ensure the version is known, not to avoid reloading when the version
is unknown.
2014-08-26 20:45:07 -07:00
David Glasser
7358986f13 Revert "Fix infinite reload loop running tests"
This reverts commit 35d816a363.
2014-08-26 20:43:22 -07:00
David Glasser
5d4a93d627 Revert "Fix the fix to the infinite reload loop"
This reverts commit 1ad3dd17af.
2014-08-26 20:43:21 -07:00
David Greenspan
1ad3dd17af Fix the fix to the infinite reload loop
…after talking to arbesfeld
2014-08-26 17:46:52 -07:00
David Greenspan
35d816a363 Fix infinite reload loop running tests
(just a guess at the fix; arbesfeld to fix the fix if necessary)
2014-08-26 17:46:49 -07:00
Matthew Arbesfeld
e8437bd91b Fix for autoupdate refresh not firing on initial document
If you have an old version of the app loaded, startup won't
pick up the new version.
2014-08-26 11:55:26 -07:00
David Glasser
22c9ac644d autoupdate_client improvements
- use observe instead of observeChanges so that assets is there even if
  not changing

- protect against nonexistence doc.assets
2014-08-26 11:55:12 -07:00
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