Skip to content

Commit 3837c2a

Browse files
am11akoeplinger
andauthored
Update Unix dependencies installation script (#77107)
* Update Unix dependencies installation script * Add missing libz-dev * Use zlib1g-dev instead of libz-dev Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com> * Remove obsolete arguments Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
1 parent 7ac397e commit 3837c2a

File tree

9 files changed

+29
-46
lines changed

9 files changed

+29
-46
lines changed

eng/install-native-dependencies.sh

Lines changed: 21 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,32 @@
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 "successfully uninstalled openssl@1.0.2t"
37-
fi
38-
fi
11+
os="$(echo "$1" | tr "[:upper:]" "[:lower:]")"
12+
13+
if [ -e /etc/os-release ]; then
14+
. /etc/os-release
15+
fi
16+
17+
if [ "$os" = "linux" ] && { [ "$ID" = "debian" ] || [ "$ID_LIKE" = "debian" ]; }; then
18+
apt update
19+
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
22+
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)"
3926

4027
brew update --preinstall
41-
brew bundle --no-upgrade --no-lock --file "${engdir}/Brewfile"
42-
if [ "$?" != "0" ]; then
43-
exit 1;
44-
fi
28+
brew bundle --no-upgrade --no-lock --file "$(dirname "$0")/Brewfile"
4529
else
46-
echo "Must pass \"Linux\", \"tvOS\", \"iOS\" or \"OSX\" as first argument."
30+
echo "Must pass 'Linux', 'macOS', 'maccatalyst', 'iOS' or 'tvOS' as first argument."
4731
exit 1
4832
fi
49-

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
name: ${{ parameters.platform }}
148148

149149
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS', 'MacCatalyst') }}:
150-
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO
150+
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }}
151151
displayName: Install Build Dependencies
152152

153153
- script: |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111

112112
# Install test build dependencies
113113
- ${{ if eq(parameters.osGroup, 'OSX') }}:
114-
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
114+
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
115115
displayName: Install native dependencies
116116

117117
# Build core/libraries dependencies of test build

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
# and FreeBSD builds use a build agent with dependencies
8686
# preinstalled, so we only need this step for OSX and Windows.
8787
- ${{ if eq(parameters.osGroup, 'OSX') }}:
88-
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
88+
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
8989
displayName: Install native dependencies (OSX)
9090

9191
# Install internal tools on official builds

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ jobs:
159159
# and FreeBSD builds use a build agent with dependencies
160160
# preinstalled, so we only need this step for OSX and Windows.
161161
- ${{ if eq(parameters.osGroup, 'OSX') }}:
162-
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
162+
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
163163
displayName: Install native dependencies
164164

165165
# Install internal tools on official builds

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ jobs:
310310
cleanUnpackFolder: false
311311

312312
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}:
313-
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO
313+
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }}
314314
displayName: Install Build Dependencies
315315

316316
- script: |

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
- template: /eng/pipelines/common/restore-internal-tools.yml
8787

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

9292
- script: |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
# and FreeBSD builds use a build agent with dependencies
123123
# preinstalled, so we only need this step for OSX and Windows.
124124
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}:
125-
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
125+
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
126126
displayName: Install native dependencies
127127

128128
- ${{ each monoCrossAOTTargetOS in parameters.monoCrossAOTTargetOS }}:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
# and FreeBSD builds use a build agent with dependencies
5858
# preinstalled, so we only need this step for OSX and Windows.
5959
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}:
60-
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
60+
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
6161
displayName: Install native dependencies
6262

6363
# Build

0 commit comments

Comments
 (0)