-
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
Fix NullableAttribute illink test failures #90449
Conversation
When we started building with preview 7 in 5549f72, NullableAttribute in these testcases started to use the attribute definition from the framework, instead of generating it into the code. This broke the `--used-attrs-only` optimization because `skip` assemblies (the default for the framework in these testcases) are treated as if all types in them are kept, for the purposes of the `--used-attrs-only` optimization. (The optimization removes attribute instances unless the attribute type is preserved for some other reason). It's not clear what the intended behavior of `--used-attrs-only` is for `skip` assemblies, and the discussion in dotnet/linker#952 indicates that it's considered experimental, so this fixes the failures by using the `link` action. This represents a more realistic scenario since `skip` is mainly used in testing to avoid linking the framework in every testcase.
Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas Issue DetailsWhen we started building with preview 7 in It's not clear what the intended behavior of An alternative fix is to change runtime/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs Lines 842 to 843 in 05dfb7e
to also set markOnUse for skip assemblies, but I think such a change would require more discussion of what skip is supposed to mean.
Fixes #90431
|
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.
I agree with basically everything in the PR description - so the change looks good. Thanks!
This is hitting the RC1 branch. I'll backport it. |
/backport to release/8.0-rc1 |
Started backporting to release/8.0-rc1: https://github.com/dotnet/runtime/actions/runs/5882378435 |
Yup, this is the same failure. Backporting should fix it. |
When we started building with preview 7 in
5549f72, NullableAttribute in these testcases started to use the attribute definition from the framework, instead of generating it into the code. This broke the
--used-attrs-only
optimization becauseskip
assemblies (the default for the framework in these testcases) are treated as if all types in them are kept, for the purposes of the--used-attrs-only
optimization. (The optimization removes attribute instances unless the attribute type is preserved for some other reason).It's not clear what the intended behavior of
--used-attrs-only
is forskip
assemblies, and the discussion indotnet/linker#952 indicates that it's considered experimental, so this fixes the failures by using the
link
action. This represents a more realistic scenario sinceskip
is mainly used in testing to avoid linking the framework in every testcase.An alternative fix is to change
runtime/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs
Lines 842 to 843 in 05dfb7e
to also set
markOnUse
forskip
assemblies, but I think such a change would require more discussion of whatskip
is supposed to mean.Fixes #90431