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

Cannot render authentication prompt UI on Windows-arm64 #1539

Open
kyle-rader-msft opened this issue Feb 27, 2024 · 3 comments
Open

Cannot render authentication prompt UI on Windows-arm64 #1539

kyle-rader-msft opened this issue Feb 27, 2024 · 3 comments
Labels
auth-issue An issue authenticating to a host

Comments

@kyle-rader-msft
Copy link

Version

2.4.1

Operating system

Windows

OS version or distribution

Windows 11 Pro Arm 64

Git hosting provider(s)

Azure DevOps

Other hosting provider

No response

(Azure DevOps only) What format is your remote URL?

None

Can you access the remote repository directly in the browser?

Yes, I can access the repository

Expected behavior

There are 2 expected behaviors that are not happening.

  1. There should be no auth prompt in the first place. I have the following GCM config set:
[credential]
	interactive = auto
	azreposCredentialType = oauth
	msauthUseBroker = true
	msauthUseDefaultAccount = true

as well as

[credential "azrepos:org/<ORG>"]
	username = me@contoso.com
	azureAuthority = <AUTHORITY_URL>

On this same machine, in this same state https://aka.ms/azureauth doesn't need to prompt and uses the current OS account without issue.

  1. GCM is launching an auth prompt, and that prompt should render an allow me to continue with the auth flow.

Actual behavior

  1. Silent auth via broker isn't happening.
  2. The prompt renders an empty window frame. The program icon is shown on the task bar, and the window frame outline is there, but the body is transparent and empty.

Logs

No response

@kyle-rader-msft kyle-rader-msft added the auth-issue An issue authenticating to a host label Feb 27, 2024
@mjcheetham
Copy link
Collaborator

This is a known issue with some ARM graphics drivers and Avalonia UI. We added a workaround to use software rendering in newer versions of GCM.

public bool UseSoftwareRendering
{
get
{
// WORKAROUND: Some Windows ARM devices have a graphics driver issue that causes transparent windows
// when using hardware rendering. Until this is fixed, we will default to software rendering on these
// devices. Users can always override this setting back to HW-accelerated rendering if they wish.
bool defaultValue = PlatformUtils.IsWindows() && PlatformUtils.IsArm();
return TryGetSetting(KnownEnvars.GcmGuiSoftwareRendering,
KnownGitCfg.Credential.SectionName,
KnownGitCfg.Credential.GuiSoftwareRendering,
out string str) ? str.ToBooleanyOrDefault(defaultValue) : defaultValue;
}
}

If for some reason it isn't detecting ARM correctly, you can manually enable SW rendering to see if that helps.

https://github.com/git-ecosystem/git-credential-manager/blob/main/docs/environment.md#gcm_gui_software_rendering
https://github.com/git-ecosystem/git-credential-manager/blob/main/docs/configuration.md#credentialguisoftwarerendering

@kyle-rader-msft
Copy link
Author

Thanks @mjcheetham , I'll see if I can try that at some point. for the time being, I set GITASKPASS globally to a my azureauth git ask pass wrapper and haven't gotten a prompt since ;)

@Hunv
Copy link

Hunv commented Mar 25, 2024

A hint for Visual Studio 2022 users:
run this to enable software rendering for git:
C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw64\bin\git.exe config --global credential.guiSoftwareRendering true

And a hint for SourceTree users without Visual Studio:
run C:\users\<username>\appdata\local\Atlassian\SourceTree\git_local\bin\git.exe config --global credential.guiSoftwareRendering true
to enable the workaround. It seems like you have to run just one of the commands if you use both.

It is confirmed, that it is a bug in the driver by a Microsoft guy at AvaloniaUI/Avalonia#10405. Maybe it will be fixed soon. The statement at time of writing is "fixed in the near future" (Status: Mid Dec. 2023).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth-issue An issue authenticating to a host
Projects
None yet
Development

No branches or pull requests

3 participants