-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
ILLink: argument exception in Cecil when writing assembly #93797
Comments
Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas Issue DetailsRepro:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishTrimmed>true</PublishTrimmed>
<WarningsAsErrors>false</WarningsAsErrors>
<NoWarn>NU1605;NU1603;NU1701</NoWarn>
</PropertyGroup>
<ItemGroup>
<TrimmerRootAssembly Include="Syncfusion.Maui.Gauges" />
<PackageReference Include="Syncfusion.Maui.Gauges" Version="20.4.40" />
</ItemGroup>
</Project>
Stack trace from the output:
/cc @LakshanF
|
Similar failure on a different package - worth validating on the same fix:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishTrimmed>true</PublishTrimmed>
<WarningsAsErrors>false</WarningsAsErrors>
<NoWarn>NU1605;NU1603;NU1701</NoWarn>
<TargetPackageName>NewPlatform.Flexberry.ORM.ODataService</TargetPackageName>
<TargetPackageVersion>7.0.0</TargetPackageVersion>
<TargetAssemblyName></TargetAssemblyName>
<TargetAssemblyName Condition="'$(TargetAssemblyName)' == ''">$(TargetPackageName)</TargetAssemblyName>
</PropertyGroup>
<ItemGroup>
<TrimmerRootAssembly Include="$(TargetAssemblyName)" />
<PackageReference Include="$(TargetPackageName)" Version="$(TargetPackageVersion)" />
</ItemGroup>
<Target Name="ConfigureTrimming"
BeforeTargets="PrepareForILLink">
<ItemGroup>
<ManagedAssemblyToLink Condition="'%(Filename)' == '$(TargetAssemblyName)'">
<TrimmerSingleWarn>false</TrimmerSingleWarn>
</ManagedAssemblyToLink>
</ItemGroup>
</Target>
</Project> Stack trace:
|
is the bug here that it should not be dumping stack? or that it should not be failing? I was going to open a bug for the former, perhaps this covers it. dumping stack when it's not a bug on us is ugly.
|
Confirmed the first repro provided. Here's what happens:
For comparison, Native AOT fails on the same input with:
|
The fundamental problem is that the input was missing a referenced assembly. This caused some inconsistent marking for generics, leading to downstream failures. I can see two solutions to this:
I opened #103831 for 2, but I don't think we should do that in .NET 9 so I am leaning towards 1 for a .NET 9 fix. |
NativeAOT tries to be resilient against missing assemblies where possible. It is not 100% resilient, but it covers a lot of the common situations. We have actually done work to make native AOT more resilient based on customer reports. There are a lot of assemblies and packages with dangling references in the wild. |
Good to know, thanks for the context. Would the Native AOT error in #93797 (comment) be considered a bug? |
I think so. (It would not be must-fix bug - we would be ok with won't fixing it if the fix is too complicated or invasive.) |
Repro:
dotnet new console
app.csproj
:dotnet publish
Stack trace from the output:
/cc @LakshanF
The text was updated successfully, but these errors were encountered: