-
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
Runtime's illink runs don't catch certain set of warnings #84297
Comments
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar Issue DetailsIf a framework library contains code which:
Then runtime build will not report the trim warning anywhere. But dotnet/sdk will fail a test when such framework makes it into the SDK repo. We have 3 runs of illink on a framework assembly:
Found in dotnet/sdk#31571. Related discussion in #84272.
|
@sbomer for ideas. I think the cleanest solution would be to fix the "sfx" run to also merge all |
What the "sfx" run trying to test? If it is trying to test what happens on end-user machine, it should not use |
It's there to report all of the trim warnings in the framework. It IS the run which should have reported this problem. (There's a matching "oob" run which does the same for all OOB assemblies). While it's true that It's not very common that users will mark framework assemblies as copy, but it does happen (typically when they play the whack-a-mole game if trimming breaks their app and they don't care to fix the warnings). That's basically what the test in SDK is trying to validate, that we're not shipping framework code which will produce trim warnings. The test originally targets down-level TFMs - meaning that latest SDK will not produce warnings when trimming downlevel apps. But we can't (shouldn't) disable the test for "current" TFM, since around RC that test needs to be passing for the current TFM, and we're bound to forget to enable it on-time. |
Should the "sfx" run use the "copy" mode then? |
Maybe it should. But it's not perfect either - I think it runs on the built output, not the trim output, but I could be wrong (in which case it would see all code, even that which is not rooted by anything ever). If it runs on the trim output, then "copy" would be correct behavior I think. |
It's not testing that "we're not shipping framework code which will produce trim warnings". It is testing that the warnings the framework code produces are expected. There are a ton of expected warnings in that test. In my mind, the only issue here is that this test is in the dotnet/sdk and not in dotnet/runtime. If we want to catch these issues earlier (which are pretty rare, AFAICT), we can move this test to dotnet/runtime. But I'm not sure it is strictly necessary. The test did its job - it caught the problem. It just didn't do it before the code was merged into dotnet/runtime. |
If a framework library contains code which:
Then runtime build will not report the trim warning anywhere. But dotnet/sdk will fail a test when such framework makes it into the SDK repo.
We have 3 runs of illink on a framework assembly:
ILLink.Descriptors.LibraryBuild.xml
which is a descriptor, which roots more code (typically for testing purposes - I assume the tests create these via reflection for now). This run actually sees the problem in the code, but we disable all trim related warnings in this run, so it's not reported.ILLink.Descriptors.LibraryBuild.xml
, so the affected code is not rooted. And thus the trimmer doesn't even see the affected code.Found in dotnet/sdk#31571. Related discussion in #84272.
The text was updated successfully, but these errors were encountered: