Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions eng/collect_vsinfo.ps1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
<#
.PARAMETER ArchiveRunName
Name of the run for vs logs

.NOTES
Returns 0 if succeeds, 1 otherwise
#>
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $ArchiveRunName
)

. $PSScriptRoot/common/tools.ps1

$ProgressPreference = "SilentlyContinue"
$LogDir = Join-Path $LogDir $ArchiveRunName
mkdir $LogDir

$vscollect_uri="http://aka.ms/vscollect.exe"
$vscollect="$env:TEMP\vscollect.exe"

if (-not (Test-Path $vscollect)) {
Retry({
Write-Host "GET $vscollect_uri"
Invoke-WebRequest $vscollect_uri -OutFile $vscollect -UseBasicParsing
})

if (-not (Test-Path $vscollect)) {
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Unable to download vscollect."
exit 1
}
}

&"$vscollect"
Move-Item $env:TEMP\vslogs.zip "$LogDir"

$vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
if (-not (Test-Path -Path "$vswhere" -PathType Leaf))
{
Write-Error "Couldn't locate vswhere at $vswhere"
exit 1
}

&"$vswhere" -all -prerelease -products * | Tee-Object -FilePath "$LogDir\vs_where.log"

$vsdir = &"$vswhere" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath

if (-not (Test-Path $vsdir))
{
$procDumpDir = Join-Path $ToolsDir "procdump"
$procDumpToolPath = Join-Path $procDumpDir "procdump.exe"
$procdump_uri = "https://download.sysinternals.com/files/Procdump.zip"

if (-not (Test-Path $procDumpToolPath)) {
Retry({
Write-Host "GET $procdump_uri"
Invoke-WebRequest $procdump_uri -OutFile "$TempDir\Procdump.zip" -UseBasicParsing
})

Expand-Archive -Path "$TempDir\Procdump.zip" $procDumpDir
}

&"$procDumpToolPath" -ma -accepteula VSIXAutoUpdate.exe "$LogDir"
}
23 changes: 23 additions & 0 deletions eng/disable_vsupdate.ps1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
schtasks /change /tn "\Microsoft\VisualStudio\VSIX Auto Update" /disable

$vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
if (-not (Test-Path -Path "$vswhere" -PathType Leaf))
{
Write-Error "Couldn't locate vswhere at $vswhere"
exit 1
}

$vsdir = &"$vswhere" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
$vsregedit = "$vsdir\Common7\IDE\VsRegEdit.exe"

if (-not (Test-Path -Path "$vsregedit" ))
{
Write-Error "VSWhere returned path: $vsdir, but regedit $vsregedit doesn't exist."
exit 1
}

Write-Output "VSWhere returned path: $vsdir, using regedit $vsregedit"
Write-Output "Disabling updates through VS Registry:"

&"$vsdir\Common7\IDE\VsRegEdit.exe" set local HKCU ExtensionManager AutomaticallyCheckForUpdates2Override dword 0
&"$vsdir\Common7\IDE\VsRegEdit.exe" read local HKCU ExtensionManager AutomaticallyCheckForUpdates2Override dword
6 changes: 6 additions & 0 deletions eng/native/init-vs-env.cmd
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,6 +26,8 @@ if defined VisualStudioVersion goto :VSDetected
set "__VSWhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
set "__VSCOMNTOOLS="

if not exist "%__VSWhere%" goto :VSWhereMissing

if exist "%__VSWhere%" (
for /f "tokens=*" %%p in (
'"%__VSWhere%" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath'
Expand DownExpand Up@@ -56,6 +58,10 @@ echo %__MsgPrefix%Error: Visual Studio 2022 with C++ tools required. ^
Please see https://github.com/dotnet/runtime/blob/main/docs/workflow/requirements/windows-requirements.md for build requirements.
exit /b 1

:VSWhereMissing
echo %__MsgPrefix%Error: vswhere couldn not be found in Visual Studio Installer directory at "%__VSWhere%"
exit /b 1

:SetVCEnvironment

if "%__VCBuildArch%"=="" exit /b 0
Expand Down
33 changes: 33 additions & 0 deletions eng/pipelines/common/global-build-job.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,6 +144,34 @@ jobs:
- ${{ each variable in parameters.variables }}:
- ${{ variable }}
steps:
- ${{ if eq(parameters.osGroup, 'windows') }}:
- powershell: |
schtasks /change /tn "\Microsoft\VisualStudio\VSIX Auto Update" /disable

$vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
if (-not (Test-Path -Path "$vswhere" -PathType Leaf))
{
Write-Error "Couldn't locate vswhere at $vswhere"
exit 1
}

$vsdir = &"$vswhere" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
$vsregedit = "$vsdir\Common7\IDE\VsRegEdit.exe"

if (-not (Test-Path -Path "$vsregedit" ))
{
Write-Error "VSWhere returned path: $vsdir, but regedit $vsregedit doesn't exist."
exit 1
}

Write-Output "VSWhere returned path: $vsdir, using regedit $vsregedit"
Write-Output "Disabling updates through VS Registry:"

&"$vsdir\Common7\IDE\VsRegEdit.exe" set local HKCU ExtensionManager AutomaticallyCheckForUpdates2Override dword 0
&"$vsdir\Common7\IDE\VsRegEdit.exe" read local HKCU ExtensionManager AutomaticallyCheckForUpdates2Override dword
displayName: Disable VSIX updates
condition: always()

- checkout: self
clean: true
fetchDepth: $(checkoutFetchDepth)
Expand DownExpand Up@@ -229,6 +257,11 @@ jobs:
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
${{ insert }}: ${{ parameters.extraStepsParameters }}

- ${{ if and(eq(parameters.isOfficialBuild, true), eq(parameters.osGroup, 'windows')) }}:
- powershell: ./eng/collect_vsinfo.ps1 -ArchiveRunName postbuild_log
displayName: Collect vslogs on exit
condition: always()

- task: PublishBuildArtifacts@1
displayName: Publish Logs
inputs:
Expand Down
28 changes: 28 additions & 0 deletions eng/pipelines/common/templates/runtimes/xplat-job.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -106,6 +106,34 @@ jobs:
- ${{insert}}: ${{ variable }}

steps:
- ${{ if eq(parameters.osGroup, 'windows') }}:
- powershell: |
schtasks /change /tn "\Microsoft\VisualStudio\VSIX Auto Update" /disable

$vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
if (-not (Test-Path -Path "$vswhere" -PathType Leaf))
{
Write-Error "Couldn't locate vswhere at $vswhere"
exit 1
}

$vsdir = &"$vswhere" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
$vsregedit = "$vsdir\Common7\IDE\VsRegEdit.exe"

if (-not (Test-Path -Path "$vsregedit" ))
{
Write-Error "VSWhere returned path: $vsdir, but regedit $vsregedit doesn't exist."
exit 1
}

Write-Output "VSWhere returned path: $vsdir, using regedit $vsregedit"
Write-Output "Disabling updates through VS Registry:"

&"$vsdir\Common7\IDE\VsRegEdit.exe" set local HKCU ExtensionManager AutomaticallyCheckForUpdates2Override dword 0
&"$vsdir\Common7\IDE\VsRegEdit.exe" read local HKCU ExtensionManager AutomaticallyCheckForUpdates2Override dword
displayName: Disable VSIX updates
condition: always()

- checkout: self
clean: true
fetchDepth: $(checkoutFetchDepth)
Expand Down
7 changes: 6 additions & 1 deletion eng/pipelines/coreclr/templates/build-job.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -126,7 +126,6 @@ jobs:
- ${{ parameters.variables }}

steps:

# Install native dependencies
# Linux builds use docker images with dependencies preinstalled,
# and FreeBSD builds use a build agent with dependencies
Expand DownExpand Up@@ -275,6 +274,12 @@ jobs:
parameters:
name: ${{ parameters.platform }}

- ${{ if and(eq(parameters.isOfficialBuild, true), eq(parameters.osGroup, 'windows')) }}:
- powershell: ./eng/collect_vsinfo.ps1 -ArchiveRunName postbuild_log
displayName: Collect vslogs on exit
condition: always()


# Publish Logs
- task: PublishPipelineArtifact@1
displayName: Publish Logs
Expand Down
33 changes: 33 additions & 0 deletions eng/pipelines/installer/jobs/build-job.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -301,6 +301,33 @@ jobs:
parameters.archType,
parameters.liveLibrariesBuildConfig) }}
steps:
- ${{ if eq(parameters.osGroup, 'windows') }}:
- powershell: |
schtasks /change /tn "\Microsoft\VisualStudio\VSIX Auto Update" /disable

$vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
if (-not (Test-Path -Path "$vswhere" -PathType Leaf))
{
Write-Error "Couldn't locate vswhere at $vswhere"
exit 1
}

$vsdir = &"$vswhere" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
$vsregedit = "$vsdir\Common7\IDE\VsRegEdit.exe"

if (-not (Test-Path -Path "$vsregedit" ))
{
Write-Error "VSWhere returned path: $vsdir, but regedit $vsregedit doesn't exist."
exit 1
}

Write-Output "VSWhere returned path: $vsdir, using regedit $vsregedit"
Write-Output "Disabling updates through VS Registry:"

&"$vsdir\Common7\IDE\VsRegEdit.exe" set local HKCU ExtensionManager AutomaticallyCheckForUpdates2Override dword 0
&"$vsdir\Common7\IDE\VsRegEdit.exe" read local HKCU ExtensionManager AutomaticallyCheckForUpdates2Override dword
displayName: Disable VSIX updates
condition: always()
- checkout: self
clean: true
fetchDepth: $(checkoutFetchDepth)
Expand DownExpand Up@@ -376,6 +403,12 @@ jobs:
displayName: Build and Package
continueOnError: ${{ and(eq(variables.SkipTests, false), eq(parameters.shouldContinueOnError, true)) }}

- ${{ if and(eq(parameters.isOfficialBuild, true), eq(parameters.osGroup, 'windows')) }}:
- powershell: ./eng/collect_vsinfo.ps1 -ArchiveRunName postbuild_log
displayName: Collect vslogs on exit
condition: always()


- ${{ if in(parameters.osGroup, 'osx', 'ios', 'tvos') }}:
- script: |
du -sh $(Build.SourcesDirectory)/*
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/mono/templates/build-job.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -171,6 +171,10 @@ jobs:
- script: build$(scriptExt) -subset mono+clr.hosts -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) -pack $(OutputRidArg)
displayName: Build nupkg

- ${{ if and(eq(parameters.isOfficialBuild, true), eq(parameters.osGroup, 'windows')) }}:
- powershell: ./eng/collect_vsinfo.ps1 -ArchiveRunName postbuild_log
displayName: Collect vslogs on exit
condition: always()
# Publish Logs
- task: PublishPipelineArtifact@1
displayName: Publish Logs
Expand Down