-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Check for Windows NLS vs. ICU behavior differences in Globalization tests #6034
Comments
@tarekgh to weigh in, This is intentional. The windows build of .NET works on older OSes where ICU is absent and our customers expect it to use NLS. I guess you're saying you'd prefer that we would have made it more breaking by not falling back to NLS on an OS version where we expect ICU to be present, unless the customer specifically told us to use NLS with the switch? |
Can you clarify if this is even a supported/tested scenario? e.g. NLS fallback on an modern OS like nanoserver 2025 where the globalization FOD is not installed by default? |
Comments on the table above:
The only scenario that is not supported which you called it
.NET ensures that applications follow OS behavior. So, if ICU is available on Windows, the app will use ICU by default. If ICU is not present, the app will revert to the default globalization behavior, similar to native applications. |
Some clarification, on |
@ericstj I think you meant:
If that's the case, then yes that's the question we're asking. If ICU is the forward-looking globalization approach for Windows, then we are wondering if we should reconsider the Runtime's behavior for this scenario (for new Windows versions). I think all other Windows versions since ICU was added all have ICU. Except now NanoServer 2025. We are inclined to turn globalization invariant mode on by default for this image, so that we avoid users sliently encountering breaking changes when migrating from NanoServer 2022 to 2025 images and not realizing they're using NLS. Then we would provide instructions for installing ICU and enabling globalization. |
Let's assume we ship images w/o ICU installed and w/o GIVM enabled. Do we need to warn or just inform users about this choice? That's the key question. |
Do we have the option to install ICU on such image? |
Yes! That's one of the options and is my preference. We need to find out the size impact for that. It would be good to get an answer to the question I asked. Some of this thread is operating on the premise that NLS behavior is different/worse and that we'd need to warn people about that. I want to determine if that is true. |
|
I think it will be good to inform/warn about that. The reason is there are some features that are not going to work at all when switching back to NLS. For example, creating time zone objects using IANA names will not work. |
I meant "warn" and "inform" as two different options. I hear you saying "warn", which is what I was looking for. OK. This leads me to believe that we should not ship images with NLS as the default. We need to decide if we're going to switch to shipping nanoserver images with the A good option is to ship with ICU in-box for .NET 8/9 and then revisit for .NET 10 if we have any feedback that motivates a different choice. Compressed size is the key aspect, but that size looks very familiar w/rt Linux, so I assume it will add about 12MB compressed. |
I agree with @richlander. If there is no strong reason prevent getting ICU installed on that image.
Another option (I am not necessarily preferring) is to make the image behave as Linux. i.e, setting the environment variable |
Let me get back to you on the compressed size difference. |
|
The Nano Server Globalization FOD is not available yet. The expected availability date is TBD. However I did build and calculate sizes for some .NET Runtime 9.0.0 images today for comparison:
To get compressed size, I built and pushed the images to a test ACR. ACR does not show compressed size in the Azure UI, but I computed it by summing the size of the individual compressed layers like so:
|
@lbussell Is the Nano-Server 2025 image size calculated without including ICU? I'm trying to determine how much the ICU library contributes to the compressed image size. |
@tarekgh Nano Server 2025 does not contain an
I used images |
But ultimately yes @tarekgh, the above table was calculated without adding ICU and with adding the .NET Runtime. The Dockerfiles I used to build them are in my draft PR for adding the Server 2025 images. |
Interesting, this means nothing changed between nano-server 2022 and 2025 regarding globalization. So, why are we worried about this scenario? Users of 2022 are already using NLS and if they upgrade to 2025 will continue using NLS if we don't do anything. Right? |
We started the discussion with an incorrect set of assumptions. We would like your team to do a test pass on Nano Server 2025 to validate that there have been no changes of behavior or regressions that we need to address or document. /cc @ericstj |
@tarekgh -- do you think we have some tests from dotnet/runtime that we can run specifically on these SKUs and diff the results? Probably they aren't part of our regular test matrix so we wouldn't know if we have failures or not. |
I am talking to Windows team to know exactly what the globalization differences between nano-server is 2022 and 2025. This is simpler than trying to figure it out ourselves. |
Reading a spec and validating an implementation are two different activities. |
@richlander is the ask here then to more generally validate the entire runtime on Nano Server 2025? I've lost track of the next steps since this started as a specific globalization issue, but now it seems broader. I'd like to make sure we're on the same page and not repeating efforts others are already doing, or putting in more resources to this specific case than we do for other platforms. The best way to scout these things is if we have a helix queue to add work to - we can then schedule a build sending work to that queue. |
This will be blocked on Add Windows 2025 support to Helix (dotnet/dnceng#4170). We can produce Nano Server 2025 Helix container images from buildtools-prereqs, but it won't matter if we don't have a Server Core 2025 queue to run them on, if I understand correctly how Helix works. /cc @ilyas1974 |
How are folks testing on Server Core 2025 right now? Just building locally and running tests? VMs? Any instructions that could be shared - maybe we can get someone to scout the library tests. |
We are running the .NET Docker tests which aren't very comprehensive. I don't know any other teams that are running tests on 2025. There is one 2025 ARM queue for some reason. But no AMD64: dotnet/dnceng#3343. I proposed in my PR that we ship the |
I already talked to Windows team and the behavior should be clear now. nano-server 2025 will work as nano-server-2022 which will use NLS. Both are not installing ICU till now. Only changes can be noticed when Windows updates the locale data, which usually happens almost with every release. Let me know if you have any more questions regarding globalization I can help with. |
Thanks. I think that is good enough. We have been so used to ICU at this point, that an NLS scenario seemed unique and different. Seems like we should move forward treating this as just another version upgrade. Thanks for reaching out to the Windows team and helping us better understand the situation. |
@tarekgh, so the presence or absence of |
That is correct, .NET don't depend on this library. This library is used by WinRT which we are not calling for globalization. |
.NET images for Server 2025 are now published from our nightly branch (not supported for production yet). Can @tarekgh or @ericstj do any testing with these images to validate @tarekgh's claims here?
|
@lbussell I smoke tested the SDK image and I can confirm NLS is used successfully there and behave as expected. |
Thanks much! |
Tests were added in #6120. |
Nano Server 2025 does not include ICU by default.
When ICU is missing on Linux, Globalization Invariant Mode is disabled, and you try to use globalization features, the .NET Runtime throws an exception.
In the same scenario on Windows, instead of throwing an error, the Runtime falls back to using Windows' NLS (National Language Support) feature. This has some breaking changes which are documented here: https://learn.microsoft.com/en-us/dotnet/core/extensions/globalization-icu
We should check for those breaking changes in the recently added globalization test scenario.
Related Issues: #5944, #5635
The following table summarizes my best understanding of the .NET Runtime's behavior under different globalization scenarios:
The text was updated successfully, but these errors were encountered: