Commit Graph

61 Commits

Author SHA1 Message Date
Stephen Darnell
8883056bf7 Switch to socket.end() 2013-10-09 09:59:24 -07:00
David Glasser
bda5113fa5 meteor run: Handle errors in the websocket proxy by closing socket instead of
throwing
2013-10-07 14:18:29 -07:00
David Glasser
0f0542efb1 Replace byline npm module with eachline.
Node 0.10-compatible versions of byline (eg 3.1.2) drop empty lines.
2013-10-03 15:52:20 -07:00
David Glasser
60d5566763 http-proxy is called http-proxy again. 2013-10-03 15:52:19 -07:00
David Glasser
dd7172ab7f Use an http agent (this was default in old http-proxy but not in caronte). 2013-09-24 17:13:38 -07:00
David Glasser
5f146a9d72 Update run.js to use caronte API. 2013-09-24 17:13:38 -07:00
Slava Kim
9368852bdc Improve error message
Glasser's comments
2013-09-24 16:31:44 -07:00
Slava Kim
63589300fe On MongoDB failures print 20 lines of stderr and print a special error if mongod failed to start due to incompatible version of glibc.
Catch stderr before 'exit' signal

Try to give a good error message on outdated glibc/libstdc++.

Simplify error reporting to two lines.

Print only last 20 lines of stderr.

Slightly better error message.
2013-09-24 15:20:08 -07:00
Nick Martin
83a34947ee Fix regression: display stdout/stderr in the meteor-is-crashed page in development mode. 2013-08-07 12:11:39 -07:00
David Glasser
558bcb8877 Don't print a doubled slash if it's included in ROOT_URL.
This should not affect how Meteor.absoluteUrl actually works since it adds a
slash to the end of the root URL if it doesn't have one already.
2013-08-02 11:40:55 -07:00
David Glasser
e823b1e54a Don't watch files for reload until after starting the server.
Specifically, don't watch until after serverHandle points to the NEW
process. This way, if the watcher files, we are sure to kill the new process,
not fail to kill it because serverHandle is still pointing at the old process or
no process. The old behavior led to sometimes failing to kill the server; while
it would eventually die due to failed keepalive, the new servers would also fail
due to EADDRINUSE.

This change is possible because unlike the only dependencyInfo, WatchSets are
completely self-contained (there's no "... and it should look like it did the
first time" involved).

While we're at it, make restartServer always stops the watcher, and clear some
variables after they're used.

Fixes #1247.
2013-08-01 16:11:06 -07:00
David Glasser
1a5d695ee4 fix minor bugs. bundler-test passes! 2013-07-31 22:56:57 -07:00
David Glasser
ea22b3ab02 Checkpoint for actually using WatchSets.
Have not yet touched initFromAppDir.
2013-07-31 22:56:38 -07:00
David Glasser
d1c481f714 Address EPIPE (etc) crashes from the runner http-proxy during hot code reload.
A better fix involves improving http-proxy itself but they're in the middle of a
giant Node 0.10 compatibility rewrite. This addresses the bug reported by Tim
Haines in a hacky but useful way.
2013-07-25 16:29:14 -07:00
Geoff Schmidt
b3130558d2 During development, don't reload packages that didn't change.
Saves about 150ms off development reload.
2013-07-16 23:48:10 -07:00
Naomi Seyfer
2e608e3abf Glasser comments on ssh-auth branch 2013-06-13 16:23:24 -07:00
Naomi Seyfer
66695a75d0 all things served on path prefix always 2013-06-13 16:22:32 -07:00
Avital Oliver
0070812fba logs on stderr are warnings, not errors 2013-05-29 10:44:12 -07:00
David Glasser
6299f69754 Upgrade Connect to 2.x.
Set $NODE_ENV appropriately (to 'development' in 'meteor run' and 'production'
otherwise) so that connect doesn't send stack traces over the network in
production.
2013-05-28 12:14:11 -07:00
David Glasser
1a35b699e2 Fix hot code reload.
This was broken by 957729c, which switched the child process listener from
'exit' to 'close' but didn't update another line which removed that listener. So
we had an allergic reaction to killing our own subprocess.
2013-05-28 11:01:58 -07:00
Emily Stark
5a84a01d17 Change objFromText to Log.objFromText 2013-05-22 18:13:16 -07:00
Slava Kim
f6f69abd0b Remove one-time methods, split printColorfullyTextOrJSON 2013-05-22 16:36:10 -07:00
Slava Kim
6773112254 Print stderr with colors. 2013-05-22 15:22:01 -07:00
Slava Kim
77092dfe1d Add method that prints object and falls back to printing string. 2013-05-22 11:43:57 -07:00
Slava Kim
7510d202e8 Extract logFromText into logging package.
So we can reuse it.
2013-05-21 16:58:53 -07:00
Naomi Seyfer
dfdbbe6f16 make deploy work again by making the bundler stub main.js add program.json to the command line 2013-05-21 15:42:30 -07:00
Naomi Seyfer
770948338b Fixing various bugs that keep seismograph from running tests. Mostly package.js stuff 2013-05-21 15:19:01 -07:00
David Glasser
957729c8ce Get run-tools-tests.sh passing.
In addition to minor "make the tests match the code" changes, there's also:

 - missing require('tar') in tarball download code
 - fix an fd leak in the bundler that was causing EMFILE on mac
 - switch run.js to listening for 'exit' to 'close' so that the end
   of stdout/err can be read
 - some concerningly necessary deletions of .build directories

Also, the version of cli-test.sh that runs against a fixed release is disabled,
since we're not building releases with the new package format for now.
2013-05-17 18:19:20 -07:00
Avital Oliver
627f346b95 Meteor server logging API
Also colorize and print nicely in run.js
2013-05-15 14:54:35 -07:00
David Glasser
2d827e74fc Factor webapp-specific stuff (and keepalive) out of boot.js into webapp package.
Replace type: "bare" with type: "server" in attributes.json.  This now just
means "only make one server process" rather than controlling the boot script.

Programs that are type: "traditional" that want to be a webapp now need to
explicitly depend on the webapp package.
2013-05-13 11:58:58 -07:00
Geoff Schmidt
b51865acac Pass '--program' to 'meteor run' to run a different program.
You get automatic restarts and by the same token you get a proxy.
2013-05-13 11:58:57 -07:00
David Glasser
ab3c30f577 Fix command-line parsing with --keepalive. 2013-05-13 11:57:48 -07:00
Geoff Schmidt
02e1b3b1c7 Make 'meteor --help' startup >3x faster, with the help of a require() tree profiler. The speedup is entirely due to lazy-loading third party modules. 2013-05-13 11:56:51 -07:00
David Glasser
78d8f61564 Remove inaccurate comment and logging line.
(This function is not documented to users, but it's what the livedata package
uses to implement audit-check-coverage.)
2013-05-13 11:54:20 -07:00
Geoff Schmidt
1049c2d7d2 add missing dependencies (following rebase on devel) 2013-05-13 11:54:20 -07:00
Geoff Schmidt
ed18c6ffb5 Comprehensive build-time error reporting system. In particular: if an error occurs, the build will try to continue to identify any other potential problems so that they can be flagged too. Syntax errors are captured and dealt with programmatically, rather than just being echoed to stderr by node. Stack traces are parsed to pull out file and line information, and a distinction is made between the 'user' and 'internal' portions of the stack. All of this is at build time only -- it has not been extended to (run-time) server or browser yet. Also, no source maps yet, though line numbers are computed correctly for units within the linker. 2013-05-13 11:52:43 -07:00
Geoff Schmidt
f102598c6f For faster startup, don't let run.js flush the package cache until first reload. 2013-05-13 11:51:53 -07:00
Geoff Schmidt
e26732d3dd Factor out bundle file-handling logic into new Builder class 2013-05-13 11:51:52 -07:00
Geoff Schmidt
78a31231cd rename Library.flush -> Library.refresh because the old name was confusing 2013-05-13 11:51:52 -07:00
Geoff Schmidt
24682fd7f4 New Watcher implementation (for watching for changed files and determining when to rebundle the app.) Unlike the old DependencyWatcher, it uses absolute paths and contains no Meteor-specific knowledge. Also unlike the old DependencyWatcher, it has comprehensive unit tests (scripts/watch-test.sh). 2013-05-13 11:51:52 -07:00
Geoff Schmidt
1266e5278e Don't write bundle dependencies (files to monitor) to disk. Just plumb them through in memory from the bundler to the runner. 2013-05-13 11:51:52 -07:00
Geoff Schmidt
57db17dde0 Only create one Library. Flush it when the runner detects changes, not at bundle time, because that makes more sense. 2013-05-13 11:51:52 -07:00
Geoff Schmidt
43c29fbd0b move Library into its own file 2013-05-13 11:51:51 -07:00
Geoff Schmidt
67356c0988 continue factoring out Library 2013-05-13 11:51:51 -07:00
Geoff Schmidt
562490b776 bundler takes a library 2013-05-13 11:51:51 -07:00
Geoff Schmidt
bb07daa25e continue refactor toward Library 2013-05-13 11:51:51 -07:00
David Glasser
9ba35e7b79 Add a few more "=>" markers to runner messages.
(Not worth forcing into 0.6.0.)
2013-04-04 00:02:58 -07:00
David Glasser
8d220f6b46 Fix "meteor test-packages" in installed Meteor. 2013-04-01 12:27:20 -07:00
David Glasser
36f870a6ab Catch files that change immediately after the server restarts by doing a
one-time content scan. Addresses Issue #223.

This addresses two cases: files that change during a slow bundle (eg, during
slow NPM updates) and *do* end up with a different mtime (which could also be
addressed in other ways, see eg the issue-223-dead-end branch)... and those that
change twice within the same second on OSX HFS+ which only has 1-second mtime
resolution, which really cannot be addressed in any purely mtime-based way.

This still is not 100% perfect. Most notably, any files read via
register_extension (which is to say, basically all source files other than
package.js and static resources) still have a race between hash calculation and
the actual read done by the bundler, since the register_extension API takes a
source_path rather than contents. This could be addressed by making
register_extension handlers take the contents as an argument too (and encourage
the use of source_file only for things like printing errors with filenames, not
actually for reading the file). In addition, this won't detect files added after
the bundler passes them but before the initial DependencyWatcher run.
2013-03-31 23:01:44 -07:00
David Glasser
fe1d61db40 more effective detection of stdout/err use for restart message 2013-03-29 22:27:51 -07:00