Skip to content
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

Revert win2022 image back to latest and add msvc version mitigation #5539

Merged
merged 25 commits into from
Apr 18, 2024
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
2 changes: 2 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"AMQPS",
"amqpvalue",
"AMQPVALUE",
"ATLMFC",
"australiacentral",
"australiaeast",
"authcid",
Expand Down Expand Up @@ -206,6 +207,7 @@
"Ragrs",
"Ragzrs",
"Reconnector",
"Redist",
"rehydrated",
"Reitz",
"retriable",
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ jobs:
workingDirectory: $(Agent.TempDirectory)
displayName: Download and Install Doxygen

- template: /eng/pipelines/templates/steps/install-cmake.yml

- template: /eng/pipelines/templates/steps/setup-msvc.yml

- template: /eng/pipelines/templates/steps/vcpkg.yml

- template: /eng/pipelines/templates/steps/cmake-build.yml
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/templates/jobs/ci.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ jobs:

- template: /eng/pipelines/templates/steps/fix-1es-image-apt-azure-sources.yml

- template: /eng/pipelines/templates/steps/setup-msvc.yml

- template: /eng/pipelines/templates/steps/install-cmake.yml

- pwsh: sudo apt update && sudo apt install -y $(AptDependencies)
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/templates/jobs/cmake-generate.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ jobs:

- template: /eng/pipelines/templates/steps/fix-1es-image-apt-azure-sources.yml

- template: /eng/pipelines/templates/steps/setup-msvc.yml

- template: /eng/pipelines/templates/steps/install-cmake.yml

- pwsh: sudo apt update && sudo apt install -y $(AptDependencies)
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/templates/jobs/live.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ jobs:

- template: /eng/pipelines/templates/steps/fix-1es-image-apt-azure-sources.yml

- template: /eng/pipelines/templates/steps/setup-msvc.yml

- template: /eng/pipelines/templates/steps/install-cmake.yml

# Add g++5 repo to ubuntu
Expand Down
17 changes: 5 additions & 12 deletions eng/pipelines/templates/steps/install-cmake.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This temporary fix resolves an issue with CMake and vcpkg. When Linux and
# Windows agents have a later version of CMake installed this can be removed.

parameters:
Version: '3.29.2'

Expand All @@ -9,21 +12,11 @@ steps:
&& sudo ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \
&& sudo rm cmakeinstall.sh
displayName: Install Cmake ${{ parameters.Version }} (Linux)
condition: eq(variables['Agent.OS'], 'Linux')
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))

- pwsh: |
$tempFile = New-TemporaryFile;
systeminfo.exe /fo csv > $tempFile
$osName = (Import-Csv $tempFile).'OS Name'

Write-Host "OS Name: $osName"
if (!($osName -like '*2019*')) {
Write-Host "OS is not Windows Server 2019, skipping CMake installation"
exit 0
}

Write-Host "Installing CMake ${{ parameters.Version }}"
Invoke-WebRequest -Uri https://github.com/Kitware/CMake/releases/download/v${{ parameters.Version }}/cmake-${{ parameters.Version }}-windows-x86_64.msi -OutFile cmake.msi
msiexec.exe /i cmake.msi | Wait-Process
displayName: Install Cmake ${{ parameters.Version }} (Windows)
condition: eq(variables['Agent.OS'], 'Windows_NT')
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
21 changes: 21 additions & 0 deletions eng/pipelines/templates/steps/setup-msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This temporary fix resolves an issue on Win2022 machines that have multiple
# MSVC versions installed side-by-side. When this issue is resolved, remove this
# template and references:
# https://github.com/actions/runner-images/issues/9701

steps:
- pwsh: |
$tempFile = New-TemporaryFile;
systeminfo.exe /fo csv > $tempFile
$osName = (Import-Csv $tempFile).'OS Name'

Write-Host "OS Name: $osName"
if (!($osName -like '*2022*')) {
Write-Host "OS is not Windows Server 2022, skipping MSVC changes"
exit 0
}

Remove-item 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\Microsoft.VCToolsVersion.v143.default.*' -Force
Get-ChildItem 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\' -Name | Write-Host
displayName: Setup MSVC
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
2 changes: 1 addition & 1 deletion eng/pipelines/templates/variables/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ variables:
- name: LINUXNEXTVMIMAGE
value: azsdk-pool-mms-ubuntu-2204-1espt
- name: WINDOWSVMIMAGE
value: 1espt-win-2022-cpp-rollback
value: azsdk-pool-mms-win-2022-1espt
- name: WINDOWSPREVIOUSVMIMAGE
value: azsdk-pool-mms-win-2019-1espt
- name: MACVMIMAGE
Expand Down