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

ILCompiler.Diagnostics build error in 8.0 Preview 5 #3483

Closed
mthalman opened this issue May 30, 2023 · 8 comments
Closed

ILCompiler.Diagnostics build error in 8.0 Preview 5 #3483

mthalman opened this issue May 30, 2023 · 8 comments

Comments

@mthalman
Copy link
Member

 /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler.Diagnostics/Microsoft.Interop.ComInterfaceGenerator/Microsoft.Interop.ComInterfaceGenerator/Microsoft.DiaSymReader.ISymNGenWriter2.cs(143,67): error CS0246: The type or namespace name 'MarshalAsAttribute' could not be found (are you missing a using directive or an assembly reference?) [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj]
    /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler.Diagnostics/Microsoft.Interop.ComInterfaceGenerator/Microsoft.Interop.ComInterfaceGenerator/Microsoft.DiaSymReader.ISymNGenWriter2.cs(143,67): error CS0246: The type or namespace name 'MarshalAs' could not be found (are you missing a using directive or an assembly reference?) [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj]
    /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler.Diagnostics/Microsoft.Interop.ComInterfaceGenerator/Microsoft.Interop.ComInterfaceGenerator/Microsoft.DiaSymReader.ISymNGenWriter2.cs(143,77): error CS0103: The name 'UnmanagedType' does not exist in the current context [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj]
    /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler.Diagnostics/Microsoft.Interop.ComInterfaceGenerator/Microsoft.Interop.ComInterfaceGenerator/Microsoft.DiaSymReader.ISymNGenWriter2.cs(145,84): error CS0246: The type or namespace name 'OMF' could not be found (are you missing a using directive or an assembly reference?) [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj]
    /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler.Diagnostics/Microsoft.Interop.ComInterfaceGenerator/Microsoft.Interop.ComInterfaceGenerator/Microsoft.DiaSymReader.ISymNGenWriter2.cs(145,56): error CS0539: 'InterfaceImplementation.AddSection(ushort, OMF, int, int)' in explicit interface declaration is not found among members of the interface that can be implemented [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj]
    /vmr/.dotnet/sdk/8.0.100-preview.5.23276.1/Microsoft.Common.CurrentVersion.targets(2086,5): error MSB4181: The "MSBuild" task returned false but did not log an error. [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj]

cc @jtschuster, @jkoritzinsky

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@mthalman
Copy link
Member Author

@mthalman
Copy link
Member Author

I believe this is related to dotnet/runtime#84643

@mthalman
Copy link
Member Author

It looks like the changes from dotnet/runtime#84643 are incomplete because they did not update the implementation of https://github.com/dotnet/runtime/tree/main/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator to reflect the new behavior. So the generated code is still using MarshalAs but that is incompatible with the newly built SDK of Preview 5. It is not at all obvious what the new implementation should be. We need input from @jtschuster, @jkoritzinsky on the action to take. Note that this is blocking the release of Preview 5.

jtschuster added a commit to dotnet/runtime that referenced this issue May 30, 2023
…r attributes

The issue dotnet/source-build#3483 looks similar to the issues I found before fixing in #86731. The relevant changes were in ComMethodContext.cs. If it's the same issue I was hitting, the attribute syntax was being copied over without adding 'using' statements or changing the attribute name to be fully qualified. I haven't validated yet, but this should fix it by just not copying the attributes for the parameters since they're not strictly necessary.
@jtschuster
Copy link
Member

jtschuster commented May 30, 2023

This looks similar to issues that this line fixed: https://github.com/dotnet/runtime/pull/86467/files#diff-de24791fc434cac361f77d2a59862f00eb432728609a7ec320bda264e1ddbbcdR112. I've made a PR to backport it (dotnet/runtime#86899), but haven't validated it yet.

@mthalman
Copy link
Member Author

Thanks. I'm running a test build of the VMR with that change.

@mthalman
Copy link
Member Author

Confirmed that the change in dotnet/runtime#86899 passes the VMR build.

carlossanlop pushed a commit to dotnet/runtime that referenced this issue May 30, 2023
…and don't copy parameter attributes (#86899)

* Use fully qualified type names for parameters and don't copy parameter attributes

The issue dotnet/source-build#3483 looks similar to the issues I found before fixing in #86731. The relevant changes were in ComMethodContext.cs. If it's the same issue I was hitting, the attribute syntax was being copied over without adding 'using' statements or changing the attribute name to be fully qualified. I haven't validated yet, but this should fix it by just not copying the attributes for the parameters since they're not strictly necessary.

* Add test for change
@mthalman
Copy link
Member Author

Fixed by dotnet/runtime#86899

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

Successfully merging a pull request may close this issue.

2 participants