Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Unix dependencies installation script #77107

Merged
merged 4 commits into from
Oct 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions eng/install-native-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
#!/bin/sh

set -e

# This is a simple script primarily used for CI to install necessary dependencies
#
Expand All @@ -13,37 +15,35 @@
#
# ./install-native-dependencies.sh <OS>

if [ "$1" = "Linux" ]; then
sudo apt update
if [ "$?" != "0" ]; then
exit 1;
fi
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
if [ "$?" != "0" ]; then
exit 1;
fi
elif [[ "$1" == "MacCatalyst" || "$1" == "OSX" || "$1" == "tvOS" || "$1" == "iOS" ]]; then
engdir=$(dirname "${BASH_SOURCE[0]}")
os="$(echo "$1" | tr "[:upper:]" "[:lower:]")"

if [ -e /etc/os-release ]; then
. /etc/os-release
fi

echo "Installed xcode version: `xcode-select -p`"
if [ "$os" = "linux" ] && { [ "$ID" = "debian" ] || [ "$ID_LIKE" = "debian" ]; }; then
apt update

apt install -y build-essential gettext locales cmake llvm clang lldb liblldb-dev libunwind8-dev libicu-dev liblttng-ust-dev \
libssl-dev libkrb5-dev libnuma-dev

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
am11 marked this conversation as resolved.
Show resolved Hide resolved
elif [ "$os" = "maccatalyst" ] || [ "$os" = "osx" ] || [ "$os" = "macos" ] || [ "$os" = "tvos" ] || [ "$os" = "ios" ]; then
echo "Installed xcode version: $(xcode-select -p)"

if [ "$3" = "azDO" ]; then
# workaround for old osx images on hosted agents
# piped in case we get an agent without these values installed
if ! brew_output="$(brew uninstall openssl@1.0.2t 2>&1 >/dev/null)"; then
if ! brew uninstall openssl@1.0.2t >/dev/null 2>&1; then
am11 marked this conversation as resolved.
Show resolved Hide resolved
echo "didn't uninstall openssl@1.0.2t"
else
echo "successfully uninstalled openssl@1.0.2t"
fi
fi

brew update --preinstall
brew bundle --no-upgrade --no-lock --file "${engdir}/Brewfile"
if [ "$?" != "0" ]; then
exit 1;
fi
brew bundle --no-upgrade --no-lock --file "$(dirname "$0")/Brewfile"
else
echo "Must pass \"Linux\", \"tvOS\", \"iOS\" or \"OSX\" as first argument."
echo "Must pass 'Linux', 'macOS', 'maccatalyst', 'iOS' or 'tvOS' as first argument."
exit 1
fi