-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Make System.Transactions.Local trimmable on Windows #75176
Conversation
...raries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcProxyShimFactory.cs
Outdated
Show resolved
Hide resolved
...raries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcProxyShimFactory.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK from my side on any strategy picked here.
...raries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcProxyShimFactory.cs
Outdated
Show resolved
Hide resolved
Add the necessary DynamicDependency attributes to System.Transaction.Local in order for it to work with trimming on Windows. Also fix the UnconditionalSuppressMessage attribute to have a valid justification for suppressing, now that we are preserving the necessary interfaces for COM Interop. Fix dotnet#75031
…warning that Distributed transactions don't work with trimming.
…s/DtcProxyShim/DtcProxyShimFactory.cs
- Complete the list of all transaction interfaces - Sort the DynamicDependencies - Update the trim warning message
This gives a better message to users that distributed transactions don't work with trimming.
@vitek-karas @jkurdek - how do I fix the trimming error?
Don't I need a |
It's because of this: if (RuntimeInformation.ProcessArchitecture == Architecture.X86)
{
throw new PlatformNotSupportedException(SR.DistributedNotSupportOn32Bits);
} The constant prop/branch removal will effectively remove the rest of the method on X86, and thus the suppression is considered redundant because the code it relates to isn't there anymore. This is a known limitation of the redundant suppression detection - it doesn't work correctly with branch removal (it sees the code after branch removal). There were 2 or 3 other places where we hit this in the runtime. The workaround is to extract the rest of the method after the if into a separate method and point the suppression to that. On X86 that new method will be completely removed and there won't be any warnings (the redundant suppression detection doesn't trigger on unmarked methods at all). |
…tely trimmed on x86.
Test failure is #490. |
* Make System.Transactions.Local trimmable on Windows Remove `IsTrimmable=false` from the project, so this assembly is still trimmed with `partial` trimming on Windows. Add a "LibraryBuild" ILLink warning, so when the distributed transaction code is not trimmed, the app developer gets a warning that it is not guaranteed to work. Fix dotnet#75031 * Fix x86 build. Move the ILLink suppression to a method that is completely trimmed on x86.
* Make System.Transactions.Local trimmable on Windows Remove `IsTrimmable=false` from the project, so this assembly is still trimmed with `partial` trimming on Windows. Add a "LibraryBuild" ILLink warning, so when the distributed transaction code is not trimmed, the app developer gets a warning that it is not guaranteed to work. Fix #75031 * Fix x86 build. Move the ILLink suppression to a method that is completely trimmed on x86.
Remove
IsTrimmable=false
from the project, so this assembly is still trimmed withpartial
trimming on Windows.Add a "LibraryBuild" ILLink warning, so when the distributed transaction code is not trimmed, the app developer gets a warning that it is not guaranteed to work.
Fix #75031
The full, correct fix here would be to use COMWrappers. However, #75031 (comment) indicates that level of investment isn't justified at this time. So using a temporary approach for now.