-
Notifications
You must be signed in to change notification settings - Fork 128
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
Support feature conditions on XML descriptors #1268
Comments
I'm all for doing this 😄 |
/cc @eerhardt |
I agree that this would be a useful extension of XML descriptors. |
If we take this approach, we should be able to close dotnet/runtime#37352, right? The motivation behind dotnet/runtime#37352 was being able to "root" types globally, but also conditionally. See the discussion here: dotnet/runtime#37288 (comment). So if there are scenarios where we need to preserve a type globally under certain conditions (Debug, COM, JS, etc), we can use the XML descriptor + feature switch mechanism, instead of putting a Note that the advantage of having |
This scenario should be used only for cases where the source of the dependency is outside of src/libraries (e.g. external code, different runtime, etc) for anything else
That's not true. See https://github.com/mono/linker/blob/master/docs/data-formats.md#preserve-a-type |
* Support feature settings on descriptor files Fixes #1268. * Disable feature descriptors for mono Since they conflict with the --exclude-feature "feature" attributes in the descriptor XML. * Revert "Disable feature descriptors for mono" This reverts commit 78c2f52. * Support featuredefault="true" To indicate that a substitution or descriptor should be applied in the absence of a feature setting. Note that this is restricted to still require the featurevalue attribute, to prevent the definition of default substitutions that are never applied for any feature settings. Also address PR feedback: - Move the feature checks into a separate class - #ifdef an implementation instead of callsites * Fix signatures in tests * Update data format docs * Fix whitespace * PR feedback Add comments about order of checking assemblyname and feature attributes, and make processing consistent in LinkAttributesStep. * Clarify featuredefault behavior in documentation
* Support feature settings on descriptor files Fixes dotnet/linker#1268. * Disable feature descriptors for mono Since they conflict with the --exclude-feature "feature" attributes in the descriptor XML. * Revert "Disable feature descriptors for mono" This reverts commit dotnet/linker@78c2f52. * Support featuredefault="true" To indicate that a substitution or descriptor should be applied in the absence of a feature setting. Note that this is restricted to still require the featurevalue attribute, to prevent the definition of default substitutions that are never applied for any feature settings. Also address PR feedback: - Move the feature checks into a separate class - #ifdef an implementation instead of callsites * Fix signatures in tests * Update data format docs * Fix whitespace * PR feedback Add comments about order of checking assemblyname and feature attributes, and make processing consistent in LinkAttributesStep. * Clarify featuredefault behavior in documentation Commit migrated from dotnet/linker@f87cfa2
This would allow us to use the embedded ILLink.Descriptors.xml to root "global" dependencies for which we don't have a great place to put
DynamicDependencyAttribute
, while allowing them to be linked out using feature settings. From discussion with @vitek-karas, it sounds like this will be useful for removing debugger support, COM, etc.@marek-safar what do you think of this?
The text was updated successfully, but these errors were encountered: