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

RunReadyToRunCompiler task doesn't produce actionable information on failures #15466

Closed
trylek opened this issue Jan 22, 2021 · 4 comments
Closed

Comments

@trylek
Copy link
Member

trylek commented Jan 22, 2021

While switching over framework compilation to use Crossgen2 I noticed that the RunReadyToRunCompiler task in

public class RunReadyToRunCompiler : ToolTask

isn't too developer friendly when hitting errors. In most cases the only diagnostic output is the error message "Invalid parameters were passed to RunReadyToRunCompiler task" no matter whether the problem is missing JitPath, DOTNET_ROOT not pointing at the .dotnet folder and preventing execution of the crossgen2 managed executable or anything else.

Even locally it's super complicated to identify what went wrong; on top of that the absence of any diagnostic output makes it very hard to identify whether crossgen or crossgen2 compilation has taken place from AzDO lab jobs. The purpose of this issue is to improve this situation. Here are some suggestions that come to mind:

  1. ValidateParameters should spew diagnostic output stating clearly which parameter it doesn't like and for what reason.

  2. Similar to CoreCLR Crossgen2 test build, we should display command lines representing the individual Crossgen2 executions when compiling the framework and error information upon failure. I haven't managed to receive any logging information about Crossgen2 executions even after I bumped up msbuild verbosity to diagnostic.

/cc: @dotnet/crossgen-contrib
/cc: @jkoritzinsky, @AntonLapounov

@trylek trylek added this to the 6.0.1xx milestone Jan 22, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jan 22, 2021
@AntonLapounov
Copy link
Member

I agree on that. It was too late to fix it for 5.0 release when I hit this issue.

@AntonLapounov
Copy link
Member

The first suggestion was implemented in #15529. Still need to implement the second one.

@AntonLapounov
Copy link
Member

@trylek I just tried SDK publishing with normal verbosity:

dotnet new console
dotnet publish --packages pkg -p:PublishReadyToRun=True -p:PublishReadyToRunUseCrossgen2=True -c Release -r win-x64 -v:n

and that does output the Crossgen2 command line. For .NET 5:

       _CreateR2RImages:
         C:\HelloWorld\pkg\microsoft.netcore.app.crossgen2.win-x64\5.0.1\tools\crossgen2.exe -O
         --jitpath:"C:\HelloWorld\pkg\microsoft.netcore.app.crossgen2.win-x64\5.0.1\tools\clrjit-win-x64.dll"
         --composite
         --inputbubble
         ...

For .NET 6:

       _CreateR2RImages:
         C:\HelloWorld\pkg\microsoft.netcore.app.crossgen2.win-x64\6.0.0-preview.5.21218.1\tools\crossgen2.exe --targetos:windows
         --targetarch:x64
         -O
         ...

Maybe the issue is not in the SDK?

@AntonLapounov
Copy link
Member

Closing this as fixed on the SDK side.

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

No branches or pull requests

3 participants