Commit Graph

12187 Commits

Author SHA1 Message Date
David Glasser
021e9f767d Don't include line number comments in isopackets
The extra legibility is not as useful for code that is always part of
core as it is for user's packages, and it actually has a notable (25%)
effect on isopacket load time.

Fixes #3218.
2014-12-03 12:38:20 -08:00
David Glasser
14cdfa0e02 Factor out common code for building isopackets 2014-12-03 12:28:45 -08:00
Ben Newman
ff7863d3e2 Start Mongo in parallel with the build.
For freshly created apps, this commit reduces the time required to start
the development server from 4.6s to 2.5s on my machine.

Not calling findMongoAndKillItDead unless Mongo fails to start shaves off
a few hundred milliseconds, too.

Fixes #3010.
2014-12-02 18:21:36 -05:00
David Glasser
a937aa606d Soft refresh, versioned packages only
First half of #3213.
2014-12-01 19:48:06 -08:00
David Glasser
2f90467da0 Optimize constraint solver's catalog interface
We shouldn't ask sqlite for a list of rows and then go back and ask for
each row one by one!

Addresses #3043.
2014-12-01 19:20:28 -08:00
David Glasser
3c1c568530 Add indices for all sqlite queries
Addresses #3043.
2014-12-01 19:03:10 -08:00
David Glasser
701bf7872e Remove final #3006 comment 2014-12-01 18:39:40 -08:00
David Glasser
050a01dcf2 Move tryRevokeOldTokens to background fiber
And increase the timeout while we're at it.
2014-12-01 18:38:39 -08:00
David Glasser
ab3d6c5bfb Clean up some #3006 comments 2014-12-01 18:29:20 -08:00
David Glasser
06fbe35d46 Support deploying to legacy Galaxy prototype 2014-12-01 17:42:13 -08:00
David Glasser
04a65c19e4 fix make-bootstrap-tarballs 2014-12-01 17:00:06 -08:00
David Glasser
c49a441d3d self-test: prepare apps after createApp
This means that the first command won't need to do a big build (and
print lots of package changed notifications). Similar to what 'meteor
create' does.

Also add --prepare-app command.
2014-12-01 14:43:15 -08:00
David Glasser
dc97864e16 improve some tests 2014-12-01 10:29:33 -08:00
David Glasser
e956a3b237 remove unnecessary use of NO_METEOR_PACKAGE 2014-12-01 01:41:27 -08:00
David Glasser
bf00def694 clean up comments and remove dead code
Part of #3006 cleanup.
2014-12-01 01:41:14 -08:00
David Glasser
d75aba324c use sqlite instead of racy json file for banners 2014-12-01 01:41:13 -08:00
David Glasser
ff3e4439d4 PackageSource and buildJsImage don't need catalog
It wasn't really being used for anything anymore except complaining
about api.versionsFrom being used during isopacket builds, which is now
implemented in a simpler way.
2014-12-01 01:41:13 -08:00
David Glasser
44454ce480 Remove upgrade-to-engine again
It was resurrected to make sure that people could upgrade to 1.0, but
that's over.
2014-12-01 01:41:12 -08:00
David Glasser
b4a7f4018e Remove 'meteor prep' command
This was just added to help in testing the work in issue #3006. 'meteor
--get-ready' now serves a similar purpose.
2014-12-01 01:41:12 -08:00
David Glasser
03b3f941a3 Make --get-ready do something useful
This command was changed in 0.9.0 to do something of questionable use,
and was temporarily unimplemented as part of work on #3006.  It now does
something relatively simple to describe: It prepares your current app
for build, and in addition, it downloads EVERY package in your current
release and builds EVERY available local package (including those which
you are not using in your app).
2014-12-01 01:41:12 -08:00
David Glasser
fe40ee08e4 Simpler PackageSource.initFromPackageDir interface
There's only one call site which always passed {requireVersion: true,
defaultVersion: "0.0.0"}, so just inline those values.

Also, move some validation of the version string into the place where it
is set instead of some other random place.
2014-12-01 01:26:35 -08:00
David Glasser
7d4757b3ac Show package changes and prerelease warnings
This reimplements functionality that had been removed as part of the
`isopack-cache` branch refactoring.

Information about package changes is encapsulated inside a
PackageMapDelta object on the ProjectContext.  It is the responsibility
of the command that prepares the ProjectContext to choose to call
projectContext.packageMapDelta.displayOnConsole at the appropriate time
if it wishes to display changes.

Part of #3006.
2014-12-01 01:26:35 -08:00
David Glasser
de9536172e Fix anticipated pre-release calculation
This commit fixes a 0.9.3 regression where the calculation of the
topLevelPrereleases object was not updated with the introduction of
disjunction constraints (||) and would always be empty.

topLevelPrereleases and useRCsOK are merged into a single
anticipatedPrereleases option which is now passed in to the
constraint-solver package rather than constructed inside it. (This
object will also be used in ProjectContext as part of PackageDelta
calculation.)

The usedRCs return flag is now called
neededToUseUnanticipatedPrereleases.
2014-12-01 01:26:34 -08:00
Ben Newman
0713b7c8d8 Use pathwatcher.watch to trigger rebuilds and restart the server.
Fixes #2135.
2014-11-26 15:48:53 -05:00
Ben Newman
2407adbecc Implement funcUtils.coalesce(delayMs, callback). 2014-11-26 15:48:46 -05:00
Ben Newman
c65b588dcd Trigger a rebuild to pick up @glasser's dev_bundle/server-lib changes. 2014-11-26 14:45:41 -05:00
Ben Newman
187b0e00f2 Make a note of future aspirations about installing pathwatcher. 2014-11-26 14:23:18 -05:00
Ben Newman
4403a5bf7e Install pathwatcher from NPM instead of GitHub. 2014-11-26 13:52:50 -05:00
David Glasser
47902dcac9 Merge branch 'dev-bundle-cleanups' into devel 2014-11-26 10:49:48 -08:00
David Glasser
f403b06799 switch unmatched pushd to cd 2014-11-26 10:22:27 -08:00
David Glasser
1487d824be move tool deps to package.json to run npm dedupe 2014-11-26 10:19:37 -08:00
David Glasser
289d92f2ec separate server deps from tool deps
move package.json to a JS file so it can have comments.
2014-11-26 09:45:49 -08:00
David Glasser
bfffb986cb generate-dev-bundle: use local node/mongo tarballs
(kind of like the dev bundle itself)
2014-11-26 09:24:35 -08:00
David Glasser
7b3f03f152 fix typo, thanks @dgreensp 2014-11-26 08:58:11 -08:00
Ben Newman
01a19bf182 Don't remove the rimraf dependency from pathwatcher/node_modules/.
One of the actual dependencies (as opposed to devDependencies) of
pathwatcher (fs-plus) depends on rimraf, but it doesn't get installed in
pathwatcher/node_modules/fs-plus/node-modules/ because it's already
installed in pathwatcher/node_modules/, so we should avoid deleting it.
2014-11-26 00:45:08 -05:00
Ben Newman
ad03de15fc Download pre-built node and mongo build artifacts from S3. 2014-11-26 00:01:49 -05:00
Ben Newman
b8cb7ee04f Add script for building mongo separately. 2014-11-25 22:08:14 -05:00
Ben Newman
f85c02ca8b Add script for building node separately. 2014-11-25 22:08:14 -05:00
Ben Newman
fff79abea8 Source build-dev-bundle-common.sh in generate-dev-bundle.sh. 2014-11-25 20:56:59 -05:00
Ben Newman
c8b5e30984 Decompose common dev_bundle build logic and variables. 2014-11-25 20:56:59 -05:00
Slava Kim
b203cc3d26 fix typo in a comment 2014-11-25 17:14:16 -08:00
Ben Newman
48f8d7f89c Install node-pathwatcher from our branch. 2014-11-25 15:58:13 -05:00
David Glasser
180586a115 Merge branch 'isopack-cache' into devel
MAJOR INTENTIONAL CHANGES

- Structured project initialization through a new ProjectContext
  object. Everything about initializing project metadata, resolving constraints,
  building local packages, etc now happens EXPLICITLY when it is requested
  instead of implicitly at low levels of the code.  This makes it much easier
  for us to do proper error handling and to guess which parts of the code are
  fast operations and which might cause build steps, downloading, etc to
  occur.

  Most commands just create a ProjectContext object and call
  prepareProjectForBuild (in a buildmessage capture) on it; this function reads
  project metadata, runs package.js files to initialize the local catalog,
  resolves constraints, downloads missing versioned packages, builds local
  packages, and saves any changed metadata.  Commands that need finer control
  can advance the state machine to an earlier stage of the process; eg, 'meteor
  add' just reads metadata and initializes the catalog, then adds some
  constraints, and then continues the rest of the project preparation.

  Most of the metadata files have an explicit class in ProjectContext to
  represent their state. The files are read properly using WatchSets. The file
  classes can be used independently of ProjectContext too.

- The constraint solver is never run on individual packages!!!  It is only run
  in the context of the entire project. Formerly, it was run in the project
  context as well as for each local package being built (including the app
  pseudo-package).

- Fewer singletons.  There is no `project` singleton any more; ProjectContexts
  are managed dynamically.  There is no `catalog.complete` any more; a
  ProjectContext has a `projectCatalog` (which corresponds to the old layered
  catalog.complete) as well as direct access to the `localCatalog`.  We still do
  have `catalog.official`.

- Built packages are cached per app instead of in the source tree.  The main
  upside here is that if you are sharing a package source tree between multiple
  apps, you don't have to deal with the concurrency issues and constant rebuilds
  if dependencies/meteor releases are different between apps. This also means
  that you don't lose package caching if you don't have write access to the
  source tree.  The logic around the per-app cache is much simpler and more
  likely to be correct.

  There are some downsides here!  For example, `meteor create` is slower than it
  used to be because it needs to compile all the packages used by your app
  rather than relying on them having a cache in a build tree. And commands that
  build packages but don't maintain an app have to rebuild every time; most
  notably, publish and test-packages. (For test-packages I hope to add some hack
  to make this faster; for the time being you can use the `--test-app-path` flag
  that was added for cordova to point to some random directory which can get
  reused across invocations.)

- The only packages that ever get built or loaded into memory are those which
  the constraint solver tells us are part of your package. A corollary here is
  that if tool code has bugs where it tries to use a package that's not part of
  the package map returned from the constraint solver, it will crash instead of
  silently building the package. This is a good thing, and has highlighted some
  inconsistencies in our model.

- Some tweaks have been made to the constraint solver's input and output. We
  include plugin dependencies as constraints now; this means that if you are
  building a package which contains plugins from source, the package choices
  made for the packages going into the plugin have to be consistent with the
  choices made for the broader project.  Also, we now enforce dependencies at
  the simpler package level rather than at the unibuild level; this means that
  your .meteor/versions file may contain versions for packages that don't
  contribute any unibuilds to your app but which are required in order to build
  other packages that do.

- The versions.json file from package source and bundled package source trees is
  gone. In its place is a `.versions` file which always exists in bundled source
  tarballs and which exists in package source trees only when the package is not
  inside an app. This file looks like .meteor/versions, not its own JSON schema.

- We no longer support the "programs" directory inside a project source tree,
  which was designed for a previous Galaxy prototype.

TEMPORARY ISSUES WHICH WILL BE FIXED ON DEVEL

The following regressions will be fixed after merge; they didn't seem important
enough to block merging.  They are all marked with "XXX #3006".

- Commands no longer print messages about what packages have changed. I just
  need to think of a good API that doesn't involve literally printing messages
  at a low level in the code, and go back and implement it.  See
  #ShowPackageChanges in the code.

- The warning that you're using RC versions that you didn't ask for is not being
  printed.

- --get-ready is not implemented (it just fails with a message).  It did
    something weird in recent versions and can now do something much simpler,
    but I have to actually implement it.

- I have not tested make-bootstrap-tarballs

- Most self-tests (even slow ones!) pass.  The following (slow) ones don't:
  - package-tests: sync local catalog
  - package-tests: update server package data unit test
  - package-tests: talk to package server with expired or no accounts token
  - package-tests: packages with organizations
  - publish: publish-and-search
  - publish: publish-one-arch
  - publish: list-with-a-new-version
  - publish: do-not-update-to-rcs
  - publish: package-depends-on-either-version
  - report-stats: report-stats
2014-11-25 09:48:03 -08:00
David Glasser
1d4c3e7387 comment tweaks 2014-11-25 09:35:34 -08:00
David Glasser
d76f489b0f beginning of fixing make-bootstrap-tarballs 2014-11-25 09:12:19 -08:00
David Glasser
f4e69b9e96 Fix test-bundler-assets some more 2014-11-25 09:06:31 -08:00
David Glasser
8deba5c9bb Last references to PackageLoader and catalog.complete are gone 2014-11-25 09:06:31 -08:00
David Glasser
ab6317a0ff Remove old project.js 2014-11-25 09:06:31 -08:00
David Glasser
0275afcfc9 maybe improve self-test 2014-11-25 09:06:31 -08:00
David Glasser
d4c7bf2020 tentative steps towards publish tests passing 2014-11-25 09:06:30 -08:00