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

[0.63] 3 Hacks to fix breaking changes from nuget affecting 0.63 pipelines #7918

Merged
merged 2 commits into from Jun 2, 2021

Conversation

dannyvv
Copy link
Member

@dannyvv dannyvv commented Jun 1, 2021

Nuget had another back compat break...

In the 0.63 branch nuget is silently failing with:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\bin\msbuild.exe "C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\hbhubo3q.rjp.nugetinputs.targets" /t:GenerateRestoreGraphFile /nologo /nr:false /v:q /p:NuGetRestoreTargets="C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\rmw1tloe.pur.nugetrestore.targets" /p:RestoreUseCustomAfterTargets="True" /p:RestoreTaskAssemblyFile="C:\hostedtoolcache\windows\NuGet\5.9.1\x64\nuget.exe" /p:RestoreSolutionDirectory="D:\a\1\s\packages\microsoft-reactnative-sampleapps\windows\\" /p:RestoreConfigFile="D:\a\1\Nuget\tempNuGet_173644.config" /p:SolutionDir="D:\a\1\s\packages\microsoft-reactnative-sampleapps\windows\\" /p:SolutionName="SampleApps" 
NuGet.CommandLine.ExitCodeException: Exception of type 'NuGet.CommandLine.ExitCodeException' was thrown. 
at NuGet.CommandLine.MsBuildUtility.<GetProjectReferencesAsync>d__6.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at NuGet.CommandLine.RestoreCommand.<GetDependencyGraphSpecAsync>d__68.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at NuGet.CommandLine.RestoreCommand.<DetermineInputsFromMSBuildAsync>d__63.MoveNext() 

with:

WARNING: Error reading msbuild project information, ensure that your input solution or project file is valid. NETCore and UAP projects will be skipped, only packages.config files will be restored.

Issue NuGet/Home#9411 suggests this workaround

Microsoft Reviewers: Open in CodeFlow

@dannyvv dannyvv requested a review from JunielKatarn June 1, 2021 23:49
@dannyvv dannyvv requested a review from a team as a code owner June 1, 2021 23:49
Copy link
Contributor

@JunielKatarn JunielKatarn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please request backport ASAP :D

@dannyvv dannyvv changed the title Attempt to fix nuget issue in PR [0.63] Attempt to fix nuget issue in PR Jun 1, 2021
@JunielKatarn
Copy link
Contributor

FYI @vmoroz.

@asklar
Copy link
Member

asklar commented Jun 2, 2021

I see another failure in addition to the nuget.exe one:

Microsoft.Build.Exceptions.InternalLoggerException: The build stopped unexpectedly because of an unexpected logger failure. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at MSBuild.Logger.BuildConfiguration.Equals(Object obj)
   at System.Collections.Generic.ObjectEqualityComparer`1.Equals(T x, T y)
   at System.Collections.Generic.List`1.Contains(T item)
   at MSBuild.Logger.ProjectTrees.AddTopLevelProject(ProjectStartedEventArgs startedEvent, BuildConfiguration platformConfiguration)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseProjectStartedEvent(Object sender, ProjectStartedEventArgs buildEvent)
   --- End of inner exception stack trace ---
   at Microsoft.Build.Exceptions.InternalLoggerException.Throw(Exception innerException, BuildEventArgs e, String messageResourceName, Boolean initializationException, String[] messageArgs)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseProjectStartedEvent(Object sender, ProjectStartedEventArgs buildEvent)
   at MSBuild.Logger.ForwardingLogger.ForwardEvent(Object sender, BuildEventArgs e)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseProjectStartedEvent(Object sender, ProjectStartedEventArgs buildEvent)
##[error]Process 'msbuild.exe' exited with code '1'.

This looks like a failure @rainersigwald had investigated - Rainer, is there a central issue tracking this?

@asklar
Copy link
Member

asklar commented Jun 2, 2021

CC @AgneLukoseviciute

@rainersigwald
Copy link
Member

rainersigwald commented Jun 2, 2021

There are two: dotnet/msbuild#6498 for MSBuild moving the AzDO logger's cheese, and microsoft/azure-pipelines-tasks#14904 for the logger being so sensitive. The former is more likely to be fixed soon (we'll need to collect enough evidence that it's causing enough pain to be worth servicing, which you're helping with, so thanks for reporting).

edit: also note two workarounds in the former issue; please try MSBUILDLOGPROPERTIESANDITEMSAFTEREVALUATION=false and let us know if it works.

@dannyvv dannyvv changed the title [0.63] Attempt to fix nuget issue in PR [0.63] Attempt to fix breaking nuget changes in PR pipeline Jun 2, 2021
@dannyvv dannyvv requested a review from jonthysell June 2, 2021 04:10
@dannyvv
Copy link
Member Author

dannyvv commented Jun 2, 2021

@jonthysell : I had to change autolink.props as somehow during the /restore build SolutionDir is set to *Undefined* literally with the stars :))

@dannyvv dannyvv changed the title [0.63] Attempt to fix breaking nuget changes in PR pipeline [0.63] 3 Hacks to fix breaking changes from nuget breaking our build pipeline Jun 2, 2021
@dannyvv dannyvv changed the title [0.63] 3 Hacks to fix breaking changes from nuget breaking our build pipeline [0.63] 3 Hacks to fix breaking changes from nuget affecting 0.63 pipelines Jun 2, 2021
@asklar asklar merged commit bc22bbc into microsoft:0.63-stable Jun 2, 2021
@rainersigwald
Copy link
Member

somehow during the /restore build SolutionDir is set to *Undefined*

This is the default if it's not already set, and has been for a very long time. Maybe one of the NuGet packages you reference nulls it out, so the difference is that the restore process doesn't include NuGet package logic?

https://github.com/dotnet/msbuild/blob/46b723ba9ee9f4297d0c8ccbb6dc52e4bd8ea438/src/Tasks/Microsoft.Common.CurrentVersion.targets#L340-L358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants