in #2901 I reverted Meteor version to 1.5.1 because app rebuilds were taking ~3+ minutes to occur.
In retrospect, there should have been a lot more discussion around that downgrade, at the time I was just trying to remove a blocker that was causing significant delays in app rebuilds after a code change.
To reproduce the issue that 1.5.2 was causing:
marketplace.meteor/release file to 1.5.2METEOR_PROFILE=1 METEOR_LOG=debug meteor run --verbose command instead of using the reaction-cliSpecifically I'm seeing the restart hang with the following messages
> Downloading missing packages
> Preparing to build package cfs:worker
Notable that cfs:worker is not listed in the list of packages that Local package version is up-to-date.
The profiler looks like:
Preparing project -
| ProjectContext prepareProjectForBuild.......................102,015 ms (1)
| โโ _initializeCatalog............................................37 ms (1)
| โ โโ LocalCatalog#initialize....................................33 ms (1)
| โ โ โโ addPatternsToList 9 ms (2)
| โ โ โโ LocalCatalog#_computeEffectiveLocalPackages 1 ms (1)
| โ โ โโ LocalCatalog#_loadLocalPackages.........................23 ms (1)
| โ โ โโ PackageSource#initFromPackageDir.....................20 ms (4)
| โ โ โ โโ optimistic statOrNull..............................3 ms (4)
| โ โ โ โ โโ safeWatcher.watch 3 ms (1)
| โ โ โ โโ runJavaScript package.js 1 ms (4)
| โ โ โ โโ sqlite query 10 ms (3)
| โ โ โ โโ other PackageSource#initFromPackageDir 5 ms
| โ โ โโ other LocalCatalog#_loadLocalPackages 3 ms
| โ โโ other _initializeCatalog 4 ms
| โโ _resolveConstraints...........................................44 ms (1)
| โ โโ Select Package Versions....................................19 ms (1)
| โ โ โโ new CS.Input 18 ms (1)
| โ โ โโ other Select Package Versions 1 ms
| โ โโ other _resolveConstraints 25 ms
| โโ _downloadMissingPackages.....................................214 ms (1)
| โ โโ Isopack.readMetadataFromDirectory..........................25 ms (166)
| โ โ โโ files.stat 3 ms (166)
| โ โ โโ files.readFile 7 ms (166)
| โ โ โโ other Isopack.readMetadataFromDirectory 15 ms
| โ โโ other _downloadMissingPackages 189 ms
| โโ _buildLocalPackages......................................101,718 ms (1)
| โโ IsopackCache Load local isopack............................14 ms (166)
| โ โโ Isopack#getStrongOrderedUsedAndImpliedPackages 10 ms (166)
| โ โโ other IsopackCache Load local isopack 4 ms
| โโ IsopackCache Build local isopack...........................19 ms (3)
| โ โโ watch.isUpToDate.........................................9 ms (3)
| โ โ โโ files.readdir 1 ms (12)
| โ โ โโ other watch.isUpToDate 7 ms
| โ โโ other IsopackCache Build local isopack 9 ms
| โโ other _buildLocalPackages 101,686 ms
|
| Top leaves:
| other _buildLocalPackages..............................101,686 ms (1)
| other _downloadMissingPackages.............................189 ms (1)
|
| (#4) Total: 102,015 ms (ProjectContext prepareProjectForBuild)
the profile for 1.5.1 looks like this
| (#3) Total: 577 ms (ProjectContext prepareProjectForBuild)
So 1.5.2 takes ~ 101.5 seconds longer
Additionally, in the Rebuild App step, it takes extra time for certain steps to happen.
| Top leaves:
| other optimistic statOrNull.............................14,784 ms (340874)
| files.stat...............................................7,212 ms (84962)
| other Resolver#_joinAndStat..............................3,597 ms (68471)
| other plugin ecmascript..................................2,697 ms (2)
| other PackageSourceBatch.computeJsOutputFilesMap.........2,668 ms (2)
| Target#minifyJs..........................................1,151 ms (1)
| other ClientTarget#minifyCss.............................1,140 ms (1)
| Babel.compile............................................1,095 ms (1536)
| other compileUnibuild (the app)..........................1,058 ms (2)
| other JsImage#write......................................1,045 ms (1)
| other Resolver#_resolveNodeModule..........................870 ms (8173)
| other plugin less..........................................510 ms (1)
| safeWatcher.watch..........................................407 ms (7964)
| other Resolver#_resolve....................................356 ms (12322)
| ImportScanner#_getInstallPath..............................313 ms (5275)
| other optimistic readFile..................................304 ms (4130)
| CssTools.parseCss..........................................297 ms (13)
| other optimistic readJsonOrNull............................255 ms (2928)
| sha1.......................................................241 ms (6766)
| wrapped.fs.readFileSync....................................240 ms (336)
| other optimistic hashOrNull................................239 ms (4553)
| other files.withCache......................................222 ms (5)
| files.readFile.............................................174 ms (4177)
| other Target#_runCompilerPlugins...........................169 ms (2)
| CssTools.stringifyCss......................................162 ms (1)
| other Resolver#_resolvePkgJsonMain.........................149 ms (4502)
| files.rm_recursive.........................................148 ms (467)
| other optimistic lstat.....................................136 ms (1683)
| other optimistic lstatOrNull...............................131 ms (835)
| other ClientTarget#write...................................128 ms (1)
|
| (#5) Total: 43,101 ms (Rebuild App)
The 1.5.1 profile looks like this:
| Top leaves:
| other plugin ecmascript..................................4,204 ms (2)
| other ClientTarget#minifyCss.............................1,973 ms (1)
| other PackageSourceBatch.computeJsOutputFilesMap.........1,483 ms (2)
| files.stat...............................................1,355 ms (19117)
| Babel.compile............................................1,190 ms (1536)
| other compileUnibuild (the app)............................990 ms (2)
| other plugin less..........................................525 ms (1)
| other files.withCache......................................492 ms (5)
| Target#minifyJs............................................413 ms (1)
| CssTools.parseCss..........................................355 ms (13)
| other optimistic statOrNull................................323 ms (20360)
| ImportScanner#_getInstallPath..............................320 ms (5275)
| other JsImage#write........................................268 ms (1)
| wrapped.fs.readFileSync....................................251 ms (336)
| sha1.......................................................183 ms (4281)
| other ImportScanner#_readFile..............................172 ms (2489)
| other Target#_runCompilerPlugins...........................165 ms (2)
| other ClientTarget#write...................................164 ms (1)
| CssTools.stringifyCss......................................133 ms (1)
| other PackageSourceBatch#_linkJS...........................111 ms (301)
|
| (#4) Total: 16,354 ms (Rebuild App)
1.5.2 takes 27 seconds longer in this case.
There is an open issue in Meteor that looks like the same issue we're having https://github.com/meteor/meteor/issues/9094
Additionally, https://github.com/meteor/meteor/issues/9125 also seems to be similar to our issue. I suspect they may be the same.
Although I'm not yet sure what introduced this problem between 1.5.1 and 1.5.2, I can confirm that the problem is not present in Meteor 1.6-beta.31.
Can you try updating to Meteor 1.5.2.1-rc.1 to see if the problem is fixed by https://github.com/meteor/meteor/commit/5d212926e795bba714abc9ca2b86429eff2831dd?
meteor update --release 1.5.2.1-rc.1
If you can confirm this fixes the problem, then we should be able to cut a final release soon after.
@benjamn Yep, pulling that release now.
Without any other changes, after updating to this version I get an autoprefixer error during startup
=> Errors prevented startup:
While minifying app stylesheet:
/tools/isobuild/bundler.js:1902:28: Cannot find module "autoprefixer"
at Object.<anonymous> (/tools/isobuild/bundler.js:1902:28)
at Object.profileWrapper (/tools/tool-env/profile.js:283:16)
at packages/minifier-postcss/plugin/minify-css.js:52:37
at Array.forEach (native)
at getPostCSSPlugins (packages/minifier-postcss/plugin/minify-css.js:51:43)
at packages/minifier-postcss/plugin/minify-css.js:155:36
at Array.map (native)
at mergeCss (packages/minifier-postcss/plugin/minify-css.js:139:23)
at CssToolsMinifier.processFilesForBundle (packages/minifier-postcss/plugin/minify-css.js:109:18)
=> Your application has errors. Waiting for file change.
=> Started MongoDB.
This issue appears to be resolved in Meteor 1.5.2.1-rc.1
See the thread in the meteor repo for more detail: https://github.com/meteor/meteor/issues/9094
Also see @benjamn's suggestion in this comment https://github.com/meteor/meteor/issues/9094#issuecomment-331973998 for a workaround to the autoprefixer issue
Resolved by #2948
Most helpful comment
Although I'm not yet sure what introduced this problem between 1.5.1 and 1.5.2, I can confirm that the problem is not present in Meteor 1.6-beta.31.