Skip to content

Commit

Permalink
Fix missing MSVC components after actions/runner-images#9701
Browse files Browse the repository at this point in the history
  • Loading branch information
mrobinson committed May 16, 2024
1 parent 00f267e commit 65f6494
Showing 1 changed file with 40 additions and 7 deletions.
47 changes: 40 additions & 7 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,57 @@ jobs:
with:
crate: taplo-cli
locked: true
- name: Install MSVC components
run: |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$componentsToRemove = @(
"Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest"
"Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest"
"Microsoft.VisualStudio.Component.VC.Modules.x86.x64"
"Microsoft.VisualStudio.Component.VC.Redist.MSM"
"Microsoft.VisualStudio.Component.VC.v141.x86.x64"
"Microsoft.VisualStudio.Component.VC.v141.x86.x64.Spectre"
"Microsoft.VisualStudio.Component.VC.v141.MFC"
"Microsoft.VisualStudio.Component.VC.v141.MFC.Spectre"
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64"
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64.Spectre"
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL"
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.Spectre"
"Microsoft.VisualStudio.Component.VC.14.29.16.11.MFC"
"Microsoft.VisualStudio.Component.VC.14.29.16.11.MFC.Spectre"
"Microsoft.VisualStudio.Component.VC.14.38.17.8.ATL"
"Microsoft.VisualStudio.Component.VC.14.38.17.8.ATL.Spectre"
"Microsoft.VisualStudio.Component.VC.14.38.17.8.MFC"
"Microsoft.VisualStudio.Component.VC.14.38.17.8.MFC.Spectre"
"Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64"
"Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64.Spectre"
"Microsoft.VisualStudio.Component.VC.14.39.17.9.ATL"
"Microsoft.VisualStudio.Component.VC.14.39.17.9.ATL.Spectre"
"Microsoft.VisualStudio.Component.VC.14.39.17.9.MFC"
"Microsoft.VisualStudio.Component.VC.14.39.17.9.MFC.Spectre"
"Microsoft.VisualStudio.Component.VC.14.39.17.9.x86.x64"
"Microsoft.VisualStudio.Component.VC.14.39.17.9.x86.x64.Spectre"
)
[string]$workloadArgs = $componentsToRemove | ForEach-Object {" --add " + $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
# should be run twice
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
- name: Install wixtoolset
run: |
choco install wixtoolset
echo "C:\\Program Files (x86)\\WiX Toolset v3.11\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# For some reason WiX isn't currently on the GitHub runner path. This is a
# temporary workaround until that is fixed.
"$env:WIX\bin" >> $env:GITHUB_PATH
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Bootstrap
run: |
python -m pip install --upgrade pip
python mach fetch
python mach bootstrap-gstreamer
cargo install --path support/crown
# For some reason WiX isn't currently on the GitHub runner path. This is a
# temporary workaround until that is fixed.
- name: Add WiX to Path
run: |
"$env:WIX\bin" >> $env:GITHUB_PATH
- name: Build (${{ inputs.profile }})
run: |
python mach build --locked --${{ inputs.profile }}
Expand Down

0 comments on commit 65f6494

Please sign in to comment.