Skip to content
This repository was archived by the owner on Aug 19, 2019. It is now read-only.
This repository was archived by the owner on Aug 19, 2019. It is now read-only.

msbuild fails on multi-cpu machine when maxcpucount = 0 or > 1 #54

@ghost

Description

Trying to build Sitecore Habitat project (not that it matters, but just for reference)

When I try to run the msbuild gulp task it eventually fails. Gulp is being called by TeamCity via PowerShell runner. It's a simple "gulp".

It builds fine from CLI or Windows PowerShell (interactive) but fails when run in TeamCity.

I had found this issue before so I created a new gulpfile with maxcpucount = 1 and the build works fine then. As soon as the computer has multiple CPUs and maxcpucount =0 then it fails.

gulp task:
`
gulp.task("Build-Solution", function () {
var targets = ["Build"];
if (config.runCleanBuilds) {
targets = ["Clean", "Build"];
}
var solution = "./" + config.solutionName + ".sln";
return gulp.src(solution)

  .pipe(msbuild({
      targets: targets,
      configuration: config.buildConfiguration,
      logCommand: false,
      verbosity: "minimal",
      stdout: true,
      errorOnFail: true,
      maxcpucount: 0,
	  nodeReuse: false,
      toolsVersion: 14.0,
      properties: {
        Platform: config.buildPlatform
      }
    }));

});`

error:

[07:02:27][Step 11/19] Sitecore.Feature.News.Tests -> E:\BuildAgent\work\de74fbbbff5d6869\p\h\src\feature\News\tests\bin\Debug\Sitecore.Feature.News.Tests.dll [07:02:28][Step 11/19] [07:02:28] MSBuild failed with code 1! [07:02:28][Step 11/19] [07:02:28] 'Build-Solution' errored after 1.08 min [07:02:28][Step 11/19] [07:02:28] Error: MSBuild failed with code 1! [07:02:28][Step 11/19] at ChildProcess.<anonymous> (E:\BuildAgent\work\de74fbbbff5d6869\p\h\node_modules\gulp-msbuild\lib\msbuild-runner.js:53:25) [07:02:28][Step 11/19] at emitTwo (events.js:106:13) [07:02:28][Step 11/19] at ChildProcess.emit (events.js:191:7) [07:02:28][Step 11/19] at maybeClose (internal/child_process.js:886:16) [07:02:28][Step 11/19] at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) [07:02:28][Step 11/19] [07:02:28] 'default' errored after 1.18 min [07:02:28][Step 11/19] [07:02:28] Error in plugin 'run-sequence(Build-Solution)' [07:02:28][Step 11/19] Message: [07:02:28][Step 11/19] MSBuild failed with code 1! [07:02:28][Step 11/19] Stack: [07:02:28][Step 11/19] Error: MSBuild failed with code 1! [07:02:28][Step 11/19] at ChildProcess.<anonymous> (E:\BuildAgent\work\de74fbbbff5d6869\p\h\node_modules\gulp-msbuild\lib\msbuild-runner.js:53:25) [07:02:28][Step 11/19] at emitTwo (events.js:106:13) [07:02:28][Step 11/19] at ChildProcess.emit (events.js:191:7) [07:02:28][Step 11/19] at maybeClose (internal/child_process.js:886:16) [07:02:28][Step 11/19] at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) [07:02:28][Step 11/19] [07:02:28] '03-Publish-All-Projects' errored after 1.08 min [07:02:28][Step 11/19] [07:02:28] Error in plugin 'run-sequence(default)' [07:02:28][Step 11/19] Message: [07:02:28][Step 11/19] MSBuild failed with code 1! [07:02:28][Step 11/19] Stack: [07:02:28][Step 11/19] Error: MSBuild failed with code 1! [07:02:28][Step 11/19] at ChildProcess.<anonymous> (E:\BuildAgent\work\de74fbbbff5d6869\p\h\node_modules\gulp-msbuild\lib\msbuild-runner.js:53:25) [07:02:28][Step 11/19] at emitTwo (events.js:106:13) [07:02:28][Step 11/19] at ChildProcess.emit (events.js:191:7) [07:02:28][Step 11/19] at maybeClose (internal/child_process.js:886:16) [07:02:28][Step 11/19] at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) [07:02:28][Step 11/19] [07:02:28] '03-Publish-All-Projects' errored after 1.08 min [07:02:28][Step 11/19] [07:02:28] Error in plugin 'run-sequence(Build-Solution)' [07:02:28][Step 11/19] Message: [07:02:28][Step 11/19] MSBuild failed with code 1! [07:02:28][Step 11/19] Stack: [07:02:28][Step 11/19] Error: MSBuild failed with code 1! [07:02:28][Step 11/19] at ChildProcess.<anonymous> (E:\BuildAgent\work\de74fbbbff5d6869\p\h\node_modules\gulp-msbuild\lib\msbuild-runner.js:53:25) [07:02:28][Step 11/19] at emitTwo (events.js:106:13) [07:02:28][Step 11/19] at ChildProcess.emit (events.js:191:7) [07:02:28][Step 11/19] at maybeClose (internal/child_process.js:886:16) [07:02:28][Step 11/19] at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) [07:02:28][Step 11/19] Process exited with code 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions