-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Use ReferencePathWithRefAssemblies for libs ILLink #79595
Conversation
Fixes #79513 The libraries build invokes ILLink to perform "library" mode trimming. The libraries build step is expected to be runtime agnostic and shouldn't bind against a specific CoreLib runtime implementation. During compilation, even though we have a ProjectReference pointing to the CoreLib/src project, we build against CoreLib/ref. But that ILLink invocation doesn't honor that as it uses the ReferencePath msbuild item instead of ReferencePathWithRefAssemblies.
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries Issue DetailsFixes #79513 The libraries build invokes ILLink to perform "library" mode trimming. The libraries build step is expected to be runtime agnostic and shouldn't bind against a specific CoreLib runtime implementation. During compilation, even though we have a ProjectReference pointing to the CoreLib/src project, we build against CoreLib/ref. But that ILLink invocation doesn't honor that as it uses the ReferencePath msbuild item instead of ReferencePathWithRefAssemblies.
|
Yes, it is going to fix the problem. We are going to lose some trimming that is happening right now. It should not be in the noise range for CoreCLR (about 3kB across whole netcoreapp). It can be more for Mono mobile targets, but I do not think it is a problem there since mobile targets should always run trimming step during publish and so it is not going to impact size of the final app. |
You can also revert #79523 as part of this change. It should not be necessary anymore. |
@marek-safar Any concerns about impact of this change on mobile targets? |
@jkotas no concerns, mobile runtime packs are massive for other reasons so any sdk like trimming has no visible impact. |
Will do that in a follow-up PR. |
Should we backport this? |
I defer to @jkotas and @MichalStrehovsky regarding the likeliness of this affecting customers. As this also impacts inbox binaries which ship inside a package, we would need to also re-ship those (< 10 libs). I.e. System.Text.Json. |
We have #78532 lined up for servicing that is fixing |
This should only affect binaries that reference CoreLib project directly. None of binaries that reference CoreLib project directly ship in a package.
This is the list of assemblies affected by this change (diffed IL before/after):
I think it would be hard to justify pushing the fix to servicing given the limited impact. We do not have any reports of customers hitting the problem in |
Ah, makes sense. Thank you for checking! It is a great testament to the libs test code coverage that the only issue we had was actually found in testing! |
Fixes #79513
The libraries build invokes ILLink to perform "library" mode trimming. The libraries build step is expected to be runtime agnostic and shouldn't bind against a specific CoreLib runtime implementation.
During compilation, even though we have a ProjectReference pointing to the CoreLib/src project, we build against CoreLib/ref. But that ILLink invocation doesn't honor that as it uses the ReferencePath msbuild item instead of ReferencePathWithRefAssemblies.