Uh oh!
There was an error while loading. Please reload this page.
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.
ghost
commented
Dec 13, 2022
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.
|
jkotas
commented
Dec 13, 2022
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. |
jkotas
commented
Dec 13, 2022
You can also revert #79523 as part of this change. It should not be necessary anymore. |
jkotas
commented
Dec 13, 2022
@marek-safar Any concerns about impact of this change on mobile targets? |
marek-safar
commented
Dec 13, 2022
@jkotas no concerns, mobile runtime packs are massive for other reasons so any sdk like trimming has no visible impact. |
ViktorHofer
commented
Dec 13, 2022
Will do that in a follow-up PR. |
akoeplinger
commented
Dec 14, 2022
Should we backport this? |
ViktorHofer
commented
Dec 14, 2022
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. |
MichalStrehovsky
commented
Dec 14, 2022
We have #78532 lined up for servicing that is fixing |
jkotas
commented
Dec 15, 2022
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 |
MichalStrehovsky
commented
Dec 15, 2022
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.