Fixes#1761.
Package code pulled from a git repo does not contain the directory
`/node_modules`, as these modules are downloaded during the build
process. However, this can confuse NPM prior to build completion.
If the package directory doesn’t have a '/node_modules' subdirectory,
NPM will assume we are not at the package root and will search the
directory's parents for one. It will then set the root to any ancestor
that does have a '/node_modules' subdir. This can cause the build to
fail for downloaded user packages and also Meteor itself if run from
checkout.
See also #927.
A package may depend on some files in its dependencies being executable,
so builder ought to respect the modes of source files when copying into
a bundle.
this allows its messages to show up on the proxy, eg.
There's now a mix of runLog and buildmessage in this file, for two
reasons.
First, buildmessage's model is "build up a set of messages and then
display them all at once"; there's no streaming output, which is not
appropriate for the logUpdateDependencies call (which is mostly intended
to explain to users why their build is taking time).
Secondly, buildmessage doesn't yet have a great way of formatting big
blocks of text like "all the stderr from a failed npm invocation". If it
had such a feature, that would replace most of the uses of runLog in
this file.
The rationale: RunLog is an object that is hardcoded around managing two
other singletons: stdout and stderr. Having multiple RunLogs wouldn't
work well without improving RunLog to have the ability to control other
streams.
We'd like to be able to use RunLog from other places in the tool, most
notably from code called from bundler (while running an app) such as the
npm updater. But threading a RunLog object through that code is
difficult (especially as bundling takes a detour through
release.current.library).
Generally reorganize some silent/quiet/background flags to be more
explicit about what is being show/hidden.
The main point here is that the 'background updater' wants to show
banners but ignore errors, whereas --get-ready wants to show errors but
not banners.