Commit Graph

99 Commits

Author SHA1 Message Date
Jesse Rosenberger
9b056f5e91 Merge pull request #9341 from meteor/glasser/progress-status-only
Improved console behavior within the Emacs shell, and also general
Console refactoring to modernize ECMAScript use and remove Underscore.
2017-12-13 20:14:13 +02:00
Jesse Rosenberger
7268fb8ca0 Improve Emacs shell support by auto-detecting Emacs.
This adds a memoized helper function for detecting Emacs throughout the
CLI tool and automatically resorts to "ProgressDisplayStatus" mode when
Emacs is enabled.

In my tests with both Emacs 22 and 27, this nearly doubled performance
when using Meteor from within the Emacs shell (i.e. `M-x shell`).
2017-12-12 17:19:16 +02:00
Ben Newman
c8c88300a6 Fix remaining problems with PR #9237. 2017-11-22 14:44:22 -05:00
Edgar HIPP
16b74e5c0c Fix isNpmUrl to handle http/https urls (Closes #9236) 2017-11-22 14:44:22 -05:00
Ben Newman
1389db4631 Increase garbage collection throttling delay.
May help with this problem, which seems to stem from too much GC:
https://github.com/meteor/meteor/pull/8728#issuecomment-337636773

If this isn't enough, we could include this commit in 1.6.1:
5d212926e7
2017-10-19 11:31:23 -04:00
Ben Newman
9bedf027d4 Move VALID_ARCHITECTURES to its natural home, utils/archinfo.js.
Apparently importing cli/commands.js in isobuild/bundler.js led to calling
ensureIsopacketsLoadable more than once, which broke some tests.
2017-10-16 15:47:55 -04:00
Ben Newman
af016aa306 Disable automatic switching to 64-bit meteor-tool on Windows.
This means running `meteor update` on Windows with an existing (pre-1.6)
installation of Meteor will install a 32-bit version of Meteor 1.6, even
if the underlying machine architecture could handle a 64-bit version.

To get a native 64-bit version of Meteor, Windows developers should
reinstall Meteor 1.6 from scratch using the new and improved Windows
installer (👋 @abernix), rather than running `meteor update`.

If we really want to make `meteor update` just work , we can
revisit this change in Meteor 1.6.1.
2017-10-16 13:58:49 -04:00
Ben Newman
132a835086 Fix typo in archinfo.canSwitchTo64Bit.
5a9e837937 (r144887020)
2017-10-16 12:46:49 -04:00
Ben Newman
5a9e837937 Upgrade to 64-bit when possible on Windows.
Since we can't change the springboarding logic of existing Meteor
releases, this decision has to be made by the springboarded-to Meteor 1.6
release, and may result in a second springboarding.
2017-10-15 19:36:37 -04:00
Ben Newman
e9db660d03 Allow 64-bit Windows builds of meteor-tool to download 32-bit builds.
Once Windows developers update to a 64-bit version of Meteor 1.6, they may
still wish to run apps using older versions of Meteor where only 32-bit
builds of meteor-tool are available. This commit makes that possible.
2017-10-15 19:32:18 -04:00
Jesse Rosenberger
00bc5e6201 Address PR feedback from @benjamn on #9218. 2017-10-14 13:37:20 -04:00
Jesse Rosenberger
0dac129770 Introduce os.windows.x86_64 architecture for 64-bit Windows.
This commit reverts much of the work @hwillson had put in place for
meteor/meteor#9173, which made it possible for 32-bit and 64-bit
Mongo versions to exist in harmony within the same dev-bundle.  That
hard work was not in vein though as it offered invaluable research.
Ultimately, this showed that a more aggressive approach would be ideal,
even if the proposed option would have worked great in the short-term.

In the wake of the news that Mongo would no longer be supporting 32-bit
versions, these changes are important so 32-bit users of Meteor can
continue to have a functioning Mongo binary in development, while still
allowing Meteor to ship newer Mongo (e.g. 3.4+) binaries for 64-bit
users.  This is particularly relevant for Windows users, who have
previously only had 32-bit Meteor builds and represented a majority of
"32-bit" development, despite the fact most of their hosts supported
64-bit.  During another time in Meteor's life, this made sense.

This commit takes improved functionality to the next level (and makes
the aforementioned changes obsolete) by introducing support for building
and shipping Meteor for Windows in a 64-bit flavor (in addition to
32-bit), which will hopefully solve a number of performance matters on
Windows by using binaries which are pre-compiled for 64-bit, rather than
forcing the Windows kernel to deal with 32-bit binaries.  While Windows
has shown it's quite capable of dealing with such a situation, it seems
more and more clear (given improvements in underlying dependencies) that
performance gains could be had by freeing Windows of its 32-bit work.

This commit also further perpetuates the "archinfo" plot-line with more
story (about Windows) and various spelling corrections.
2017-10-14 13:36:29 -04:00
Hugh Willson
9a1f91843e Add Tool support for both 32 bit (3.2) and 64 bit (3.4) Mongo
These changes introduce dual Mongo support into the Meteor
Tool. 32-bit Mongo (3.2.15) will be used by Meteor when the
Tool is run on a 32-bit OS (32-bit Linux and Windows). 64-bit
Mongo (3.4.9) will be used when the Tool is run on a 64-bit
OS (64-bit Linux, Windows and macOS).

Fixes https://github.com/meteor/meteor-feature-requests/issues/129.
2017-10-14 13:36:29 -04:00
Ben Newman
a1d92f4c18 Merge branch 'release-1.5.2' into release-1.6 2017-07-17 18:02:39 -04:00
Ben Newman
7d87376bd2 Use multipipe and split2 to compose eachline streams. 2017-07-17 17:41:30 -04:00
Ben Newman
0f05575099 Simplify eachline by using split npm package. 2017-07-17 16:26:38 -04:00
Ben Newman
8af4955389 Use eachline@3.0.5 from npm instead of our own fork.
The pull request corresponding to our fork is not going to be merged, so
it's better to use the alternative this.finished API available in newer
versions of the upstream package.

https://github.com/williamkapke/node-eachline/pull/4
2017-07-14 13:34:33 -04:00
Ben Newman
25f003d0bc Throttle requestGarbageCollection to once per 500ms.
With Meteor 1.6 / Node 8, I noticed _buildLocalPackages taking multiple
seconds on initial server startup and restart, and the problem seems to be
that we call the global.gc function too often. This wasn't a problem in
previous versions of Node, as far as I know, but it makes sense to heed
the comment in tools/utils/gc.js, now that it matters.
2017-07-13 20:10:37 -04:00
Ben Newman
c253bdd71c Use eachline@3.0.5 from npm instead of our own fork.
The pull request corresponding to our fork is not going to be merged, so
it's better to use the alternative this.finished API available in newer
versions of the upstream package.

https://github.com/williamkapke/node-eachline/pull/4
2017-07-13 16:20:31 -04:00
Ben Newman
77843cdb28 Throttle requestGarbageCollection to once per 500ms.
With Meteor 1.6 / Node 8, I noticed _buildLocalPackages taking multiple
seconds on initial server startup and restart, and the problem seems to be
that we call the global.gc function too often. This wasn't a problem in
previous versions of Node, as far as I know, but it makes sense to heed
the comment in tools/utils/gc.js, now that it matters.
2017-06-06 12:52:09 -04:00
Ben Newman
0d7c9e8481 Merge branch 'wip-upgrade-to-node-6' into release-1.6 2017-05-30 15:41:12 -04:00
Ben Newman
2a3fd57303 Style tweaks and a small bug fix.
These checks should still happen when body is an empty string, which (for
better or worse) is falsy in JavaScript.
2017-05-22 16:40:48 -04:00
David Glasser
5f18c6e24a tools: fix Galaxy discovery
1a036553 in 1.4.4.2 expanded on the HTTP error checking added by 30aec9f in
1.4.2. Neither of these changes were aware that discoverGalaxy invokes
httpHelpers.request with json:true, resulting in a `body` that is a parsed JSON
object rather than a string or Buffer.  Before 1.4.4.2, this had no consequences
because body.length is undefined and `undefined < 90` is false, but the change
to Buffer.byteLength actually made the condition true.

It's safe to not check length in the JSON case because a truncated JSON object
is not legal JSON (unless the truncation just drops trailing whitespace, in
white case that's OK).

I check for both string and Buffer because some calls to this function pass in
an encoding option.  Buffer.byteLength works with both types.
2017-05-22 16:40:42 -04:00
Ben Newman
31c0d19019 Style tweaks and a small bug fix.
These checks should still happen when body is an empty string, which (for
better or worse) is falsy in JavaScript.
2017-05-21 12:09:34 -04:00
David Glasser
3dbac9e19c tools: fix Galaxy discovery
1a036553 in 1.4.4.2 expanded on the HTTP error checking added by 30aec9f in
1.4.2. Neither of these changes were aware that discoverGalaxy invokes
httpHelpers.request with json:true, resulting in a `body` that is a parsed JSON
object rather than a string or Buffer.  Before 1.4.4.2, this had no consequences
because body.length is undefined and `undefined < 90` is false, but the change
to Buffer.byteLength actually made the condition true.

It's safe to not check length in the JSON case because a truncated JSON object
is not legal JSON (unless the truncation just drops trailing whitespace, in
white case that's OK).

I check for both string and Buffer because some calls to this function pass in
an encoding option.  Buffer.byteLength works with both types.
2017-05-21 12:09:34 -04:00
Ben Newman
5900f5cfb6 Merge branch 'release-1.5' into wip-upgrade-to-node-6 2017-05-11 16:36:16 -04:00
Ben Newman
1a036553c1 Fix faulty content-length comparison in utils/http-helpers.js.
Since body is a string, body.length is not necessarily the number of bytes
in the response body.
2017-04-25 16:11:29 -07:00
Ben Newman
1c041237d9 Fix faulty content-length comparison in utils/http-helpers.js.
Since body is a string, body.length is not necessarily the number of bytes
in the response body.
2017-04-20 16:12:08 -04:00
Ben Newman
8e62f31ef1 Ensure appIdentifier is a legal Cordova package name.
This fixes intermittent failures of the cordova-platforms tests, which
would sometimes fail when one of the app identifier components happened to
start with a number instead of a letter.

The text of the exception was:

  Error validating package name. Package name must look like: com.company.Name

For example:

  https://circleci.com/gh/meteor/meteor/3710#tests/containers/2
2017-04-06 19:16:06 -04:00
Ben Newman
f6df21ff1e Force garbage collection more aggressively during meteor --get-ready.
This is an effort to keep the `meteor --get-ready` command from running
out of memory during Circle CI tests, as mentioned in this comment:
https://github.com/meteor/meteor/pull/8327#issuecomment-284431618
2017-03-06 20:48:53 -05:00
Ben Newman
ab0f9ba290 Force garbage collection more aggressively during meteor --get-ready.
This is an effort to keep the `meteor --get-ready` command from running
out of memory during Circle CI tests, as mentioned in this comment:
https://github.com/meteor/meteor/pull/8327#issuecomment-284431618
2017-03-06 20:34:56 -05:00
Ben Newman
dd012bf6e5 Tolerate " => awaited here:" in parseStackFrames.
da826064bc
2016-11-01 17:25:42 -04:00
Ben Newman
47d3546b3a Fix problems in request callback that broke getUrlWithResuming tests. 2016-10-21 11:25:17 -04:00
Ben Newman
545493b34a Report an error when HTTP request body is incomplete.
When a download aborts prematurely, the status code is often 200 OK, even
though we probably should not proceed with any further processing of the
downloaded information.

This silent failure leads to problems like the dreaded "Error: ENOENT: no
such file or directory, open... os.json" (#7806 and others), which were
hard to diagnose properly because the failure occurred only later, when
extracting a buffer that downloaded incompletely.

The getUrlWithResuming helper should be able to retry after this error is
thrown, which will result in a more helpful warning, even if in the most
common case, i.e. MaxCDN failure, it will never actually succeed.

Note that this change will not help until Meteor 1.4.2 is officially
released and becomes the implementation used to download later releases.

Mitigates #7806.
2016-10-21 11:25:17 -04:00
Ben Newman
bb8e1a3b9f Implement ConcatStream class instead of using concat-stream npm package. 2016-08-01 14:42:22 -04:00
Tom Coleman
7769951ee8 Switched to concat-stream for performance 2016-08-01 17:55:37 +10:00
Ben Newman
e85cef8e1a Make download resumption test faster and more deterministic.
We now use a smaller file (the `babel-compiler` archive instead of
`meteor-tool`), and we interrupt every 500kB, which leads to three total
interruptions for that file. Also, we only delay one second (instead of
five) between attempts.
2016-07-14 17:00:08 -04:00
Ben Newman
91f203999b Make download resumption test always run (and pass).
This is a test that really needs to run and pass every time we run the
test suite, so I decided it shouldn't be --slow. If it takes too long, we
can always download a smaller test file.

Hard-coding the download length was a recipe for brittleness, so now I'm
downloading the file without interruptions in parallel with the
interrupted/resumed download, so that we can compare the two files when
both have finished downloading.

Follow-up to #7399.
2016-07-14 16:05:35 -04:00
Ben Newman
0c43039f60 Avoid fiberHelpers.bindEnvironment by returning Promise from attempt.
Follow-up to #7399.
2016-07-14 11:47:32 -04:00
Ben Newman
fbfb5b84e2 Avoid exposing httpHelpers._currentRequest.
Follow-up to #7399.
2016-07-14 11:47:32 -04:00
Tom Coleman
2cb3462b6d Minor fixes + added a comment 2016-07-14 11:47:32 -04:00
Tom Coleman
4a28c33dd7 Better logging and progress
Using Console.debug to register messages about retries.
2016-07-14 11:47:31 -04:00
Tom Coleman
36011459fa Made the test work in a sensible way 2016-07-14 11:47:31 -04:00
Tom Coleman
cc07c15b6b First pass at request resuming via buffering the range header
This is still a WIP, but I wanted to get feedback at this point.
Will update the PR with outstanding TODOs.
2016-07-14 11:47:30 -04:00
Ben Newman
e90ce88b0e Fix a bug in tools/utils/http-helpers.js. 2016-07-14 11:27:58 -04:00
Ben Newman
df77c39908 Bump default HTTP timeout to 60 seconds, and allow disabling. 2016-06-23 11:49:23 -04:00
Zoltan Olah
8f86d08827 Merge pull request #7143 from mitar/timeouts
Set timeout for HTTP requests
2016-06-22 08:59:38 +10:00
Mitar
3846c6f45c Changed timeout 30 seconds as instructed by our god Math.random(). 2016-06-16 23:12:08 -07:00
Ben Newman
dce2b20ddb Merge pull request #7033 from meteor/release-1.3.3
Release 1.3.3
2016-06-10 18:18:28 -04:00
chemicstry
512799ed9e Initial IPv6 support 2016-06-06 02:17:36 +03:00