-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Add MSVC-internal testing scripts to public GitHub. #13748
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fc0d98f
Initial 'scaffold' to move the 'unstable' queue into the open.
BillyONeal 58951f7
Only enable x64-windows for consistency with the old infrastructure.
BillyONeal 9227189
Add compiler downloading.
BillyONeal 790985f
Merge remote-tracking branch 'origin/master' into dev/bion/unstable-q…
BillyONeal 0e80327
Merge.
BillyONeal 5ba6723
Avoid clobbering queue variables.
BillyONeal 43c4397
Try that again.
BillyONeal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The "unstable" build is used internally by Microsoft to test prerelease versions | ||
of our C++ compiler; not seeing results from these build definitions in the | ||
GitHub portal is normal as these builds depend on acquisition of private | ||
compiler bits that aren't yet shipping. |
11 changes: 11 additions & 0 deletions
11
scripts/azure-pipelines/windows-unstable/azure-pipelines.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: MIT | ||
# | ||
variables: | ||
unstable-pool: 'VcpkgUnstable-2020-09-01' | ||
|
||
jobs: | ||
- template: job.yml | ||
parameters: | ||
triplet: x64-windows | ||
jobName: x64_windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: MIT | ||
# | ||
|
||
jobs: | ||
- job: ${{ parameters.jobName }} | ||
pool: | ||
name: $(unstable-pool) | ||
workspace: | ||
clean: resources | ||
timeoutInMinutes: 1440 # 1 day | ||
variables: | ||
- name: WORKING_ROOT | ||
value: D:\ | ||
- name: VCPKG_DOWNLOADS | ||
value: D:\downloads | ||
|
||
steps: | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: 'Download DropBuildNumber if not specified' | ||
inputs: | ||
buildType: specific | ||
project: '0bdbc590-a062-4c3f-b0f6-9383f67865ee' | ||
pipeline: 8136 | ||
buildVersionToDownload: latestFromBranch | ||
branchName: 'refs/heads/$(MSVCBranchName)' | ||
artifactName: BuildNumber | ||
downloadPath: 'D:\msvc-drops' | ||
condition: eq(variables['DropBuildNumber'], '') | ||
- task: PowerShell@2 | ||
displayName: 'Set DropBuildNumber if not specified' | ||
inputs: | ||
targetType: inline | ||
script: | | ||
$DropBuildNumber = Get-Content -Path D:\msvc-drops\BuildNumber\Build.BuildNumber.txt | ||
Write-Host "##vso[task.setvariable variable=DropBuildNumber]$DropBuildNumber" | ||
Write-Host "Build Number set to: $DropBuildNumber" | ||
pwsh: true | ||
condition: eq(variables['DropBuildNumber'], '') | ||
- task: ms-vscs-artifact.build-tasks.artifactDropDownloadTask-1.artifactDropDownloadTask@0 | ||
displayName: 'Download msvc x86 ret' | ||
inputs: | ||
dropServiceURI: 'https://devdiv.artifacts.visualstudio.com/DefaultCollection' | ||
buildNumber: 'msvc/builds/$(DropBuildNumber)/x86ret' | ||
destinationPath: 'D:\msvc-drops\$(DropBuildNumber)\binaries.x86ret' | ||
- task: ms-vscs-artifact.build-tasks.artifactDropDownloadTask-1.artifactDropDownloadTask@0 | ||
displayName: 'Download msvc amd64 ret' | ||
inputs: | ||
dropServiceURI: 'https://devdiv.artifacts.visualstudio.com/DefaultCollection' | ||
buildNumber: 'msvc/builds/$(DropBuildNumber)/amd64ret' | ||
destinationPath: 'D:\msvc-drops\$(DropBuildNumber)\binaries.amd64ret' | ||
- task: PowerShell@2 | ||
displayName: 'Rearrange MSVC Drop Layout' | ||
inputs: | ||
targetType: filePath | ||
filePath: 'scripts/azure-pipelines/windows-unstable/rearrange-msvc-drop-layout.ps1' | ||
arguments: '-DropRoot "D:\msvc-drops\$(DropBuildNumber)" -BuildType ret' | ||
pwsh: true | ||
- task: PowerShell@2 | ||
displayName: 'Initialize Environment' | ||
inputs: | ||
filePath: 'scripts/azure-pipelines/windows/initialize-environment.ps1' | ||
pwsh: true | ||
- task: PowerShell@2 | ||
displayName: 'Report on Disk Space' | ||
condition: always() | ||
inputs: | ||
filePath: 'scripts/azure-pipelines/windows/disk-space.ps1' | ||
pwsh: true | ||
- script: .\bootstrap-vcpkg.bat | ||
displayName: 'Build vcpkg' | ||
- task: PowerShell@2 | ||
displayName: '*** Test Modified Ports and Prepare Test Logs ***' | ||
inputs: | ||
failOnStderr: true | ||
filePath: 'scripts/azure-pipelines/test-modified-ports.ps1' | ||
arguments: '-Triplet ${{ parameters.triplet }} -BuildReason $(Build.Reason) -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactStagingDirectory $(Build.ArtifactStagingDirectory)' | ||
pwsh: true | ||
- task: PowerShell@2 | ||
displayName: 'Report on Disk Space After Build' | ||
condition: always() | ||
inputs: | ||
filePath: 'scripts/azure-pipelines/windows/disk-space.ps1' | ||
pwsh: true | ||
- task: PublishBuildArtifacts@1 | ||
displayName: 'Publish Artifact: failure logs for ${{ parameters.triplet }}' | ||
inputs: | ||
PathtoPublish: '$(Build.ArtifactStagingDirectory)\failure-logs' | ||
ArtifactName: 'failure logs for ${{ parameters.triplet }}' | ||
condition: failed() |
75 changes: 75 additions & 0 deletions
75
scripts/azure-pipelines/windows-unstable/rearrange-msvc-drop-layout.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: MIT | ||
# | ||
<# | ||
.SYNOPSIS | ||
Moves files from an MSVC compiler drop to the locations where they are installed in a Visual Studio installation. | ||
|
||
.PARAMETER DropRoot | ||
The location where the MSVC compiler drop has been downloaded. | ||
|
||
.PARAMETER BuildType | ||
The MSVC drop build type set with /p:_BuildType when MSVC was built. Defaults to 'ret'. | ||
|
||
#> | ||
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory = $true)][string]$DropRoot, | ||
[Parameter(Mandatory = $false)][ValidateSet('ret', 'chk')][string]$BuildType = 'ret' | ||
) | ||
|
||
Set-StrictMode -Version Latest | ||
|
||
$MSVCRoot = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC" | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
$tempRoot = "$DropRoot\readytodeploy" | ||
|
||
New-Item -ItemType Directory -Path $tempRoot | Out-Null | ||
|
||
Write-Host "Rearranging x86$BuildType" | ||
New-Item -ItemType Directory -Path "$tempRoot\bin\HostX86" | Out-Null | ||
Move-Item "$DropRoot\binaries.x86$BuildType\bin\i386" "$tempRoot\bin\HostX86\x86" | ||
Move-Item "$DropRoot\binaries.x86$BuildType\bin\x86_amd64" "$tempRoot\bin\HostX86\x64" | ||
Move-Item "$DropRoot\binaries.x86$BuildType\bin\x86_arm" "$tempRoot\bin\HostX86\arm" | ||
|
||
Write-Host "Rearranging amd64$BuildType" | ||
New-Item -ItemType Directory -Path "$tempRoot\bin\HostX64" | Out-Null | ||
Move-Item "$DropRoot\binaries.amd64$BuildType\bin\amd64" "$tempRoot\bin\HostX64\x64" | ||
Move-Item "$DropRoot\binaries.amd64$BuildType\bin\amd64_x86" "$tempRoot\bin\HostX64\x86" | ||
Move-Item "$DropRoot\binaries.amd64$BuildType\bin\amd64_arm" "$tempRoot\bin\HostX64\arm" | ||
|
||
# Only copy files and directories that already exist in the VS installation. | ||
Write-Host "Rearranging inc, lib" | ||
New-Item -ItemType Directory -Path "$tempRoot\lib" | Out-Null | ||
Move-Item "$DropRoot\binaries.x86$BuildType\inc" "$tempRoot\include" | ||
Move-Item "$DropRoot\binaries.x86$BuildType\lib\i386" "$tempRoot\lib\x86" | ||
Move-Item "$DropRoot\binaries.amd64$BuildType\lib\amd64" "$tempRoot\lib\x64" | ||
|
||
Write-Host "Rearranging atlmfc" | ||
New-Item -ItemType Directory -Path "$tempRoot\atlmfc" | Out-Null | ||
New-Item -ItemType Directory -Path "$tempRoot\atlmfc\lib" | Out-Null | ||
Move-Item "$DropRoot\binaries.x86$BuildType\atlmfc\include" "$tempRoot\atlmfc\include" | ||
Move-Item "$DropRoot\binaries.x86$BuildType\atlmfc\lib\i386" "$tempRoot\atlmfc\lib\x86" | ||
Move-Item "$DropRoot\binaries.amd64$BuildType\atlmfc\lib\amd64" "$tempRoot\atlmfc\lib\x64" | ||
|
||
$toolsets = Get-ChildItem -Path $MSVCRoot -Directory | Sort-Object -Descending | ||
if ($toolsets.Length -eq 0) { | ||
throw "Could not find Visual Studio toolset!" | ||
} | ||
|
||
Write-Host "Found toolsets:`n$($toolsets -join `"`n`")`n" | ||
$selectedToolset = $toolsets[0] | ||
Write-Host "Using toolset: $selectedToolset" | ||
for ($idx = 1; $idx -lt $toolsets.Length; $idx++) { | ||
$badToolset = $toolsets[$idx] | ||
Write-Host "Deleting toolset: $badToolset" | ||
Remove-Item $badToolset -Recurse -Force | ||
} | ||
|
||
Write-Host "Deploying $tempRoot => $selectedToolset" | ||
Copy-Item "$tempRoot\*" $selectedToolset -Recurse -Force | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does copy followed by delete because it crosses drives |
||
Write-Host "Deleting $DropRoot..." | ||
Remove-Item $DropRoot -Recurse -Force | ||
Write-Host "Done!" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This procedure may not be correct -- if I recall correctly there have been cases where the libs are stored in a differently versioned folder than the compiler.
However, I think it's fine to deal with that if/when it occurs than to worry about it right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this should also be overriding the ones in system32 etc. for maximum correctness but the old infrastructure didn't do that and I'm preserving that here.