Repository navigation
NegotiateAuthentication larger code size and also brings in BigInteger #90898
Description
Activity
- ghost addedneeds-area-labelAn area label is needed to ensure this gets routed to the appropriate area ownersAn area label is needed to ensure this gets routed to the appropriate area owners
on Aug 21, 2023 - ghost addeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Aug 21, 2023 - added and removedneeds-area-labelAn area label is needed to ensure this gets routed to the appropriate area ownersAn area label is needed to ensure this gets routed to the appropriate area owners
on Aug 21, 2023 what platforms is this on @NinoFloris? I think we do want to keep the managed implementation in. We can perhaps try to make it more trimming friendly.
These builds were done on ubuntu
It should be trimmed out on Linux for NativeAOT unless the
UseManagedNtlmoption is turned on. I'll have a look.Can you try adding this to the test app .csproj?
<ItemGroup> <RuntimeHostConfigurationOption Include="System.Net.Security.UseManagedNtlm" Value="false" Trim="true" /> </ItemGroup>
Generally the idea is that the ILLink substitution (https://github.com/dotnet/runtime/blob/main/src/libraries/System.Net.Security/src/ILLink/ILLink.Substitutions.xml) will turn
System.Net.NegotiateAuthenticationPal.UseManagedNtlmintofalseand trim away the rest of the code. There are two possible failures that I can think of: 1) the substitution not taking place when the feature option is not specified at all, and 2) the resulting branch trimming not happening.UPD: Apparently this doesn't help. :-/
UPD2: It does actually work, I just forgot to addTrim="true".I reread the ILLink documentation and it seems we are missing
featuredefault="true"attribute there. On .NET 9 we would need to conditionally use different substitution for macOS/iOS though.Does that mean it should be fixed for rc2 or where do we stand? Npgsql is a library, I can't ask people to flip these switches for us.
I will try to submit the fix and then we can see about backports.
Reacted by Nino FlorisI was not able to get
featuredefaultto do the right thing on NativeAOT yet. I'm trying to figure out whether it is supposed to work, or not. The alternative is to specify the option throughRuntimeHostConfigurationOptionin the NativeAOT build integration. I'll post once I have more details to share.- ghost addedin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
on Aug 22, 2023 - ghost removeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Aug 29, 2023 Triage: @wfurt discussed it with @jkotas and his suggestion was to NOT take it for 8.0 as it is size improvement, but not functional impact.
@NinoFloris are you ok with that for npgsql customers? (cc @roji)I generally agree it doesn't meet the bar for 8.0 servicing, but should we try to backport the SDK switch (dotnet/sdk#34903) to make the workaround easier?
- ghost removedin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
on Aug 29, 2023 Thanks, @karelz we are. We have added an explicit opt-in to our slim builder for "integrated security" auth, sidestepping the issue.
Reacted by Shay RojanskyReacted by Karel Zikmund and Tomas Weinfurt- addedsize-reductionIssues impacting final app size primary for size sensitive workloadsIssues impacting final app size primary for size sensitive workloads
on Aug 29, 2023 Yeah, agreed this isn't critical for a 8.0 backport.
- ghost locked as resolved and limited conversation to collaborators
on Sep 29, 2023
Afaik the following PR #87930 is part of .NET 8.0 preview 7, it caused a 60kb size regression for us:
preview 6: https://github.com/npgsql/npgsql/actions/runs/5930686472
preview 7: https://github.com/npgsql/npgsql/actions/runs/5931742857
Mostly due to it bringing in BigInteger (and a managed NegotiateAuthentication impl?)
Not sure what we can or want to do here.
/cc @filipnavara