From a2f8efa00ed70d3da83be138fa7cb0980e3db2eb Mon Sep 17 00:00:00 2001 From: Oleksandr Chekhovskyi Date: Thu, 2 Apr 2015 11:36:03 +0200 Subject: [PATCH] Enter nested job scope per package architecture when downloading This fixes a crash when two architectures need to be downloaded for the same package. It happens when building for non-host architecture if packages have not been cached yet. Crash happened because progress object got reused for another download request, and progress objects are not supposed to be reused. --- tools/tropohouse.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tools/tropohouse.js b/tools/tropohouse.js index b7ab202eda..e650822213 100644 --- a/tools/tropohouse.js +++ b/tools/tropohouse.js @@ -458,16 +458,20 @@ _.extend(exports.Tropohouse.prototype, { // try to rename over the other thing? but that's the same as in // warehouse? _.each(buildsToDownload, function (build) { - try { - var buildTempDir = self._downloadBuildToTempDir( - { packageName: packageName, version: version }, build); - } catch (e) { - if (!(e instanceof files.OfflineError)) - throw e; - buildmessage.error(e.error.message); - } - buildInputDirs.push(buildTempDir); - buildTempDirs.push(buildTempDir); + buildmessage.enterJob({ + title: "downloading " + packageName + "@" + version + " for " + build.buildArchitectures + "..." + }, function() { + try { + var buildTempDir = self._downloadBuildToTempDir( + { packageName: packageName, version: version }, build); + } catch (e) { + if (!(e instanceof files.OfflineError)) + throw e; + buildmessage.error(e.error.message); + } + buildInputDirs.push(buildTempDir); + buildTempDirs.push(buildTempDir); + }); }); if (buildmessage.jobHasMessages()) return;