You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
crossgen2 fails on assemblies that include embedded types #67855
The .NET 6 runtime supports type equivalence which comes from embedding types (EmbedInteropTypes=true on a reference, or using the /link parameter to csc.exe instead of /reference for an embeddable assembly).
Crossgen2 fails to compile assemblies that contain embedded types (one that was compiled with /link).
Reproduction Steps
The minimal embeddable type in the assembly doesn't seem to repro the problem. So all I can do is offer the full original repro, ready to run (😉): via OneDrive for Business.
Just extract the .zip and run repro.cmd.
Expected behavior
crossgen completes successfully.
Actual behavior
crossgen2 crashes with this exception:
Error: [embedding-referenced-assembly]embedded-type
System.NotImplementedException: [embedding-referenced-assembly]embedded-type
at ILCompiler.DependencyAnalysis.ReadyToRun.ModuleTokenResolver.GetModuleTokenForType(EcmaType type, Boolean throwIfNotFound)
at ILCompiler.DependencyAnalysis.ReadyToRun.SignatureContext.GetTargetModule(TypeDesc type)
at ILCompiler.DependencyAnalysis.ReadyToRun.TypeFixupSignature.GetData(NodeFactory factory, Boolean relocsOnly)
at ILCompiler.DependencyAnalysis.ReadyToRun.ImportSectionNode.MaterializeSignature(NodeFactory r2rFactory)
at ILCompiler.DependencyAnalysis.ReadyToRun.ImportSectionsTableNode.MaterializeSignature()
at ILCompiler.DependencyAnalysis.ReadyToRun.ManifestMetadataTableNode.ComputeLastSetOfModuleIndices()
at ILCompiler.DependencyAnalysis.ReadyToRun.ManifestMetadataTableNode.GetManifestAssemblyMvidTableData()
at ILCompiler.DependencyAnalysis.ReadyToRun.ManifestAssemblyMvidHeaderNode.GetData(NodeFactory factory, Boolean relocsOnly)
at ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter.EmitPortableExecutable()
at ILCompiler.ReadyToRunCodegenCompilation.Compile(String outputFile)
at ILCompiler.Program.RunSingleCompilation(Dictionary`2 inFilePaths, InstructionSetSupport instructionSetSupport, String compositeRootPath, Dictionary`2 unrootedInputFilePaths, HashSet`1 versionBubbleModulesHash, CompilerTypeSystemContext typeSystemContext)
at ILCompiler.Program.Run(String[] args)
at ILCompiler.Program.Main(String[] args)
Activity
jkoritzinsky commentedon Apr 11, 2022
Related: #64413
davidwrighton commentedon Apr 29, 2022
I've been worried this could happen for some time. I have a WIP branch with some of the support needed, but its pretty old and incomplete.
Type equivalence support in Crossgen2 (#87899)