Commit Graph

67 Commits

Author SHA1 Message Date
Emily Stark
07f0c56a85 Preserve --mobile-server setting across hot code pushes.
The server sends hot code push updates to mobile clients with ROOT_URL
and DDP_DEFAULT_CONNECTION_URL taken from the MOBILE_ROOT_URL and
MOBILE_DDP_URL environment variables. These are set by the main meteor
process when it starts the app runner.
2014-10-03 15:46:43 -07:00
Slava Kim
cb9e38a7e6 Pass the appId to the application process in an env variable
Since it is passed only in the development mode it can be used for nifty things
like distinguishing mobile apps by a tuple of (id, server-url)
2014-10-01 12:07:11 -07:00
Ben Newman
f53c12815e Implement a meteor debug command.
Summary:
The `node-inspector` NPM package was added to the dev_bundle by this
recent commit: 64a624ae5c

Task: https://app.asana.com/0/15750483766338/16241466809965

Test Plan:
Add `debugger` statements to server code, run `meteor debug`, visit the
node-inspector URL in a browser, continue the application, and verify that
the debugger stops at the `debugger` statements that were set.

Reviewers: nim, slava, emily, avital, dgreenspan

CC: sashko

Differential Revision: https://phabricator.meteor.com/D827
2014-09-29 22:50:49 -04:00
David Greenspan
98eff9059e Capitalize buildmessages 2014-09-29 16:18:38 -07:00
Emily Stark
6041122944 Exit immediately if --parent-pid doesn't look like an integer.
If you pass "--parent-pid foobar", then we immediately log an error
message and exit. This check happens via `parseInt` rather than testing
for exceptions in `process.kill(parentPid, 0)` because `process.kill`
converts its pid argument to an integer, so `process.kill('foobar', 0)`
returns true just as `process.kill(0, 0)` does.
2014-09-26 14:01:19 -07:00
Emily Stark
2f47a81395 Comments from nim, ben 2014-09-25 15:30:17 -07:00
Emily Stark
af3fe5624b Replace keepalives with a check if the parent pid is still running.
Downsides:
* Doesn't catch the case where the parent is CPU-hogging (but maybe we
  don't want to catch that case anyway, since the bundler not yielding
  is what's causing #2536).
* Could be fooled by pid re-use, i.e. if another process comes up and
  takes the parent process's place before the child process dies.

Untested so far because I haven't been able to actually kill a parent
process in such a way that the child stays alive.
2014-09-25 15:30:17 -07:00
David Glasser
3379a13533 Use ChildProcess kill method to reload CSS
Using the method instead of process.kill means that we don't send the
signal if we already know the process is dead and that we don't throw on
ESRCH (ie, the kernel telling us the process is gone).  (If the process
has already died we will soon get around to doing a different kind of
restart.)

Fixes #2550.
2014-09-10 17:40:15 -07:00
David Glasser
1c432f7d03 Don't drop caches on the first build
Change a function to take options

Combined with previous commit, drops about a second from time to app
started in 'meteor run'
2014-09-08 19:05:16 -07:00
Emily Stark
28ec9e62d2 Start crash count reset timer only after app is bundled.
Change the timeout back to what it was before 0.9.0
2014-08-27 18:56:32 -07:00
Emily Stark
81a0a0c7e2 Update to new package stats format 2014-08-21 18:23:38 -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
b6955a3899 Move towards non-singleton catalog.complete
We're going to make uniload use a different flavor of "complete" catalog
soon.  So we need to reduce the number of singleton-ish references to
it.

Also, we need one PackageCache per catalog, so stop it from being a
singleton too.
2014-08-13 18:11:46 -07:00
Avital Oliver
aff7dfdb50 Record package usage on meteor bundle
Also eliminated arguments that weren't used anywhere,
and removed an XXX comment that was false (recordPackages
doesn't use buildmessage to report connection failures)
2014-08-13 13:57:08 -07:00
David Glasser
64d939acb2 Add a lot more buildmessage captures
Many of these (mostly in top level commands in commands-packages.js) are
not super well thought out: they use a new "doOrDie" helper to run some
function in a capture and exit if there are any messages.  We really
need to get a little more thoughtful about the big picture of error
handling (combining "build" errors, network errors, catalog errors,
etc). But this at least allows the addition of more buildmessage
assertions.

At the very least, this ensures that if you edit a package.js in a local
package while "meteor run" is running, that instead of crashing the tool
it properly shows the buildmessage and lets you fix the issue.
2014-08-11 17:06:28 -04:00
David Glasser
d8551ef656 Remove errant console.log 2014-08-07 14:37:26 -07:00
David Glasser
00b8ce07f3 runner "is it crashing" timeout increase to 3 secs
This fixes the test failure of the 'run' from checkout.  (It would be
nice if we weren't slowing down the rebuild in 0.9.0, but at least we
should ensure that this feature survives.)
2014-08-06 20:14:54 -07:00
David Glasser
ddc3657e4f Watch files which fail before emitting a resource
Regression introduced by the CSS watching code (specifically, f230eba62)
by the sourceIsWatched check. We need to be able to tell the difference
between "source handler didn't do anything because there was an error"
and "source handler didn't do anything because it's web-specific and
this is an os arch".

A simple fix would have been to interpret compileStep.error as
"sourceIsWatched = true", but I didn't think of that until after doing
it the slightly more complicated but more precise way :)

Also, ensure that if the runner rebuilds the client and there's an
error, it properly kills the app process (and the watchers and the
keepalive interval, etc).
2014-08-04 21:32:22 -07:00
David Glasser
7d05640ea0 Make buildmessage fiber-aware
Port a simplified version of Meteor.EnvironmentVariable and
Meteor.bindEnvironment to fiber-helpers.js to deal with this.

Identify uses of fiberHelpers.inFiber and switch them to either
fiberHelpers.bindEnvironment (if the callback they are wrapping is
semantically "part of" the context that creates the callback) or
fiberHelpers.inBareFiber (otherwise).

Without this, concurrency was causing the wrong buildmessage message
sets and jobs to be active when builds yielded.
2014-08-04 19:03:05 -07:00
David Glasser
06a7dc90b5 Add many buildmessage.capture/assertInCapture
Moving towards a world where all things that might invoke buildmessage.error are
encouraged to be in a buildmessage.capture.

This commit is the answer to the question "how many small changes need to be
made to add buildmessage.assertInCapture to PackageCache.loadPackageAtPath?"

Next steps include:
 - Making catalog.resolveConstraints ALWAYS buildmessage.assertInCapture
   (not just when ignoreProjectDeps isn't passed)
 - Then changing resolveConstraints to complain using buildmessage
 - Removing the process.exit(1) in _ensureDepsUpToDate
 - Adding a more structured way to ensure that most commands
   call _ensureDepsUpToDate at an unsurprising location
2014-07-30 22:16:21 -07:00
Matthew Arbesfeld
c65a199c3c Glasser fixes 2014-07-28 17:12:27 -07:00
Matthew Arbesfeld
55fe8a8aae Fix hot code push client-side reloads.
We were overwriting the server directory when a client-side file changed,
which made all process calls fail, such as process.cwd() and fs.*. We
abstracted out some of the builder code so that only the client targets
are "rebuilt" when a client side file changes.
2014-07-28 17:12:26 -07:00
Matthew Arbesfeld
fa97fc74b2 Fix run --once test. 2014-07-21 20:35:58 -07:00
ekatek
b4e3947aa6 on hot code push, remember to re-read local package sources 2014-07-15 10:51:58 -07:00
Matthew Arbesfeld
f230eba62b Client CSS and template injection. 2014-07-09 10:31:44 -07:00
David Glasser
ddba5d4a3f Never copy dev bundle node_modules into bundle
symlink as a special case for runner only

future commits on this branch will add a
package.json/npm-shrinkwrap.json that can be used by "meteor bundle"
users
2014-07-01 14:09:44 -07:00
Emily Stark
f761e898c8 Record session id on package stats 2014-06-25 11:12:12 -07:00
David Glasser
e0852a5928 make references to packageloader consistent 2014-06-23 22:24:44 -07:00
Avital Oliver
69cd9ccd8c Oops. This is the right merge conflict fix. 2014-06-16 14:06:16 -07:00
Avital Oliver
6ea5ab0ed1 Don't record package usage when running meteor test-packages 2014-06-16 14:02:47 -07:00
David Glasser
6d3257909d test-bundler-assets passes 2014-06-10 19:13:48 -07:00
ekatek
1cf0655da4 Bundler should not take appDir and loader as arguments anymore 2014-05-30 18:32:49 -07:00
ekatek
b97f7c5a76 renamed some catalog variables, more cleanup around catalog 2014-05-27 16:07:43 -07:00
ekatek
209fa3a59b reload project when restarting app in development mode 2014-05-25 19:13:15 -07:00
ekatek
6f3504a2d3 project refactoring, wip 1 2014-05-21 15:42:12 -07:00
Emily Stark
7ec7cb4d97 WIP: record package usage stats 2014-05-07 11:27:25 -07:00
David Glasser
fbde0a00a7 Merge branch 'publish-packages' into library-refactor
Conflicts:
	packages/domutils/package.js
	packages/handlebars/package.js
	packages/htmljs/package.js
	packages/liverange/package.js
	packages/spark/package.js
	packages/universal-events/package.js
	tools/bundler.js
	tools/help.txt
	tools/packages.js
	tools/run-app.js
	tools/run-mongo.js
	tools/skel/.meteor/packages
2014-04-24 17:01:36 -07:00
David Glasser
9b8bd31a7b Allow specifying interface with -p and --app-port
The syntax is "--port host:port".

Not implemented for test-packages. No control is available over mongo
ports (port or host).

Fixes #469 and #1105.
2014-04-18 14:15:14 -07:00
David Glasser
3405644027 Fix runner.stop() while waiting for file change
Before this, if the runner decided to stop (eg, because mongod is
crashing too much) while waiting for file change, it would crash due to
an attempt to wait within a fiber.  Fixing that bug by adding an inFiber
would then lead to the process just not exiting, because nothing stops
the wait-specific future.
2014-04-02 21:16:59 -07:00
David Glasser
82aa3485ac Assign the Fiber to self.fiber.
Doing so reveals a deadlock in the stop code (which causes self-test to
fail, yay).  Fix it by trying harder to not stop the (all or app) runner
until after the app runner has processed the "hey you should stop"
return false from onRunEnd.
2014-04-02 20:27:54 -07:00
David Glasser
3e76ad7946 Don't use require('./run-log.js').runLog
If you happen to introduce a circular require into the stack, this
object will be undefined.

Instead, hang on to `require('./run-log.js')`, which is the exports
module which does get filled in later.
2014-03-31 19:52:02 -07:00
ekatek
4f84ac57ba add in ctl hack and factor out project package loader 2014-03-18 16:24:45 -07:00
Geoff Schmidt
30dad184b7 'meteor run' works! (if you add 'templating') 2014-03-17 17:57:14 -07:00
ekatek
18af114204 meteor run works, but doesn't actually render 2014-03-17 17:17:13 -07:00
ekatek
4565c2d262 For direct dependencies only plugins affect buid 2014-03-14 17:25:40 -07:00
Geoff Schmidt
949361bae0 Remove the final references to Library and delete it! 2014-03-12 22:18:39 -07:00
ekatek
70b24926f3 better singleton naming 2014-03-12 11:57:08 -07:00
ekatek
3273897a71 PackageCache as singleton. Miscellaneous attempts to clean up 2014-03-11 21:27:13 -07:00
Geoff Schmidt
5f0d1714eb WIP: Break Library into PackageLoader, PackageCache, Catalog 2014-03-11 18:10:28 -07:00
David Glasser
c5efe36bce Ensure we don't double-return through runFuture 2014-02-14 01:06:18 -08:00