Skip to content
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 an empty installer locale #4447

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

d0ggie
Copy link

@d0ggie d0ggie commented May 4, 2024

It is possible that a package manifest does not supply a InstallerLocale. In such case, if --locale is supplied by user, currently required locale list will not ever match, as the list compared against an empty installer locale string.

This moves the existing check so that applies for both locale preference and locale requirement.

Fixes #2305


Microsoft Reviewers: Open in CodeFlow

@d0ggie d0ggie requested a review from a team as a code owner May 4, 2024 23:46
@microsoft-github-policy-service microsoft-github-policy-service bot added the Issue-Bug It either shouldn't be doing this or needs an investigation. label May 4, 2024
@JohnMcPMS
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yao-msft
Copy link
Contributor

yao-msft commented May 6, 2024

I think the original design is to make Preferences match empty locale and let Requirements not match empty locale. We treated empty locale as unknown locale. So when a locale is "required", unknown locale will not be considered as matched.

@denelon
Copy link
Contributor

denelon commented May 6, 2024

We also have the scenario with Windows Server Core where we "need" a locale and we should default to 'en-us' in that case unless otherwise specified.

@yao-msft
Copy link
Contributor

yao-msft commented May 6, 2024

We also have the scenario with Windows Server Core where we "need" a locale and we should default to 'en-us' in that case unless otherwise specified.

This could be a behavior change, did you mean we would treat empty installer locale (just to be clear, this is installer level locale, not the locale manifest) as en-US by default?

@d0ggie
Copy link
Author

d0ggie commented May 6, 2024

Perhaps the correct way to solve this issue would be to seed a missing installer locale from some other locale specified in the manifest, such as package locale? That way, an explicit match would be required (within tolerance limits), but a missing installer locale would not be a showstopper.

However, I'm not sure if a missing installer locale implies a multilingual installer. It is possible, that a multilingual installer picks up an "incorrect" locale based on user region, not based on OS / user preference. While the software itself is installed using the preferred locale, the installer might report back the locale incorrectly, which reflects the locale using during the installer (or region).

I've seen this happen at least with TheDocumentFoundation.LibreOffice package. The manifest is missing InstallerLocale, installer is multilingual but does not pick up the locale based on the user preference, but based on user region (which I think is not correct). So, while the software (installer) might be partially to blame, this yields a deadlock anyway, if user region is not any of the PackageLocales.

@Trenly
Copy link
Contributor

Trenly commented May 6, 2024

An empty installer locale generally means that the manifest author didn’t add it, for any number of reasons - was a bit lazy, couldn’t find the right switches, or the website only served the URL for their locale and they weren’t aware other locales were available.

Because the installer locale is not a required field in the manifest, empty is treated as "Unknown". I believe this explains the current behavior very well. If someone had a preference for a certain locale and there is an installer where the locale is unknown, then the installer can still be selected since the locale choice is just a preference. But, if the user specifies a locale is required, then it would violate the explicit locale requirement if an installer with an unknown locale were used, as it's not certain that the installer would be that locale (just like the behavior you described for Libre Office).

Package Locale only describes the metadata that is shown through WinGet and doesn’t correlate to the installers at all, so that really can’t be used.

We've also tried things like having the manifest creation tools set a default, but that resulted in even more problems where users whose system wasn’t of the locale specified in the manifest couldn’t install many packages, as the current system locale is also treated as a correlation point

@mominshaikhdevs
Copy link

stale? or should it be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installer locale does not match required locale (No applicable installer found; see logs for more details.)
6 participants