actions / runner-images

GitHub Actions runner images
MIT License
10.1k stars 3.04k forks source link

Xamarin workload is missing or not installed in windows-2022 20220814.1 #6082

Closed jeromelaban closed 2 years ago

jeromelaban commented 2 years ago

Description

Building a xamarin.ios library using windows-2022 20220814.1 results in failures such as this one:

C:\Users\VssAdministrator\.nuget\packages\msbuild.sdk.extras\3.0.23\Build\LanguageTargets\CheckMissing.targets(44,5): error : The specified language targets for xamarinios10 is missing. Ensure correct tooling is installed for 'xamarinios'. Missing: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.CSharp.targets' [D:\a\1\s\src\library\Uno.Material\Uno.Material.csproj]

Curiously, the image is supposed to have it installed with Component.Xamarin, but in general installing VS 17.3 on a desktop does not install it by default. It could be related.

Platforms affected

Virtual environments affected

Image version and build link

20220814.1

Is it regression?

yes, it worked with the previous agents builds

Expected behavior

Builds are completing properly

Actual behavior

C:\Users\VssAdministrator\.nuget\packages\msbuild.sdk.extras\3.0.23\Build\LanguageTargets\CheckMissing.targets(44,5): error : The specified language targets for xamarinios10 is missing. Ensure correct tooling is installed for 'xamarinios'. Missing: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.CSharp.targets' [D:\a\1\s\src\library\Uno.Material\Uno.Material.csproj]

Repro steps

Build any Xamarin library.

al-cheb commented 2 years ago

Hey @jeromelaban. We have been starting a new image rollout and this component is not pre-installed by default - https://github.com/actions/runner-images/pull/6078. I will add it back.

al-cheb commented 2 years ago

As a temporary workaround, this component can be installed in runtime:

- run: |
          Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
          $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
          $componentsToAdd = @(
            "Component.Xamarin"
          )
          [string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " +  $_}
          $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
          $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
          if ($process.ExitCode -eq 0)
          {
              Write-Host "components have been successfully added"
          }
          else
          {
              Write-Host "components were not installed"
              exit 1
          }
jeromelaban commented 2 years ago

Thanks for the workaround, I'll keep it handy in case this happens in the future :) Also as an FYI, a rollback has been made and builds are running on 20220808.1.

jeromelaban commented 2 years ago

Update again, it looks like the rollback was rollbacked and I'm back on 20220814.1.

WilliamWatterson86 commented 2 years ago

Having the same issue here. Do we think this one will be fixed soon? Workaround seems to work ok for me at the minute

al-cheb commented 2 years ago

@WilliamWatterson86 , we are planning to start a new image rollout on Monday.

jeromelaban commented 2 years ago

Also, as a note, testing is difficult because agents are balanced between 20220814.1 and 20220808.1, making builds pass or fail randomly.

WilliamWatterson86 commented 2 years ago

Actually the workaround didnt work for me, it got past the nuget restore step (which was the one failing previously), but this time it fails with an AOT error. Build works fine when it uses agent with version 20220808.1. Is there any way to force my pipeline to use this agent version?

drmikesell commented 2 years ago

Agreed, if we could force using 20220808.1, it would solve a lot of headaches. Waiting until Monday is sub-optimal.

al-cheb commented 2 years ago

We have been starting a new image rollout - https://github.com/actions/runner-images/pull/6102. I hope this helps.

drmikesell commented 2 years ago

@al-cheb Thanks for addressing this quickly, it's very much appreciated.

al-cheb commented 2 years ago

@jeromelaban, The new image with Component.Xamarin has been deployed.