VisualStudioHelpers.ps1 stop enabling 8.3 filename creation (#9862)

The bug that prompted enabling 8.3 filename creation was fixed 5 years ago, see https://github.com/xamarin/xamarin-android/issues/3407:
> Fix included in Xamarin.Android 10.1.0.30.
>
> Fix included on Windows in Visual Studio 2019 version 16.4.

We're on VS 2019 16.11: 9815039618/images/windows/Windows2019-Readme.md (L233)

8.3 filename creation is known to hurt file creation performance, especially when there are a large number of similarly named files in the same folder:
* https://learn.microsoft.com/en-us/archive/blogs/josebda/windows-server-2012-file-server-tip-disable-8-3-naming-and-strip-those-short-names-too
* https://www.linkedin.com/pulse/dont-forget-disable-short-filenames-83-servers-folders-wes-brown
* https://deep.data.blog/2013/06/19/debugging-story-slowness-due-to-ntfs-short-file-8-3-name-generation/

I created a new VM with the base Azure Marketplace Windows 2019 image and confirmed that 8.3 name generation is disabled by default for both the OS and temp disk:
```
fsutil 8dot3name query C:
The volume state is: 1 (8dot3 name creation is disabled).
The registry state is: 2 (Per volume setting - the default).

Based on the above settings, 8dot3 name creation is disabled on C:

fsutil 8dot3name query D:
The volume state is: 1 (8dot3 name creation is disabled).
The registry state is: 2 (Per volume setting - the default).

Based on the above settings, 8dot3 name creation is disabled on D:
```

This might help a bit with https://github.com/actions/cache/issues/752, although I haven't tested it, and AFAICT it's unlikely make an order of magnitude difference.
This commit is contained in:
Congyi Wu
2024-05-16 12:32:15 -04:00
committed by GitHub
parent e11ab1f9c6
commit 5ecfd27e8f

View File

@@ -44,15 +44,6 @@ Function Install-VisualStudio {
Test-FileSignature -Path $bootstrapperFilePath -ExpectedThumbprint $SignatureThumbprint
try {
Write-Host "Enable short name support on Windows needed for Xamarin Android AOT, defaults appear to have been changed in Azure VMs"
$shortNameEnableProcess = Start-Process -FilePath fsutil.exe -ArgumentList ('8dot3name', 'set', '0') -Wait -PassThru
$shortNameEnableExitCode = $shortNameEnableProcess.ExitCode
if ($shortNameEnableExitCode -ne 0) {
Write-Host "Enabling short name support on Windows failed. This needs to be enabled prior to VS 2017 install for Xamarin Andriod AOT to work."
exit $shortNameEnableExitCode
}
$responseData = @{
"channelUri" = $channelUri
"channelId" = $channelId