Skip to content

Commit

Permalink
[devops] Install .NET before trying to install simulators.
Browse files Browse the repository at this point in the history
Because installing simulators means running a C# project, which requires .NET to build.

Also improve the .NET version check systemdependencies.sh to not blindly try
to execute `dotnet`, but check for its presence first.

This fixes a couple of issues on bots that don't have .NET installed.
  • Loading branch information
rolfbjarne committed Mar 3, 2025
1 parent f6c6aba commit 00a9909
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 6 additions & 2 deletions system-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -964,8 +964,12 @@ check_7z
check_objective_sharpie
check_old_simulators
if test -z "$IGNORE_DOTNET"; then
ok "Installed .NET SDKs:"
(IFS=$'\n'; for i in $(/usr/local/share/dotnet/dotnet --list-sdks); do log "$i"; done)
if test -f /usr/local/share/dotnet/dotnet; then
ok "Installed .NET SDKs:"
(IFS=$'\n'; for i in $(/usr/local/share/dotnet/dotnet --list-sdks); do log "$i"; done)
else
warn ".NET is not installed"
fi
fi

if test -z $FAIL; then
Expand Down
4 changes: 4 additions & 0 deletions tools/devops/automation/templates/tests/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ steps:
github_token: ${{ parameters.gitHubToken }}
timeoutInMinutes: 250

- task: UseDotNet@2
inputs:
version: 9.x

- bash: |
set -x
set -e
Expand Down
4 changes: 4 additions & 0 deletions tools/devops/automation/templates/windows/reserve-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ steps:
github_token: ${{ parameters.gitHubToken }}
timeoutInMinutes: 250

- task: UseDotNet@2
inputs:
version: 9.x

- bash: $(Build.SourcesDirectory)/$(BUILD_REPOSITORY_TITLE)/system-dependencies.sh --ignore-mono --ignore-visual-studio --ignore-mono --ignore-sharpie --ignore-shellcheck --ignore-yamllint --provision-simulators
displayName: 'Provision simulators'
timeoutInMinutes: 250
Expand Down

0 comments on commit 00a9909

Please sign in to comment.