aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Build failure on github.com/dotnet/dotnet codespace

Open jozkee opened this issue 1 year ago • 3 comments

using Default devcontainer https://github.com/dotnet/dotnet/blob/main/.devcontainer/devcontainer.json and executing ./build.sh, I consistently hit the following error once build starts for aspnetcore.

Intermediate Output Path: /workspaces/dotnet/src/aspnetcore/artifacts/obj/Npm.Workspace/Release/
node:fs:582
  return binding.open(
                 ^

EXEC : error : /workspaces/dotnet/src/aspnetcore/artifacts/obj/Npm.Workspace/Release/packagesToPack.json: ENOENT: no such file or directory, open '/workspaces/dotnet/src/aspnetcore/artifacts/obj/Npm.Workspace/Release/packagesToPack.json' [/workspaces/dotnet/src/aspnetcore/eng/Npm.Workspace.nodeproj]
    at Object.openSync (node:fs:582:18)
    at Object.readFileSync (node:fs:461:35)
    at readFileSync (/workspaces/dotnet/src/aspnetcore/node_modules/jsonfile/index.js:50:22)
    at file:///workspaces/dotnet/src/aspnetcore/eng/scripts/npm/pack-workspace.mjs:54:26
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/workspaces/dotnet/src/aspnetcore/artifacts/obj/Npm.Workspace/Release/packagesToPack.json'
}

Node.js v20.12.2
/workspaces/dotnet/src/aspnetcore/eng/Npm.Workspace.nodeproj(68,5): error MSB3073: The command "node /workspaces/dotnet/src/aspnetcore/eng/scripts/npm/pack-workspace.mjs --create-packages /workspaces/dotnet/src/aspnetcore/package.json 9.0.0dev.24225.4 /workspaces/dotnet/src/aspnetcore/artifacts/packages/Release/Shipping/ /workspaces/dotnet/src/aspnetcore/artifacts/obj/Npm.Workspace/Release/" exited with code 1.

Build FAILED.

EXEC : error : /workspaces/dotnet/src/aspnetcore/artifacts/obj/Npm.Workspace/Release/packagesToPack.json: ENOENT: no such file or directory, open '/workspaces/dotnet/src/aspnetcore/artifacts/obj/Npm.Workspace/Release/packagesToPack.json' [/workspaces/dotnet/src/aspnetcore/eng/Npm.Workspace.nodeproj]
/workspaces/dotnet/src/aspnetcore/eng/Npm.Workspace.nodeproj(68,5): error MSB3073: The command "node /workspaces/dotnet/src/aspnetcore/eng/scripts/npm/pack-workspace.mjs --create-packages /workspaces/dotnet/src/aspnetcore/package.json 9.0.0dev.24225.4 /workspaces/dotnet/src/aspnetcore/artifacts/packages/Release/Shipping/ /workspaces/dotnet/src/aspnetcore/artifacts/obj/Npm.Workspace/Release/" exited with code 1.
  0 Warning(s)
  2 Error(s)

cc @ViktorHofer @wtgodbe @mthalman @MichaelSimons @javiercn

jozkee avatar May 02 '24 21:05 jozkee

Could you attach more logs from the failure? We've seen failures in our node projects on CodeSpaces before, which were fixed by increasing the number of cores used in the default devcontainer: https://github.com/dotnet/aspnetcore/issues/55272, https://github.com/dotnet/aspnetcore/pull/55479

CC @javiercn @captainsafia

wtgodbe avatar May 07 '24 18:05 wtgodbe

Or, I wonder if this is due to dotnet/dotnet not initializing the node-externals submodule?

wtgodbe avatar May 07 '24 18:05 wtgodbe

Logs from /workspaces/dotnet/artifacts/log/Release: vstest.log xdt.log arcade.log aspire.log aspnetcore.log cecil.log command-line-api.log deployment-tools.log diagnostics.log efcore.log emsdk.log fsharp.log msbuild.log nuget-client.log razor.log roslyn.log roslyn-analyzers.log runtime.log scenario-tests.log sourcelink.log symreader.log templating.log test-templates.log

fixed by increasing the number of cores used in the default devcontainer

The devcontainer loaded with 16-core • 64GB RAM • 128GB.

jozkee avatar May 08 '24 17:05 jozkee

@Jozkee since the VMR work has been de-prioritized, we probably won't be able to investigate this for a while. In the meantime the one thing I'd suggest is turning off the npm build in the VMR context by passing --no-build-nodejs to aspnetcore's build.sh

wtgodbe avatar May 14 '24 18:05 wtgodbe