Commit Graph

202 Commits

Author SHA1 Message Date
Justin SB
7236af674c Throttle yields, so we don't slow down in case of rapid calls to yield
This restores the behavior I lost when I removed Patience
2014-10-09 19:58:39 -07:00
ekatek
f00643dbae move the check for local package up 2014-10-09 16:26:19 -07:00
ekatek
d07f4f1abf do not print unstable version warning if the version is local 2014-10-09 13:13:45 -07:00
David Glasser
5590d194c5 debug-only flag only affects bundler, not compiler 2014-10-07 18:26:21 -07:00
ekatek
e0414f2ed5 allow user to mark packages as debugOnly and not have them bundle in production mode
(still outstanding: changes to package publication workflow)

A package marked debugOnly in the package source is not to be bundled in production.
Moreover, if a package/app depends on a debugOnly package, that entire tree should
not be bundled. (But we should take it into account when figuring out versions!)

Does the following:

- In the catalog, we have a function that takes in a set of versions and a set of original
constraints and traverses it, recursively, to build a subset of versions that we *should*
bundle, and the corresponding subset of versions that we shouldn't (because they are either
debugOnly themselves or pulled in by debugOnly packages). (We do this in the catalog because
it is an addon onto the results of the constraint solver, tied deeply into our representation
of data)

- In the packageLoader, we keep track packages & versions that we should bundle, and also,
packages that we should exclude. We do this in the package-loader because, essentially, that's the
object that we use to keep the results of the constraint-solver, and we already propagate it to all
functions that care about it. (Possibly we should subsequently rename it later).

- In the compiler, when we figure out buildTimeDependencies, we ask if we need to bundle debug
builds. If not, we filter them out (see above). Also, when we actually build together unibuilds,
we don't touch the ones that the packageloader tells us to exclude (which ensures that they don't make
it into the final product).

- In the project, we keep track of whether this project is building in debug mode. That's because the project
is where we keep the state of our curent project that we are building, and if we are ever in the state of
building multiple things, then that's the code that we would need to touch (see also that we make a similar
assumption when solving constraints).

- Adds the option to keepthe project debug-build-free and calls it in commands when approporiate.
2014-10-07 15:55:50 -07:00
Justin SB
c99d7d42a6 Call utils.sleepMs(1); during package resolution
This is a temporary fix; we should call it less often
2014-10-07 15:20:32 -07:00
ekatek
eda7709316 fix forgottenECVs and reduce refresh rate
Two things:
 - to determine if two versions are compatible, we need to know their ECVs. (earliest
compatible versions). If the version that we have is local, then we don't have access to the
version record of the server version, so we can't figure out its ECV. That's why in the olden
days, there was a hack to store ECVs separately ('forgotten ECVs'). The new catalog didn't
have that function implemented -- it might not need it, but in that case, it would need to make
changes to the constraint solver that might be risky at this point. In any case, implementing this
function in the new world is pretty easy and solves the problem for now.

- when we look for things, we look in the local catalog, then the server catalog and if the server
catalog can't find it, it will refresh. However, sometimes, we are looking for something that the
server catalog cannot POSSIBLY have (ie: it has a build ID). That's fine, actually, but it causes
an extra refresh on the server catalog that we don't need. I put in a break to make sure that, if we
know for a fact that the server catalog does not have a version record (ie: it has a build id), we don't
bother looking in it and just return null to begin with. That should help.
2014-10-02 17:46:57 -07:00
Justin SB
aeee00b0cd Implement getLatestVersion on the local & layered catalogs 2014-09-30 18:03:06 -07:00
Justin SB
a71f16be32 Implement some toString functions on the catalogs 2014-09-30 18:03:06 -07:00
Justin SB
e9a88b00b9 Fix some fibers vs SQLite issues 2014-09-29 07:57:51 -07:00
Justin SB
e50fab39a0 Merge branch 'devel' into sqlite_store
Conflicts:
	tools/catalog.js
	tools/tests/autoupdate.js
2014-09-29 07:08:54 -07:00
Justin SB
db10e231a4 Support asymptotic progress bar for constraint solver
Until we either can estimate progress or have a spinner...
2014-09-24 15:53:04 -07:00
Pascal Rapicault
dfa6f892e2 format 2014-09-23 15:38:09 -04:00
Pascal Rapicault
2572ef9cf2 typo 2014-09-23 14:38:50 -04:00
Pascal Rapicault
f2df23dbeb move declaration of official catalog 2014-09-23 14:17:36 -04:00
Pascal Rapicault
c8aa848438 always try to resolve 2014-09-23 12:44:16 -04:00
Pascal Rapicault
9fba2ee766 properly format function name 2014-09-22 23:04:34 -04:00
Pascal Rapicault
32a0178e88 merge devel 2014-09-22 22:59:15 -04:00
Nick Martin
e76d6dc787 comment on style. 2014-09-19 20:00:19 -07:00
ekatek
8e9dbe6513 a less obnoxious banner that only comes up once 2014-09-19 19:34:14 -07:00
Pascal Rapicault
01428bc2a0 cleanup the refresh logic 2014-09-19 21:25:53 -04:00
Justin SB
9963a8bcf3 Progress bars and output formatting 2014-09-19 16:56:25 -07:00
ekatek
9c99638c7f be more consistent about using utils.parseConstraint in the tool; test for either-version 2014-09-19 16:56:24 -07:00
Pascal Rapicault
9149dd9fc8 clean reset 2014-09-19 17:45:15 -04:00
Pascal Rapicault
e432c1583c cleanups 2014-09-19 17:37:29 -04:00
Pascal Rapicault
73aff98b64 changes 2014-09-19 17:34:15 -04:00
ekatek
d8377487dc support multiple major versions in meteor 0.9.3 and above. A little hacky in the tool around keeping old interfaces, but it works 2014-09-18 00:12:30 -07:00
Pascal Rapicault
23c0c77ef7 reinitialize the resolver!!!!!!!! 2014-09-17 19:16:42 -04:00
Pascal Rapicault
e6b413a5e9 changing refresh 2014-09-16 16:09:46 -04:00
Pascal Rapicault
2adb8749ec changes 2014-09-16 11:28:47 -04:00
Pascal Rapicault
894638cec7 merge devel 2014-09-16 10:20:38 -04:00
Pascal Rapicault
870d1ce06d move getLatestMainlineVersion 2014-09-16 10:11:37 -04:00
ekatek
27be069475 temporary solution to springboard in publish-for-arch 2014-09-15 23:02:08 -07:00
Pascal Rapicault
2d46eeef2b add package cache to layered catalog 2014-09-15 15:13:52 -04:00
Pascal Rapicault
0ad00839f5 fix up the behavior of some methods 2014-09-15 11:49:36 -04:00
Pascal Rapicault
6cc7eee173 hook the remote catalog 2014-09-12 17:07:01 -04:00
Pascal Rapicault
86454f9210 split up the bootstrap catalog in separate files 2014-09-11 22:54:22 -04:00
ekatek
7af9519dc4 bettter message about experimental package versions 2014-09-10 16:17:25 -07:00
ekatek
f02314f66e glasser's responses on the -rc changes 2014-09-10 15:53:23 -07:00
ekatek
390b6394b5 strip out extra dependencies on semver in tool 2014-09-10 15:53:23 -07:00
Pascal Rapicault
cf955a20e5 Hook new catalog store as official catalog 2014-09-08 14:05:35 -04:00
David Glasser
b66f22b0ed This One Weird Trick Speeds Up Startup By 50%
This is a horrible horrible hack.  If for no other reason that (without
EJSON.clone around) it leaves internal pieces of catalog.official and
catalog.complete intertwined.

But! It does mean that every single tool startup now only has to read
and parse packages.data.json once instead of twice.  Which speeds up
'meteor --version' from 1 second to 0.5.

We'll solve this for real with the sqlite refactoring. But this is fast
and easy for now.
2014-09-04 21:38:03 -07:00
David Glasser
273b70bea4 prerelease versions shouldn't prompt you do update
Replace catalog.getLatestVersion with catalog.getLatestMainlineVersion,
which skips prerelease versions (those with dashes in the
version). Ensure that this function is only used by high-level commands
like 'meteor list'.  Replace other uses of that function with other
equivalent functions.

Also, don't stack trace on 'meteor add' constraint failure.
2014-08-26 23:56:51 -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
08b2625082 METEOR-CORE -> METEOR 2014-08-24 18:46:37 -07:00
David Glasser
d6855456a2 Use buildmessage better in api.use, etc
Provide good messages when you provide invalid things to api.use and
api.imply.

Provide better message when you provide invalid things to
api.versionsFrom.

Drop "notInitialized" hack from catalog: now that we load things in
order, it's not necessary.  (This means life will break if you use
api.versionsFrom in a uniloaded package. So don't do that.)
2014-08-21 16:48:13 -07:00
ekatek
e859266aaf changes, as per glasser's code review 2014-08-21 13:41:29 -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