-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Detect invalid package locales and warn the user #26729
Detect invalid package locales and warn the user #26729
Conversation
I'm only marking this for review to see if the tests run - there are more open questions |
Alright - there's only one major question we should answer - what do we do with assets that are found using completely unknown locale identifiers? We can drop them (currently implemented) or include them. Should we be forwards-compatible for locale identifiers? How often does this data change? |
Country codes change based on an IANA registry: https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry |
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.
Overall looks good. Please make sure to do some end to end testing before merging (Ie building projects that reference packages that we know have non-normalized locales, as well as packages that have correct locales).
src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAResolvePackageAssetsTask.cs
Outdated
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAResolvePackageAssetsTask.cs
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAResolvePackageAssetsTask.cs
Outdated
Show resolved
Hide resolved
400e4f7
to
59b5991
Compare
59b5991
to
cbcd33d
Compare
Manual testing shows it working as expected:
|
One thing I'd like to call out - we've been fairly conservative about introducing new warnings/errors purely on updating the SDK. It typically requires updating a Warning or Analysis level (which by default is tied to TFM), which is a user-driven action. That falls over a bit here because this bug can impact anyone on any TFM, but I just wanted to call out that we are breaking our own rule a bit here. |
Fixes #26711
There's a long discussion but the gist is that we can detect situations where locale codes are mismatched and tell the user about it. We can even correct those that can be normalized via the BCL culture lookups.
Open questions: