From 955b74e3920f28d185836d27c8e3124efac52b61 Mon Sep 17 00:00:00 2001 From: Keith Mahoney <41657372+kmahone@users.noreply.github.com> Date: Tue, 11 Aug 2020 13:18:01 -0700 Subject: [PATCH] Enable PR build to run on new winuibuildagents build pool (#3095) --- .vsconfig | 49 +++++++++++++++++++ .../MUX-InstallWindowsSDK-Steps.yml | 2 +- build/Install-WindowsSdkISO.ps1 | 25 +++++++--- build/MUX-PR.yml | 2 +- build/MUX-SimpleBuildAndTest.yml | 2 +- dev/dll/Microsoft.UI.Xaml.vcxproj | 2 +- tools/MUXPGODatabase/restore-pgodb.ps1 | 2 +- tools/NugetWrapper.cmd | 6 +-- 8 files changed, 75 insertions(+), 15 deletions(-) create mode 100644 .vsconfig diff --git a/.vsconfig b/.vsconfig new file mode 100644 index 0000000000..77413c1fc3 --- /dev/null +++ b/.vsconfig @@ -0,0 +1,49 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Component.CoreEditor", + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.NetCore.Component.Runtime.3.1", + "Microsoft.NetCore.Component.SDK", + "Microsoft.VisualStudio.Component.NuGet", + "Microsoft.Net.Component.4.6.1.TargetingPack", + "Microsoft.VisualStudio.Component.Roslyn.Compiler", + "Microsoft.VisualStudio.Component.Roslyn.LanguageServices", + "Microsoft.NetCore.Component.DevelopmentTools", + "Microsoft.Net.Component.4.8.SDK", + "Microsoft.Net.Component.4.7.2.TargetingPack", + "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", + "Microsoft.Component.MSBuild", + "Microsoft.VisualStudio.Component.TextTemplating", + "Microsoft.VisualStudio.Component.ManagedDesktop.Core", + "Microsoft.Net.Component.4.5.2.TargetingPack", + "Microsoft.Net.Component.4.5.TargetingPack", + "Microsoft.Net.Component.4.TargetingPack", + "Microsoft.Net.Component.4.5.1.TargetingPack", + "Microsoft.Net.Component.4.6.TargetingPack", + "Microsoft.Net.ComponentGroup.TargetingPacks.Common", + "Microsoft.Net.Core.Component.SDK.2.1", + "Microsoft.VisualStudio.Component.DiagnosticTools", + "Microsoft.Net.Component.4.7.TargetingPack", + "Microsoft.VisualStudio.Component.VC.CoreIde", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "Microsoft.VisualStudio.Component.VC.DiagnosticTools", + "Microsoft.VisualStudio.Component.Windows10SDK.18362", + "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", + "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging", + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.VisualStudio.Component.VC.Redist.14.Latest", + "Microsoft.VisualStudio.ComponentGroup.ArchitectureTools.Native", + "Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core", + "Microsoft.VisualStudio.Component.Windows10SDK.17763", + "Microsoft.VisualStudio.Workload.NativeDesktop", + "Microsoft.Component.NetFX.Native", + "Microsoft.VisualStudio.ComponentGroup.UWP.NetCoreAndStandard", + "Microsoft.VisualStudio.ComponentGroup.UWP.Support", + "Microsoft.VisualStudio.Component.VC.Tools.ARM64", + "Microsoft.VisualStudio.Component.UWP.VC.ARM64", + "Microsoft.VisualStudio.Component.VC.Tools.ARM", + "Microsoft.VisualStudio.ComponentGroup.UWP.VC", + "Microsoft.VisualStudio.Workload.Universal" + ] +} \ No newline at end of file diff --git a/build/AzurePipelinesTemplates/MUX-InstallWindowsSDK-Steps.yml b/build/AzurePipelinesTemplates/MUX-InstallWindowsSDK-Steps.yml index 557e0e0b8a..f471997bca 100644 --- a/build/AzurePipelinesTemplates/MUX-InstallWindowsSDK-Steps.yml +++ b/build/AzurePipelinesTemplates/MUX-InstallWindowsSDK-Steps.yml @@ -7,4 +7,4 @@ steps: targetType: filePath filePath: build\Install-WindowsSdkISO.ps1 arguments: ${{ parameters.sdkVersion }} - displayName: 'Install Insider SDK (${{ parameters.sdkVersion }})' + displayName: 'Install Windows SDK (${{ parameters.sdkVersion }})' diff --git a/build/Install-WindowsSdkISO.ps1 b/build/Install-WindowsSdkISO.ps1 index f1acaeae06..dd8867eff0 100644 --- a/build/Install-WindowsSdkISO.ps1 +++ b/build/Install-WindowsSdkISO.ps1 @@ -6,8 +6,8 @@ param([Parameter(Mandatory=$true, Position=0)] $ErrorActionPreference = 'Stop' # Constants -$WindowsSDKOptions = @("OptionId.UWPCpp", "OptionId.DesktopCPPx64", "OptionId.DesktopCPPx86", "OptionId.DesktopCPPARM64", "OptionId.DesktopCPPARM") -$WindowsSDKRegPath = "HKLM:\Software\Microsoft\Windows Kits\Installed Roots" +$WindowsSDKOptions = @("OptionId.UWPCpp", "OptionId.DesktopCPPx64", "OptionId.DesktopCPPx86", "OptionId.DesktopCPPARM64", "OptionId.DesktopCPPARM", "OptionId.WindowsDesktopDebuggers") +$WindowsSDKRegPath = "HKLM:\Software\WOW6432Node\Microsoft\Windows Kits\Installed Roots" $WindowsSDKRegRootKey = "KitsRoot10" $WindowsSDKVersion = "10.0.$buildNumber.0" $WindowsSDKInstalledRegPath = "$WindowsSDKRegPath\$WindowsSDKVersion\Installed Options" @@ -72,9 +72,11 @@ function Download-File $downloadDestTemp = $downloadPath; # Delete and rename to final dest - if (Test-Path -PathType Container $downloadDest) + Write-Host "testing $downloadDest" + if (Test-Path $downloadDest) { - [System.IO.Directory]::Delete($downloadDest, $true) + Write-Host "Deleting: $downloadDest" + Remove-Item $downloadDest -Force } Move-Item -Force $downloadDestTemp $downloadDest @@ -186,7 +188,16 @@ function Test-InstallWindowsSDK { # A Windows SDK is installed # Is an SDK of our version installed with the options we need? - if (Test-RegistryPathAndValue -Path $WindowsSDKInstalledRegPath -Value "$WindowsSDKOptions") + $allRequiredSdkOptionsInstalled = $true + foreach($sdkOption in $WindowsSDKOptions) + { + if (!(Test-RegistryPathAndValue -Path $WindowsSDKInstalledRegPath -Value $sdkOption)) + { + $allRequiredSdkOptionsInstalled = $false + } + } + + if($allRequiredSdkOptionsInstalled) { # It appears we have what we need. Double check the disk $sdkRoot = Get-ItemProperty -Path $WindowsSDKRegPath | Select-Object -ExpandProperty $WindowsSDKRegRootKey @@ -269,7 +280,7 @@ if ($InstallWindowsSDK) $env:TEMP = Join-Path $env:SystemDrive 'temp' } - $winsdkTempDir = Join-Path $env:TEMP "WindowsSDK" + $winsdkTempDir = Join-Path (Join-Path $env:TEMP ([System.IO.Path]::GetRandomFileName())) "WindowsSDK" if (![System.IO.Directory]::Exists($winsdkTempDir)) { @@ -317,7 +328,7 @@ if ($InstallWindowsSDK) finally { Write-Host -NoNewline "Dismounting ISO $file..." - #Dismount-ISO $downloadFile + Dismount-ISO $downloadFile Write-Host "Done" } } diff --git a/build/MUX-PR.yml b/build/MUX-PR.yml index e7cc499943..60c8a64a6c 100644 --- a/build/MUX-PR.yml +++ b/build/MUX-PR.yml @@ -21,7 +21,7 @@ jobs: ne(dependencies.Setup.outputs['checkPayload.shouldSkipPRBuild'],'True') ) pool: - vmImage: 'windows-2019' + name: 'winuibuildagents' timeoutInMinutes: 120 strategy: maxParallel: 10 diff --git a/build/MUX-SimpleBuildAndTest.yml b/build/MUX-SimpleBuildAndTest.yml index 8af32e986e..74f441ca27 100644 --- a/build/MUX-SimpleBuildAndTest.yml +++ b/build/MUX-SimpleBuildAndTest.yml @@ -11,7 +11,7 @@ jobs: condition: eq(variables['useBuildOutputFromBuildId'],'') pool: - vmImage: 'windows-2019' + name: 'winuibuildagents' timeoutInMinutes: 120 variables: appxPackageDir : $(build.artifactStagingDirectory)\$(buildConfiguration)\$(buildPlatform)\AppxPackages diff --git a/dev/dll/Microsoft.UI.Xaml.vcxproj b/dev/dll/Microsoft.UI.Xaml.vcxproj index 2b63790c25..66858adb97 100644 --- a/dev/dll/Microsoft.UI.Xaml.vcxproj +++ b/dev/dll/Microsoft.UI.Xaml.vcxproj @@ -246,7 +246,7 @@ MinSpace true - false + false diff --git a/tools/MUXPGODatabase/restore-pgodb.ps1 b/tools/MUXPGODatabase/restore-pgodb.ps1 index 00c115b94b..6001abd433 100644 --- a/tools/MUXPGODatabase/restore-pgodb.ps1 +++ b/tools/MUXPGODatabase/restore-pgodb.ps1 @@ -8,7 +8,7 @@ $currentVersion = MakeVersion $releaseVersionMajor $releaseVersionMinor ( GetDat Write-Host ( "PGO OPTIMIZE: requesting {0} version {1}" -f $packageId, ( FormatVersion $currentVersion ) ) -$packageSource = Register-PackageSource -Name MUX_Dependencies -Location $feedUri -ProviderName NuGet -Trusted +$packageSource = Register-PackageSource -ForceBootstrap -Name MUX_Dependencies -Location $feedUri -ProviderName NuGet -Trusted $packages = ( Find-Package $packageId -Source MUX_Dependencies -AllowPrereleaseVersions -AllVersions ) | Sort-Object -Property Version -Descending $best = $null diff --git a/tools/NugetWrapper.cmd b/tools/NugetWrapper.cmd index ad501e825c..e375d447ec 100644 --- a/tools/NugetWrapper.cmd +++ b/tools/NugetWrapper.cmd @@ -5,12 +5,12 @@ if "%VisualStudioVersion%" == "" set VisualStudioVersion=15.0 if defined NUGETEXETOOLPATH goto :AzurePipelines -if not exist %TEMP%\nuget.4.9.2.exe ( +if not exist %TEMP%\nuget.5.2.0.exe ( echo Nuget.exe not found in the temp dir, downloading. - powershell -Command "& { Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/v4.9.2/nuget.exe -outfile $env:TEMP\nuget.4.9.2.exe }" + powershell -Command "& { Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/v5.2.0/nuget.exe -outfile $env:TEMP\nuget.5.2.0.exe }" ) -%TEMP%\nuget.4.9.2.exe %* +%TEMP%\nuget.5.2.0.exe %* exit /B %ERRORLEVEL%