Skip to content

Commit b4f44f7

Browse files
authored
Install native dependencies on all Apple OS in CI (#82322)
1 parent 00c6ced commit b4f44f7

File tree

10 files changed

+55
-52
lines changed

10 files changed

+55
-52
lines changed

eng/install-native-dependencies.sh

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,51 @@
1-
#!/usr/bin/env bash
1+
#!/bin/sh
2+
3+
set -e
24

35
# This is a simple script primarily used for CI to install necessary dependencies
46
#
5-
# For CI typical usage is
6-
#
7-
# ./install-native-dependencies.sh <OS> <arch> azDO
8-
#
9-
# For developer use it is not recommended to include the azDO final argument as that
10-
# makes installation and configuration setting only required for azDO
11-
#
12-
# So simple developer usage would currently be
7+
# Usage:
138
#
149
# ./install-native-dependencies.sh <OS>
1510

16-
if [ "$1" = "Linux" ]; then
17-
sudo apt update
18-
if [ "$?" != "0" ]; then
19-
exit 1;
20-
fi
21-
sudo apt install cmake llvm-3.9 clang-3.9 lldb-3.9 liblldb-3.9-dev libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4-openssl-dev libssl-dev libkrb5-dev libnuma-dev build-essential
22-
if [ "$?" != "0" ]; then
23-
exit 1;
24-
fi
25-
elif [ "$1" = "MacCatalyst" ] || [ "$1" = "OSX" ] || [ "$1" = "tvOS" ] || [ "$1" = "iOS" ]; then
26-
engdir=$(dirname "${BASH_SOURCE[0]}")
27-
28-
echo "Installed xcode version: `xcode-select -p`"
29-
30-
if [ "$3" = "azDO" ]; then
31-
# workaround for old osx images on hosted agents
32-
# piped in case we get an agent without these values installed
33-
if ! brew_output="$(brew uninstall openssl@1.0.2t 2>&1 >/dev/null)"; then
34-
echo "didn't uninstall openssl@1.0.2t"
35-
else
36-
echo "succesfully uninstalled openssl@1.0.2t"
37-
fi
38-
fi
39-
40-
export HOMEBREW_NO_INSTALL_CLEANUP=1
41-
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
42-
# Skip brew update for now, see https://github.com/actions/setup-python/issues/577
43-
# brew update --preinstall
44-
brew bundle --no-upgrade --no-lock --file "${engdir}/Brewfile"
45-
if [ "$?" != "0" ]; then
46-
exit 1;
47-
fi
48-
else
49-
echo "Must pass \"Linux\", \"tvOS\", \"iOS\" or \"OSX\" as first argument."
50-
exit 1
11+
os="$(echo "$1" | tr "[:upper:]" "[:lower:]")"
12+
13+
if [ -z "$os" ]; then
14+
. "$(dirname "$0")"/native/init-os-and-arch.sh
15+
os="$(echo "$os" | tr "[:upper:]" "[:lower:]")"
5116
fi
5217

18+
case "$os" in
19+
linux)
20+
if [ -e /etc/os-release ]; then
21+
. /etc/os-release
22+
fi
23+
24+
if [ "$ID" != "debian" ] && [ "$ID_LIKE" != "debian" ]; then
25+
echo "Unsupported distro. distro: $ID"
26+
exit 1
27+
fi
28+
29+
apt update
30+
31+
apt install -y build-essential gettext locales cmake llvm clang lldb liblldb-dev libunwind8-dev libicu-dev liblttng-ust-dev \
32+
libssl-dev libkrb5-dev libnuma-dev zlib1g-dev
33+
34+
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
35+
;;
36+
37+
osx|mac*|ios*|tvos*)
38+
echo "Installed xcode version: $(xcode-select -p)"
39+
40+
export HOMEBREW_NO_INSTALL_CLEANUP=1
41+
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
42+
# Skip brew update for now, see https://github.com/actions/setup-python/issues/577
43+
# brew update --preinstall
44+
brew bundle --no-upgrade --no-lock --file "$(dirname "$0")/Brewfile"
45+
;;
46+
47+
*)
48+
echo "Unsupported platform. OS: $os"
49+
exit 1
50+
;;
51+
esac

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
targetRID: banana.24-x64
154154
runtimeOS: linux
155155

156-
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS', 'MacCatalyst') }}:
156+
- ${{ if in(parameters.osGroup, 'OSX', 'MacCatalyst', 'iOS', 'iOSSimulator', 'tvOS', 'tvOSSimulator') }}:
157157
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO
158158
displayName: Install Build Dependencies
159159

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
steps:
109109

110110
# Install test build dependencies
111-
- ${{ if eq(parameters.osGroup, 'OSX') }}:
111+
- ${{ if in(parameters.osGroup, 'OSX', 'MacCatalyst', 'iOS', 'iOSSimulator', 'tvOS', 'tvOSSimulator') }}:
112112
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
113113
displayName: Install native dependencies
114114
- ${{ if eq(parameters.osGroup, 'windows') }}:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
# Linux builds use docker images with dependencies preinstalled,
8787
# and FreeBSD builds use a build agent with dependencies
8888
# preinstalled, so we only need this step for OSX and Windows.
89-
- ${{ if eq(parameters.osGroup, 'OSX') }}:
89+
- ${{ if in(parameters.osGroup, 'OSX', 'MacCatalyst', 'iOS', 'iOSSimulator', 'tvOS', 'tvOSSimulator') }}:
9090
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
9191
displayName: Install native dependencies (OSX)
9292
- ${{ if eq(parameters.osGroup, 'windows') }}:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
# Linux builds use docker images with dependencies preinstalled,
152152
# and FreeBSD builds use a build agent with dependencies
153153
# preinstalled, so we only need this step for OSX and Windows.
154-
- ${{ if eq(parameters.osGroup, 'OSX') }}:
154+
- ${{ if in(parameters.osGroup, 'OSX', 'MacCatalyst', 'iOS', 'iOSSimulator', 'tvOS', 'tvOSSimulator') }}:
155155
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
156156
displayName: Install native dependencies
157157
- ${{ if eq(parameters.osGroup, 'windows') }}:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ jobs:
382382
displayName: 'Libraries artifacts'
383383
cleanUnpackFolder: false
384384

385-
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}:
385+
- ${{ if in(parameters.osGroup, 'OSX', 'MacCatalyst', 'iOS', 'iOSSimulator', 'tvOS', 'tvOSSimulator') }}:
386386
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO
387387
displayName: Install Build Dependencies
388388

eng/pipelines/libraries/build-job.yml

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

89-
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}:
89+
- ${{ if in(parameters.osGroup, 'OSX', 'MacCatalyst', 'iOS', 'iOSSimulator', 'tvOS', 'tvOSSimulator') }}:
9090
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO
9191
displayName: Install Build Dependencies
9292

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

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

101+
- ${{ if in(parameters.osGroup, 'OSX', 'MacCatalyst', 'iOS', 'iOSSimulator', 'tvOS', 'tvOSSimulator') }}:
102+
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }}
103+
displayName: Install Build Dependencies
104+
101105
- ${{ if in(parameters.coreclrTestGroup, 'gcstress0x3-gcstress0xc', 'gcstress-extra') }}:
102106
# We need to find and download the GC stress dependencies (namely, coredistools). Put them
103107
# in the 'sharedFramework' directory where we unpacked the CoreCLR build artifacts. The 'sharedFramework'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
# Linux builds use docker images with dependencies preinstalled,
124124
# and FreeBSD builds use a build agent with dependencies
125125
# preinstalled, so we only need this step for OSX and Windows.
126-
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}:
126+
- ${{ if in(parameters.osGroup, 'OSX', 'MacCatalyst', 'iOS', 'iOSSimulator', 'tvOS', 'tvOSSimulator') }}:
127127
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
128128
displayName: Install native dependencies
129129
- ${{ if eq(parameters.osGroup, 'windows') }}:

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) ${{ parameters.archType }} azDO
6161
displayName: Install native dependencies
6262
- ${{ if eq(parameters.osGroup, 'windows') }}:

0 commit comments

Comments
 (0)