-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Globalization invariant mode not working on Linux with .NET 8 Preview 6 native AOT #34091
Comments
Why do you set @MichalStrehovsky just as an FYI, I don't think we should try to fix here anything - maybe SDK could clean this variable in the CLI to make sure that it can operate correctly as a whole. |
@vitek-karas @MichalStrehovsky Setting In my actual project, I'm already setting |
Thanks for clarifying this I didn't realize that you need to set this in order for the SDK to even work. |
I know this failure mode from dotnet/runtime#86689 (comment). This would fail for any assembly with a non-default culture even in .NET 7 (and also for PublishReadyToRun). We're just more likely to run into this now. I don't actually know if using the SDK with |
Recent .NET 8 releases cause two problems with our existing Linux Docker builds: * Our build containers don't have ICU libraries installed and have `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT` set. The .NET SDK can no longer deal with localization assets in libraries (e.g. System.CommandLine) in such scenario. See dotnet/sdk#34091. This may not be addressed soon (if ever), and we shouldn't give up improvements coming from recent .NET updates. Adding ICU libraries also don't have downsides to the BMX binaries themselves. They're only used during the build process, but aren't added to BMX nor required during BMX runtime. * Native AOT builds break in Ubuntu 16. .NET 8 runtime targets Ubuntu 16, but apparently Ubuntu 18+ is a requirement for native AOT (see [docs](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/?tabs=net8plus%2Clinux-ubuntu#prerequisites)). The apparent reason is that clang version is too low on Ubuntu 16. (We can still seek more clarification from the .NET team via GitHub issue.) Ubuntu 16 support ended more than two years ago, so it's not unreasonable for BMX to drop support. I'm switching the Linux build to use Amazon Linux 2 (AL2), because * AL2 uses an older glibc version than Ubuntu 18, so it should make BMX compatible with more Linux systems. My anecdotal testing also suggests that BMX built on AL2 can still run on Ubuntu 16. * This still ensures that BMX can be run on AL2, which many of D2L's EC2 instances run on.
Hi. This issue still persists in the latest .NET 7 release. Am trying to host a .NET webapp in a docker container on Debian, also running in to the same issue if using InvariantGlobalization. Has there been any updates in this? |
While |
Affirmative. I am specifically trying to containerize an Umbraco CMS application using this method, but I understand that this might be out of your hand. The issue I specifically bumped into was the .NET 7 containers not having support for ICU language libraries from the get go, and language invariation would break the application. Had to build my own Dockerfile and add support for it that way.
|
I had similar issue while trying to database-update, the work around for me was to change to false on the project file. |
The problematic code path was now removed from the AOT compiler as part of some refactorings. We still do not test or support the SDK with |
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true |
Describe the bug
When building a project that
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
setthe build fails.
To Reproduce
Build a project in container with the following files:
(purposefully including a reference to
System.CommandLine
to include some globalization resources)cstest.csproj:
Program.cs:
Dockerfile:
Exceptions (if any)
Further technical details
This happens on
Alpine Linux only, not on other distros like UbuntuLinux only, not on Windows or MacThe text was updated successfully, but these errors were encountered: