Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet restore fails when building repo #101720

Closed
PaulusParssinen opened this issue Apr 30, 2024 · 8 comments
Closed

dotnet restore fails when building repo #101720

PaulusParssinen opened this issue Apr 30, 2024 · 8 comments

Comments

@PaulusParssinen
Copy link
Contributor

PaulusParssinen commented Apr 30, 2024

While trying to build runtime with clr+clr.aot+libs on my Windows machine.

Does this repro for anyone? This feels like on those weird build errors that just disappears some day..

edit: It doesn't matter what configuration I pass in, the restore will fail.

$ git clean -xdf
Removing artifacts/

$ git rev-parse HEAD
d10a14537cc684a942de0387f3b6942f3d8d0a80

$ ./build.cmd clr+clr.aot+libs -rc Release
  Determining projects to restore...
  Tool 'coverlet.console' (version '6.0.0') was restored. Available commands: coverlet
  Tool 'dotnet-reportgenerator-globaltool' (version '5.0.2') was restored. Available commands: reportgenerator
  Tool 'microsoft.dotnet.xharness.cli' (version '9.0.0-prerelease.24224.1') was restored. Available commands: xharness
  Tool 'microsoft.visualstudio.slngen.tool' (version '11.1.0') was restored. Available commands: slngen
  
  Restore was successful.
  All projects are up-to-date for restore.
  Determining projects to restore...
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error : Invalid restore input. Duplicate frameworks found: 'net8.0, net8.0, net8.0'. Input files: C:\src\runtime-pp\src\libraries\Microsoft.Bcl.AsyncInterfaces\ref\Microsoft.Bcl.AsyncInterfaces.csproj. [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.SpecValidationUtility.ValidateFrameworks(PackageSpec spec, IEnumerable`1 files) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.SpecValidationUtility.ValidateProjectSpecPackageReference(PackageSpec spec, IEnumerable`1 files) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.SpecValidationUtility.ValidateProjectSpec(PackageSpec spec) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.SpecValidationUtility.ValidateDependencySpec(DependencyGraphSpec spec, HashSet`1 projectsToSkip) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.DependencyGraphSpecRequestProvider.GetRequestsFromItems(RestoreArgs restoreContext, DependencyGraphSpec dgFile) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.DependencyGraphSpecRequestProvider.CreateRequests(RestoreArgs restoreContext) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.RestoreRunner.CreatePreLoadedRequests(RestoreArgs restoreContext) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.RestoreRunner.GetRequests(RestoreArgs restoreContext) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.RestoreRunner.RunAsync(RestoreArgs restoreContext, CancellationToken token) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Build.Tasks.BuildTasksUtility.RestoreAsync(DependencyGraphSpec dependencyGraphSpec, Boolean interactive, Boolean recursive, Boolean noCache, Boolean ignoreFailedSources, Boolean disableParallel, Boolean force, Boolean forceEvaluate, Boolean hideWarningsAndErrors, Boolean restorePC, Boolean cleanupAssetsForUnsupportedProjects, ILogger log, CancellationToken cancellationToken) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Build.Tasks.Console.MSBuildStaticGraphRestore.RestoreAsync(String entryProjectFilePath, IDictionary`2 globalProperties, IReadOnlyDictionary`2 options) [C:\src\runtime-pp\Build.proj]

Build FAILED.

C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error : Invalid restore input. Duplicate frameworks found: 'net8.0, net8.0, net8.0'. Input files: C:\src\runtime-pp\src\libraries\Microsoft.Bcl.AsyncInterfaces\ref\Microsoft.Bcl.AsyncInterfaces.csproj. [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.SpecValidationUtility.ValidateFrameworks(PackageSpec spec, IEnumerable`1 files) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.SpecValidationUtility.ValidateProjectSpecPackageReference(PackageSpec spec, IEnumerable`1 files) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.SpecValidationUtility.ValidateProjectSpec(PackageSpec spec) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.SpecValidationUtility.ValidateDependencySpec(DependencyGraphSpec spec, HashSet`1 projectsToSkip) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.DependencyGraphSpecRequestProvider.GetRequestsFromItems(RestoreArgs restoreContext, DependencyGraphSpec dgFile) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.DependencyGraphSpecRequestProvider.CreateRequests(RestoreArgs restoreContext) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.RestoreRunner.CreatePreLoadedRequests(RestoreArgs restoreContext) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.RestoreRunner.GetRequests(RestoreArgs restoreContext) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.RestoreRunner.RunAsync(RestoreArgs restoreContext, CancellationToken token) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Build.Tasks.BuildTasksUtility.RestoreAsync(DependencyGraphSpec dependencyGraphSpec, Boolean interactive, Boolean recursive, Boolean noCache, Boolean ignoreFailedSources, Boolean disableParallel, Boolean force, Boolean forceEvaluate, Boolean hideWarningsAndErrors, Boolean restorePC, Boolean cleanupAssetsForUnsupportedProjects, ILogger log, CancellationToken cancellationToken) [C:\src\runtime-pp\Build.proj]
C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Build.Tasks.Console.MSBuildStaticGraphRestore.RestoreAsync(String entryProjectFilePath, IDictionary`2 globalProperties, IReadOnlyDictionary`2 options) [C:\src\runtime-pp\Build.proj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:06.23
Build failed with exit code 1. Check errors above.
Some builds failed:
	Configuration: Debug, Architecture: x64
dotnet --info
$ dotnet --info
.NET SDK:
 Version:           9.0.100-preview.3.24204.13
 Commit:            81f61d8290
 Workload version:  9.0.100-manifests.77bb7ba9
 MSBuild version:   17.11.0-preview-24178-16+7ca3c98fa

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.100-preview.3.24204.13\

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      9.0.0-preview.3.24172.9
  Architecture: x64
  Commit:       9e6ba1f68c

.NET SDKs installed:
  8.0.204 [C:\Program Files\dotnet\sdk]
  8.0.300-preview.24203.14 [C:\Program Files\dotnet\sdk]
  9.0.100-preview.3.24204.13 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0-preview.3.24172.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0-preview.3.24172.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.0-preview.3.24175.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  C:\src\runtime-pp\global.json

I tried dotnet nuget locals all --clear but it had no effect.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 30, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Apr 30, 2024
@vcsjones
Copy link
Member

Does this repro for anyone?

It does not repro for me on 8283049.

the restore will fail.

Any chance you have a stray .NET process (dotnet.exe) process running? If you taskkill /F /IM dotnet.exe and clean, then does it build?

@PaulusParssinen
Copy link
Contributor Author

PaulusParssinen commented Apr 30, 2024

Any chance you have a stray .NET process (dotnet.exe) process running? If you taskkill /F /IM dotnet.exe and clean, then does it build?

No stray dotnet.exes, I fear 😕

Here's binlog but I'm lost personally.. I have once tried to re-install dotnet & VS22 Preview & reboots but it's hard to know what could be messing with this. I wish there was "nuke from orbit" option to dotnet clean removal & reinstall 😄

msbuild.binlog.zip

edit: Seems similar to #32205 (and maybe NuGet/Home#5154)

@PaulusParssinen
Copy link
Contributor Author

Seems like I'll have to use Helix as my AOT testing setup for now then 😢

@vcsjones vcsjones added area-Infrastructure and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Apr 30, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

@ViktorHofer
Copy link
Member

Unfortunately, I have absolutely no idea how this can happen. CI is running just fine so this must be related to your machine configuration somehow.

@akoeplinger
Copy link
Member

@PaulusParssinen the binlog shows that you have an environment variable TargetFramework which is set to net8.0, I assume this confuses the build:
image

You also probably don't want to set DOTNET_GCStress or MSBUILDUSESERVER

@PaulusParssinen
Copy link
Contributor Author

@PaulusParssinen the binlog shows that you have an environment variable TargetFramework which is set to net8.0, I assume this confuses the build: image

You also probably don't want to set DOTNET_GCStress or MSBUILDUSESERVER

The TargetFramework environment variable was it.. Thank you so much! My eyes just skimmed over it every time as I hadn't put that there myself and I have no idea where that came from.. 😅

GCStress is left-over and disabled already 0. MSBUILDUSESERVER=0 is not in my system environment variables so I'd expect it to be from the build script(?).

I'm closing this, thanks one more time!

@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label May 6, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants