Commit Graph

47 Commits

Author SHA1 Message Date
Slava Kim
6b145a5940 Fix path conversions in a lot of places 2015-01-20 22:03:24 -08:00
David Glasser
f5f136adc9 Don't crash on pathwatcher failures
Instead, increase polling interval for that file/dir to 500ms from 5s.

Fixes #3336.

The most common case where this was occuring is when you're on Linux and
your inotify max_user_watches is too low.  A wiki page will explain how
to increase this.  In debug mode, a message will tell you to go to the
wiki page if you hit the limit (we may later expose this message by
default, but it is part of the new user experience).
2014-12-22 12:19:59 -08:00
David Glasser
9b00c9436c fix bad merge 2014-12-19 11:51:16 -08:00
David Glasser
6320acabc4 Merge branch 'master' into devel
Conflicts:
	History.md
	tools/safe-pathwatcher.js
	tools/tests/old.js
	tools/watch.js
2014-12-19 11:42:50 -08:00
David Glasser
53808bc684 Remove dead justCheckOnce clause 2014-12-17 17:06:32 -05:00
Ben Newman
9c28836953 Deal with some file-watching race conditions. 2014-12-17 16:59:20 -05:00
David Glasser
356d6b91ff Remove dead justCheckOnce clause 2014-12-17 13:55:41 -08:00
Ben Newman
745de90b4e Don't rely on pathwatcher.watch to determine if files exist. 2014-12-17 16:55:06 -05:00
Ben Newman
e4fd1134a1 Deal with some file-watching race conditions. 2014-12-17 16:46:11 -05:00
Ben Newman
becfb57a15 Don't rely on pathwatcher.watch to determine if files exist. 2014-12-17 16:00:01 -05:00
Ben Newman
b7c4ca6ac1 Convert tools/watch.js to use the files.* API. 2014-12-16 19:42:08 -05:00
Sashko Stubailo
e7167e5257 Factor out almost all fs. and path. calls in the tool
This will be useful when we want to be smart with windows file paths later
Also, all of the file calls are asynchronous with fibers now, which comes with
many benefits.

This is a combination of 23 commits. Original messages:
Wrap a large number of fs calls inside files.*

Convert a few more fs calls to files.*

More moving fs.* to files

Implement read/write streams and open/read/close

Get rid of fs from auth.js

Remove fs and unused imports from catalog-local and catalog-remote

Remove unused imports from catalog.js

Replace a whole lot of fs calls

Fix error

Migrate a lot more fs. calls to files.

Add a temporary symlink method

Convert old test to files.*

Use files.pathX instead of path.x everywhere

Replace path.x to files.pathX in tests

Small fixes to files.js and one rename

Make cleanup run in a fiber

Make wrapping functions take function name in case we need it

Add some timeouts and stuff to HCP tests

wrapFsFunc also makes a sync version of the function

Sometimes you just don't want to yield!

Make sure JsImage readFromDisk doesn't yield

Remove unused imports from npm test

Change order of test now that some things don't yield

Fix missing files import, and add a debug error printout
2014-12-15 15:32:06 -08:00
Ben Newman
0f00c9e482 Fall back to fs.watchFile if pathwatcher.watch does not work.
Fixes #3284.
2014-12-15 13:13:15 -08:00
Ben Newman
ddae20cb4b Fall back to fs.watchFile if pathwatcher.watch does not work.
Fixes #3284.
2014-12-15 11:17:50 -05:00
Ben Newman
0713b7c8d8 Use pathwatcher.watch to trigger rebuilds and restart the server.
Fixes #2135.
2014-11-26 15:48:53 -05:00
David Glasser
06114d6983 Fix 'meteor publish'
only works from inside an app! does not include a version lock file!
2014-11-25 09:06:24 -08:00
David Glasser
399681e04f move sha1 from Builder to watch
since watch actually uses it and Builder doesn't
2014-11-12 17:13:41 -08:00
David Glasser
6998b1a747 Revert accidental watch change from 78497c0
Fixes #2550.
2014-09-10 17:43:02 -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
Emily Stark
58e4a31df8 Fix WatchSet.merge to actually merge files.
Not sure why this was commented out?
2014-03-30 20:39:39 -07:00
Geoff Schmidt
6c993f1ea2 first draft of 3-phase local package builder 2014-03-14 01:14:47 -07:00
ekatek
78497c0b6b Read versions instead of packages in the packages.js hack 2014-03-07 11:18:36 -08:00
David Glasser
3ebc9aba60 arguably support empty regexs in file watcher 2014-02-28 11:59:03 -08:00
Naomi Seyfer
d91110bd9c Merge branch 'devel' into sso
Conflicts:
	packages/livedata/livedata_server.js
2014-02-04 14:04:30 -08:00
Nick Martin
d1331e9c7a Reuse sha1 hashes calculated by the file watcher.
The file watcher (watch.js) calculates the sha1 hash of source files
to see if they've changed.  For static assets in `public`, the bundler
then calculates the same hash again for the client manifest.

This commit adds a small optimization to return the hash calculated by
the file watcher, so that it can be reused by the bundler.

There are more optimizations that probably could be done to avoid
other unnecessary sha1 hash recalculations, but they'd likely need
larger architectural changes.
2014-02-04 01:06:59 -08:00
David Glasser
990450c2a6 Backport some comment-punctuation changes
From tool-refactoring to sso.

Makes the tool-refactoring/sso diff a little smaller (including removing
some files from it entirely) and easier to review.  Only took about five
minutes to prepare, I swear this isn't a total waste of time :)
2014-01-30 21:08:56 -05:00
David Glasser
daf0a4801a Ensure 500 ms of directory watch downtime.
Should help with #1506.

Fingers crossed for an eventual usable fs.watch.
2013-10-22 16:10:57 -07:00
David Glasser
67a7c2786b Don't hash settings file during deploy. 2013-10-19 01:03:50 -07:00
David Glasser
606a94b41d Calculate settings file hash properly. Fixes #1497.
Previously we were hashing the Unicode string, not the bytes.

This also removes a race condition. Now there is only one use of
watchSet.addFile which does not go through
watch.readAndWatchFile (adding package.js hashes to multiple watch sets
at once), and that use does correctly hash the bytes.
2013-10-18 16:18:24 -07:00
David Glasser
6c0f7dff02 Yield during background directory watches. 2013-10-11 14:18:05 -07:00
Nick Martin
085b9bb0e5 Remove now unneeded double check. 2013-10-11 13:11:22 -07:00
Nick Martin
135de89282 Rip out fs.watch entirely. 2013-10-11 13:09:27 -07:00
Nick Martin
287d43bd99 Don't use fs.watch. Poll directory contents instead. 2013-10-11 10:01:29 -07:00
David Glasser
392daa0a99 Detect symlink cycles in app dirs. 2013-08-02 10:59:41 -07:00
David Glasser
1d45b0bfa8 update comments 2013-07-31 23:26:51 -07:00
David Glasser
a2803fd111 watch nonexistent dirs better 2013-07-31 22:56:57 -07:00
David Glasser
1b82376b4b in theory, this might work 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
ad5b20990e get watch-test to pass 2013-07-31 22:56:38 -07:00
David Glasser
5ac411652a twiddle exports 2013-07-31 22:56:38 -07:00
David Glasser
4dc5aaf683 rewrite Watcher 2013-07-31 22:56:38 -07:00
David Glasser
5b76eb7a85 watcher rewrite: Add WatchSet and readDirectory. 2013-07-31 22:56:38 -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
Geoff Schmidt
4eec2ec057 Make watch.stop() kill timers. 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
6fc6bf1dca Packages are modeled as a set of separately-compilable Slices 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