Commit Graph

32 Commits

Author SHA1 Message Date
Ben Newman
277fa504a7 Honor options.forceConvert in tryExtractWithNpmTar. 2016-07-28 13:58:16 -04:00
Ben Newman
2f40d3bfbb Refactor verbosity logic for .tar.gz extraction. 2016-07-28 13:58:16 -04:00
Ben Newman
4fa4bd7351 Fix .tar.gz extraction bugs on Windows. 2016-07-28 13:58:16 -04:00
Ben Newman
136c2f8696 Don't let previous extraction attempts interfere with later ones. 2016-07-28 13:58:15 -04:00
Ben Newman
ed624147d7 Use native tar or 7z.exe for extracting tar.gz files when possible. 2016-07-28 13:58:15 -04:00
Ben Newman
391a7a3134 Ensure parent directory exists in files.writeFileAtomically. 2016-07-14 11:27:56 -04:00
Ben Newman
6c55961d98 Revert "Tolerate UNKNOWN errors in files.statOrNull on Windows."
This reverts commit 7ea260dac2.

The original reporter of #7243 says the problem has gone away (see
https://github.com/meteor/meteor/issues/7243#issuecomment-227643684), and
I would rather not hide UNKNOWN errors if we can help it.
2016-06-22 15:26:37 -04:00
Ben Newman
8507d44717 Flatten the files.withCache hierarchy.
It turns out throwing away cached results collected during nested
file.withCache calls was not a good idea.
2016-06-22 15:12:30 -04:00
Ben Newman
a2e380d154 Cache files.{stat,lstat,realpath,readdir} hierarchically.
Passing a function to files.withCache invokes the function and causes the
results of these four files.* methods to be cached for the duration of the
function invocation.

Part of #7253 and #7008.
2016-06-22 14:41:54 -04:00
Ben Newman
7ea260dac2 Tolerate UNKNOWN errors in files.statOrNull on Windows.
Fixes #7243.
2016-06-21 13:40:15 -04:00
Ben Newman
e60878a8ab Revert "Reimplement files.rm_recursive with fs.renameSync."
This reverts commit 73685f6cf8.

It's a shame to have to walk back this optimization, but performance isn't
worth loss of stability: https://github.com/meteor/meteor/issues/7168
2016-06-06 13:27:13 -04:00
Ben Newman
9856d1d418 Declare files.rename a "quickie" rather than reimplementing it.
This reverts commit b5c104b09e, which was
breaking tools/tests/compiler-plugins.js tests.
2016-06-02 17:08:03 -04:00
Ben Newman
b5c104b09e Reimplement files.rename in terms of fs.renameSync.
There's no reason renaming should yield, and it's much faster if we do it
synchronously, anyway (30 seconds saved during modules test app startup).
2016-06-02 12:03:04 -04:00
Ben Newman
73685f6cf8 Reimplement files.rm_recursive with fs.renameSync.
This saves 25+ *seconds* when building the modules test app, and will
likely have huge benefits for any other sizeable app, too.

Since the temporary directory is created with files.mkdtemp, and those
directories are cleaned up at shutdown, this reimplementation effectively
defers the work of rm_recursive until shutdown, which is much better than
doing it during startup.
2016-06-02 11:25:58 -04:00
Ben Newman
355e850829 Avoid more uses of fs.exists and fs.existsSync.
Part of #6921.
2016-05-16 18:21:13 -04:00
Ben Newman
bab72a03d1 Implement files.exists in terms of file.statOrNull.
The hitherto-underlying fs.exists function has been deprecated in Node v4.

Part of #6921.
2016-05-16 18:21:12 -04:00
Ben Newman
d94e7d812d Upgrade dev bundle meteor-promise to 0.7.1. 2016-05-16 18:21:11 -04:00
Ben Newman
4c9ecc3c1f Revert watch.isUpToDate optimizations to fix #6556.
This reverts commit 7227f64ea8.
This reverts commit b4972af3a5.

Saving 400ms of rebuild time isn't worth sometimes having to restart the
app from scratch.
2016-03-22 14:17:20 -04:00
Ben Newman
7227f64ea8 Don't assume <10sec build times in watch.isUpToDate.
If you have a lot of packages and you change something in a package that
is used by lots of other packages, such as "meteor" or "modules", then the
rebuild can take a lot longer than ten seconds.
2016-03-14 19:35:52 -04:00
Ben Newman
b4972af3a5 Optimize watch.isUpToDate for rebuilds.
Another ~400ms saved.
2016-03-14 13:40:03 -04:00
David Greenspan
2afe4f5767 files: do synchronous stat
It's a lot faster!  Checking if a WatchSet is up-to-date or looking
for imported modules was dominated by stat overhead.
2016-02-05 01:46:47 -08:00
David Greenspan
5e6a6963af files.copyFile: don't stat again if have mode
we were already passing the mode of `from` into `files.copyFile`
in at least one place, but `files.copyFile` was dropping it on
the floor.  now we use it avoid doing a second stat.

Also, list copyFile in the profiler report.  copyFile does its own
custom file I/O, so it didn't show up as a readFile or writeFile
which are automatically profiled.
2016-02-05 00:55:26 -08:00
David Greenspan
2fca3a9599 Profile more of tool and improvements to Profile
Previously, we would generate reports on
"Selecting Package Versions" and "Rebuild App".

- Instead of just profiling constraint solving, profile the entire
  process of preparing the project via ProjectContext, by giving
  each public function that "advances the stage" a Profile.run
  (typically prepareProjectForBuild).
- Improve profiler output to better distinguish multiple runs
- Distinguish "Build App" and "Rebuild App"
- Instrument lots of calls that weren't instrumented before
2016-02-03 11:54:05 -08:00
David Greenspan
d3749485be Profile a few more things 2016-02-01 08:45:36 -08:00
Ben Newman
46e631e099 Eliminate Future from tools/files.js. 2015-12-09 12:06:51 -05:00
Ben Newman
ed17924940 Add braces to every if/for(-in)/while statement in tools directory. 2015-11-13 12:25:19 -05:00
Slava Kim
0234ee546e Tiny bit of info about mini-files.js 2015-08-07 11:18:29 -07:00
Slava Kim
39d8aef3d9 move files into console/ tool-testing/ 2015-08-06 16:39:00 -07:00
Slava Kim
924b1b40e0 Remove an extra execFile ref 2015-08-06 16:00:39 -07:00
Martijn Walraven
22bd755918 Fix currentEnvWithPathsAdded to use case insensitive access on Windows 2015-08-04 15:11:53 +02:00
Slava Kim
5fb18bfb58 an mvp readme for /tools/fs 2015-08-03 23:15:12 -07:00
Slava Kim
6b1bb038d8 Move files into tools/fs 2015-08-03 22:09:28 -07:00