dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
34.51k stars 9.75k forks source link

Build failure on github.com/dotnet/dotnet codespace #55499

Open Jozkee opened 2 weeks ago

Jozkee commented 2 weeks ago

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

wtgodbe commented 1 week ago

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 commented 1 week ago

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

Jozkee commented 1 week ago

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.

wtgodbe commented 4 days ago

@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