Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Initial changes for globalization hybrid mode #81470
Initial changes for globalization hybrid mode #81470
Changes from 27 commits
f8e72d8
a82743d
954ed0f
1362d45
cb23688
af32324
83f4e7b
4ac3e6b
60e090a
26ce9a9
a10f09d
dc347f5
09d599e
bacc227
e844a40
f7f730a
46c9e68
1b7aa37
789613b
0b9f32d
1aee1e0
b382101
1556d17
5ab240a
5028045
ad4c98b
3eb5cae
27424bf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Are we still planning to add the feature switch
HybridGlobalization
? Reading up on https://github.com/dotnet/designs/blob/main/accepted/2020/feature-switch.md a bit more, it seems like feature switches primarily help control the size of libraries by trimming out areas we know will not be reached under certain conditions (when a particular feature switch is on). For example, when the InvariantGlobalization feature switch is on (true), the GlobalizationMode/Settings class is trimmed out.So for HybridGlobalization, is there anything we want to/can trim out if its known that HybridGlobalization is being used? From what I am understanding, HybridGlobalization is to help reduce the reliance on ICU. When its true, it doesn't make any other code completely unreachable right now does it? Or is
IcuGetLocaleInfo(..., LocalStringData ..., ...)
all supposed to be unreachable now?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.
We need to have feature switch HybridGlobalization as without it we will not understand to load fully icu or no. In ideal case IcuGetLocaleInfo should not be used in HybridGlobalization when all functionalities will be implemented by native functions. Also for HybridGlobalization we will load smaller icu files (trimmed out the functionalities that are implemented by native functions), this will be done in upcoming PRs.
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.
@mkhamoyan the feature switches listed here are linker feature switches, i.e. where the linker replaces/hardcodes the value of the corresponding AppContext switch so that unused code can be trimmed out.
We don't need that, we have a regular AppContext switch that is unaffected by trimming so having it listed in this doc is confusing.
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.
Will remove it from here. Do we have doc for regular AppContext switches?
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.
As far as I know we just have the public docs where we could add it: https://learn.microsoft.com/en-us/dotnet/core/runtime-config/globalization
Note that in our case we'd just have runtimeconfig.json and environment variable options since the MSBuild property would need wiring up in the dotnet/sdk.
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.
Should this be under iOS ifdef - since all uses are under iOS ifdef as well?
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.
Yes, plus wasm and wasi as well.
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.
For now I will put under ioslike platforms. For wasm we have seperate PR.
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.
If
HybridGlobalization
is not going to be a feature switch, should this be usingAppContextConfigHelper.GetBooleanConfig
? Will the switchSystem.Globalization.Hybrid
ever be set? I thinkSystem.Globalization.Invariant
andSystem.Globalization.PredefinedCulturesOnly
switches are probably set in theTrimmingTests
runtime/src/libraries/System.Runtime/tests/TrimmingTests/System.Runtime.TrimmingTests.proj
Lines 16 to 19 in 9b38f2a
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.
Once more functionalities will be implemented this will be used and we can have tests in TrimmingTests for hybrid mode.