Skip to content
New issue

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

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

Already on GitHub? # to your account

ILCompiler --make-repro-path option is not working in .net8 #78921

Closed
ivanpovazan opened this issue Nov 28, 2022 · 2 comments · Fixed by #78924
Closed

ILCompiler --make-repro-path option is not working in .net8 #78921

ivanpovazan opened this issue Nov 28, 2022 · 2 comments · Fixed by #78924
Assignees
Milestone

Comments

@ivanpovazan
Copy link
Member

Description

--make-repro-path command line options seems to be broken in NativeAOT compiler (most likely in Crossgen2 as well) on the main branch.

Reproduction Steps

This is a minimal repro scenario which causes the failure:

  1. Create a dummy response file test.rsp in the root folder with:
--reference:./artifacts/bin/coreclr/OSX.arm64.Debug/System.Private.CoreLib.dll
./artifacts/bin/coreclr/OSX.arm64.Debug/System.Private.CoreLib.dll
-o:a.o
--make-repro-path:/Users/ivan/tmp
  1. Build NativeAOT with:
    ./build.sh clr+clr.aot
  2. Invoke the NativeAOT compiler with:
    ./dotnet.sh exec ./artifacts/bin/coreclr/OSX.arm64.Debug/ilc/ilc.dll @test.rsp

NOTE: This response file does not make much sense and will throw somewhere else in the ILCompiler, but is good enough to reproduce the issue and generate the zip when fixed.

Expected behavior

The repro package is created.

Actual behavior

The ilc compiler throws with:

Unhandled exception. System.InvalidCastException: Unable to cast object of type 'System.Collections.Generic.Dictionary`2[System.String,System.String]' to type 'System.String'.
   at System.CommandLine.Helpers.MakeReproPackage(String makeReproPath, String outputFilePath, String[] args, ParseResult res, IEnumerable`1 inputOptions) in /Users/ivan/repos/runtime-coreCLR/src/coreclr/tools/Common/CommandLineHelpers.cs:line 226
   at ILCompiler.ILCompilerRootCommand.<>c__DisplayClass200_0.<.ctor>b__0(InvocationContext context) in /Users/ivan/repos/runtime-coreCLR/src/coreclr/tools/aot/ILCompiler/ILCompilerRootCommand.cs:line 265
   at System.CommandLine.Invocation.AnonymousCommandHandler.Invoke(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationPipeline.<Invoke>g__FullInvocationChain|3_0(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.Invoke(IConsole console)
   at ILCompiler.Program.Main(String[] args) in /Users/ivan/repos/runtime-coreCLR/src/coreclr/tools/aot/ILCompiler/Program.cs:line 658

Regression?

No response

Known Workarounds

No response

Configuration

  • .NET 8 version: current main branch - hash f35444a
  • Platform: osx-arm64
  • OS: Ventura 13.0.1

Other information

No response

@ivanpovazan ivanpovazan added this to the 8.0.0 milestone Nov 28, 2022
@ivanpovazan ivanpovazan self-assigned this Nov 28, 2022
@ghost
Copy link

ghost commented Nov 28, 2022

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

--make-repro-path command line options seems to be broken in NativeAOT compiler (most likely in Crossgen2 as well) on the main branch.

Reproduction Steps

This is a minimal repro scenario which causes the failure:

  1. Create a dummy response file test.rsp in the root folder with:
--reference:./artifacts/bin/coreclr/OSX.arm64.Debug/System.Private.CoreLib.dll
./artifacts/bin/coreclr/OSX.arm64.Debug/System.Private.CoreLib.dll
-o:a.o
--make-repro-path:/Users/ivan/tmp
  1. Build NativeAOT with:
    ./build.sh clr+clr.aot
  2. Invoke the NativeAOT compiler with:
    ./dotnet.sh exec ./artifacts/bin/coreclr/OSX.arm64.Debug/ilc/ilc.dll @test.rsp

NOTE: This response file does not make much sense and will throw somewhere else in the ILCompiler, but is good enough to reproduce the issue and generate the zip when fixed.

Expected behavior

The repro package is created.

Actual behavior

The ilc compiler throws with:

Unhandled exception. System.InvalidCastException: Unable to cast object of type 'System.Collections.Generic.Dictionary`2[System.String,System.String]' to type 'System.String'.
   at System.CommandLine.Helpers.MakeReproPackage(String makeReproPath, String outputFilePath, String[] args, ParseResult res, IEnumerable`1 inputOptions) in /Users/ivan/repos/runtime-coreCLR/src/coreclr/tools/Common/CommandLineHelpers.cs:line 226
   at ILCompiler.ILCompilerRootCommand.<>c__DisplayClass200_0.<.ctor>b__0(InvocationContext context) in /Users/ivan/repos/runtime-coreCLR/src/coreclr/tools/aot/ILCompiler/ILCompilerRootCommand.cs:line 265
   at System.CommandLine.Invocation.AnonymousCommandHandler.Invoke(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationPipeline.<Invoke>g__FullInvocationChain|3_0(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.Invoke(IConsole console)
   at ILCompiler.Program.Main(String[] args) in /Users/ivan/repos/runtime-coreCLR/src/coreclr/tools/aot/ILCompiler/Program.cs:line 658

Regression?

No response

Known Workarounds

No response

Configuration

  • .NET 8 version: current main branch - hash f35444a
  • Platform: osx-arm64
  • OS: Ventura 13.0.1

Other information

No response

Author: ivanpovazan
Assignees: ivanpovazan
Labels:

area-NativeAOT-coreclr

Milestone: 8.0.0

@jkotas
Copy link
Member

jkotas commented Nov 28, 2022

cc @am11 This looks like a regression from System.CommandLine conversion.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Nov 28, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Dec 1, 2022
ivanpovazan added a commit that referenced this issue Dec 1, 2022
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>

Fixes #78921
@ghost ghost locked as resolved and limited conversation to collaborators Dec 31, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants