Skip to content

Commit 76e521c

Browse files
authored
Install native dependencies on all Apple OS in CI (#82263)
1 parent fc3303d commit 76e521c

File tree

10 files changed

+45
-26
lines changed

10 files changed

+45
-26
lines changed

eng/install-native-dependencies.sh

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,41 @@ set -e
1010

1111
os="$(echo "$1" | tr "[:upper:]" "[:lower:]")"
1212

13-
if [ -e /etc/os-release ]; then
14-
. /etc/os-release
13+
if [ -z "$os" ]; then
14+
. "$(dirname "$0")"/native/init-os-and-arch.sh
1515
fi
1616

17-
if [ "$os" = "linux" ] && { [ "$ID" = "debian" ] || [ "$ID_LIKE" = "debian" ]; }; then
18-
apt update
17+
case "$os" in
18+
linux)
19+
if [ -e /etc/os-release ]; then
20+
. /etc/os-release
21+
fi
1922

20-
apt install -y build-essential gettext locales cmake llvm clang lldb liblldb-dev libunwind8-dev libicu-dev liblttng-ust-dev \
21-
libssl-dev libkrb5-dev libnuma-dev zlib1g-dev
23+
if [ "$ID" != "debian" ] && [ "$ID_LIKE" != "debian" ]; then
24+
echo "Unsupported distro. distro: $ID"
25+
exit 1
26+
fi
2227

23-
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
24-
elif [ "$os" = "maccatalyst" ] || [ "$os" = "osx" ] || [ "$os" = "macos" ] || [ "$os" = "tvos" ] || [ "$os" = "ios" ]; then
25-
echo "Installed xcode version: $(xcode-select -p)"
28+
apt update
2629

27-
export HOMEBREW_NO_INSTALL_CLEANUP=1
28-
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
29-
# Skip brew update for now, see https://github.com/actions/setup-python/issues/577
30-
# brew update --preinstall
31-
brew bundle --no-upgrade --no-lock --file "$(dirname "$0")/Brewfile"
32-
else
33-
echo "Must pass 'linux', 'macos', 'maccatalyst', 'ios' or 'tvos' as first argument."
34-
exit 1
35-
fi
30+
apt install -y build-essential gettext locales cmake llvm clang lldb liblldb-dev libunwind8-dev libicu-dev liblttng-ust-dev \
31+
libssl-dev libkrb5-dev libnuma-dev zlib1g-dev
32+
33+
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
34+
;;
35+
36+
osx|mac*|ios*|tvos*)
37+
echo "Installed xcode version: $(xcode-select -p)"
38+
39+
export HOMEBREW_NO_INSTALL_CLEANUP=1
40+
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
41+
# Skip brew update for now, see https://github.com/actions/setup-python/issues/577
42+
# brew update --preinstall
43+
brew bundle --no-upgrade --no-lock --file "$(dirname "$0")/Brewfile"
44+
;;
45+
46+
*)
47+
echo "Unsupported platform. OS: $os"
48+
exit 1
49+
;;
50+
esac

eng/pipelines/common/global-build-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
runtimeOS: linux
163163
name: ${{ parameters.platform }}
164164

165-
- ${{ if in(parameters.osGroup, 'osx', 'ios', 'tvos', 'maccatalyst') }}:
165+
- ${{ if in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator') }}:
166166
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }}
167167
displayName: Install Build Dependencies
168168

eng/pipelines/common/templates/runtimes/build-test-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
steps:
105105

106106
# Install test build dependencies
107-
- ${{ if eq(parameters.osGroup, 'osx') }}:
107+
- ${{ if in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator') }}:
108108
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
109109
displayName: Install native dependencies
110110

eng/pipelines/coreclr/templates/build-jit-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
# Linux builds use docker images with dependencies preinstalled,
8585
# and FreeBSD builds use a build agent with dependencies
8686
# preinstalled, so we only need this step for OSX and Windows.
87-
- ${{ if eq(parameters.osGroup, 'osx') }}:
87+
- ${{ if in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator') }}:
8888
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
8989
displayName: Install native dependencies (OSX)
9090

eng/pipelines/coreclr/templates/build-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ jobs:
167167
# Linux builds use docker images with dependencies preinstalled,
168168
# and FreeBSD builds use a build agent with dependencies
169169
# preinstalled, so we only need this step for OSX and Windows.
170-
- ${{ if eq(parameters.osGroup, 'osx') }}:
170+
- ${{ if in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator') }}:
171171
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
172172
displayName: Install native dependencies
173173

eng/pipelines/installer/jobs/build-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ jobs:
313313
displayName: 'Libraries artifacts'
314314
cleanUnpackFolder: false
315315

316-
- ${{ if in(parameters.osGroup, 'osx', 'ios', 'tvos') }}:
316+
- ${{ if in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator') }}:
317317
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }}
318318
displayName: Install Build Dependencies
319319

eng/pipelines/libraries/build-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
- ${{ if eq(parameters.isOfficialBuild, true) }}:
8686
- template: /eng/pipelines/common/restore-internal-tools.yml
8787

88-
- ${{ if in(parameters.osGroup, 'osx', 'ios', 'tvos') }}:
88+
- ${{ if in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator') }}:
8989
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }}
9090
displayName: Install Build Dependencies
9191

eng/pipelines/libraries/run-test-job.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ jobs:
8888
artifactFileName: $(librariesTestsArtifactName)$(archiveExtension)
8989
unpackFolder: $(Build.SourcesDirectory)/artifacts
9090

91+
- ${{ if in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator') }}:
92+
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }}
93+
displayName: Install Build Dependencies
94+
9195
- ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
9296
- script: $(_buildScript)
9397
-subset host.native+libs.pretest

eng/pipelines/mono/templates/build-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jobs:
126126
# Linux builds use docker images with dependencies preinstalled,
127127
# and FreeBSD builds use a build agent with dependencies
128128
# preinstalled, so we only need this step for OSX and Windows.
129-
- ${{ if in(parameters.osGroup, 'osx', 'ios', 'tvos') }}:
129+
- ${{ if in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator') }}:
130130
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
131131
displayName: Install native dependencies
132132

eng/pipelines/mono/templates/generate-offsets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
# Linux builds use docker images with dependencies preinstalled,
5757
# and FreeBSD builds use a build agent with dependencies
5858
# preinstalled, so we only need this step for OSX and Windows.
59-
- ${{ if in(parameters.osGroup, 'osx', 'ios', 'tvos') }}:
59+
- ${{ if in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator') }}:
6060
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
6161
displayName: Install native dependencies
6262

0 commit comments

Comments
 (0)