vcpkg/scripts/azure-pipelines/windows/deploy-visual-studio.ps1

87 lines
2.7 KiB
PowerShell
Raw Normal View History

Update VMs, CMake to 3.20.1, CUDA to 11.3, and pwsh to 7.1.3 (#17331) * Update to CUDA 11.3 on Windows. * Update PowerShell to 7.1.3. * Update CUDA to 11.3 on Linux. * "Explode" VM provisioning scripts for more consistent feedback during deploy. This resolves the deployment script often hanging with no feedback as to why. * [libdatachannel] Fix use of deprecated result_type typedef. Submitted upstream as https://github.com/paullouisageneau/libdatachannel/pull/413 * [libvpx] Get the libvpx outputs from the correct place. (Perhaps VS2019 version 16.10 moved where these are placed? I've been defensive and left an attempt to find from the old location in place.) * [chromaprint] Support implementations where lrintf is an intrinsic. * Add provision-entire-image script. * [cudnn] Disable download-on-the-fly due to licensing concerns. * Add libnccl to Linux VMs. * [wangle] Disable x64-windows due to an ICE. * [cmake] Update cmake to 3.20.1 to avoid https://gitlab.kitware.com/cmake/cmake/-/issues/21571 race * [libudis86] Fix passing a bogus working directory which fails on CMake 3.20.x * [dartsim] Disable unit tests, examples, and tutorials, some of which have CMake authoring errors rejected by 3.20.1. * Add thrust to the cuda installees. * [tensorflow] Put .bzl in CURRENT_BUILDTREES_DIR to avoid running out of disk space in CI and to respect --clean-after-build. * [dimcli] Skip port broken by changes in VS2019 project system. * [upb] Disable an additional warning. * [libhv] Fix typo DISABLE_PARALLEL => DISABLE_PARALLEL_CONFIGURE * Update pools
2021-04-27 01:27:45 +08:00
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
# REPLACE WITH UTILITY-PREFIX.ps1
$VisualStudioBootstrapperUrl = 'https://aka.ms/vs/16/release/vs_enterprise.exe'
$Workloads = @(
'Microsoft.VisualStudio.Workload.NativeDesktop',
'Microsoft.VisualStudio.Workload.Universal',
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
'Microsoft.VisualStudio.Component.VC.Tools.ARM',
'Microsoft.VisualStudio.Component.VC.Tools.ARM64',
'Microsoft.VisualStudio.Component.VC.ATL',
'Microsoft.VisualStudio.Component.VC.ATLMFC',
'Microsoft.VisualStudio.Component.VC.v141.x86.x64.Spectre',
'Microsoft.VisualStudio.Component.Windows10SDK.18362',
'Microsoft.VisualStudio.Component.Windows10SDK.19041',
'Microsoft.Net.Component.4.8.SDK',
'Microsoft.Component.NetFX.Native',
'Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset',
'Microsoft.VisualStudio.Component.VC.Llvm.Clang',
'Microsoft.VisualStudio.Component.VC.v141.x86.x64',
'Microsoft.VisualStudio.Component.VC.140'
)
<#
.SYNOPSIS
Install Visual Studio.
.DESCRIPTION
InstallVisualStudio takes the $Workloads array, and installs it with the
installer that's pointed at by $BootstrapperUrl.
.PARAMETER Workloads
The set of VS workloads to install.
.PARAMETER BootstrapperUrl
The URL of the Visual Studio installer, i.e. one of vs_*.exe.
.PARAMETER InstallPath
The path to install Visual Studio at.
.PARAMETER Nickname
The nickname to give the installation.
#>
Function InstallVisualStudio {
Param(
[String[]]$Workloads,
[String]$BootstrapperUrl,
[String]$InstallPath = $null,
[String]$Nickname = $null
)
try {
Write-Host 'Downloading Visual Studio...'
[string]$bootstrapperExe = Get-TempFilePath -Extension 'exe'
curl.exe -L -o $bootstrapperExe -s -S $BootstrapperUrl
Write-Host 'Installing Visual Studio...'
$vsArgs = @('/c', $bootstrapperExe, '--quiet', '--norestart', '--wait', '--nocache')
foreach ($workload in $Workloads) {
$vsArgs += '--add'
$vsArgs += $workload
}
if (-not ([String]::IsNullOrWhiteSpace($InstallPath))) {
$vsArgs += '--installpath'
$vsArgs += $InstallPath
}
if (-not ([String]::IsNullOrWhiteSpace($Nickname))) {
$vsArgs += '--nickname'
$vsArgs += $Nickname
}
$proc = Start-Process -FilePath cmd.exe -ArgumentList $vsArgs -Wait -PassThru
PrintMsiExitCodeMessage $proc.ExitCode
}
catch {
Write-Error "Failed to install Visual Studio! $($_.Exception.Message)"
throw
}
}
InstallVisualStudio -Workloads $Workloads -BootstrapperUrl $VisualStudioBootstrapperUrl -Nickname 'Stable'