From e93c117fdd70470b4c4898ddfbac43c46d7495be Mon Sep 17 00:00:00 2001 From: Adeel <3840695+am11@users.noreply.github.com> Date: Mon, 17 Oct 2022 05:28:41 +0300 Subject: [PATCH 1/4] Update Unix dependencies installation script --- eng/install-native-dependencies.sh | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/eng/install-native-dependencies.sh b/eng/install-native-dependencies.sh index bc9b2036d0563..6d62c8f143b40 100755 --- a/eng/install-native-dependencies.sh +++ b/eng/install-native-dependencies.sh @@ -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 # @@ -13,24 +15,26 @@ # # ./install-native-dependencies.sh -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 +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 echo "didn't uninstall openssl@1.0.2t" else echo "successfully uninstalled openssl@1.0.2t" @@ -38,12 +42,8 @@ elif [[ "$1" == "MacCatalyst" || "$1" == "OSX" || "$1" == "tvOS" || "$1" == "iOS 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 - From 24d4402adce52d4839d9fdfe125091bec2306928 Mon Sep 17 00:00:00 2001 From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Mon, 17 Oct 2022 11:53:44 +0300 Subject: [PATCH 2/4] Add missing libz-dev --- eng/install-native-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/install-native-dependencies.sh b/eng/install-native-dependencies.sh index 6d62c8f143b40..876ee8001c229 100755 --- a/eng/install-native-dependencies.sh +++ b/eng/install-native-dependencies.sh @@ -25,7 +25,7 @@ if [ "$os" = "linux" ] && { [ "$ID" = "debian" ] || [ "$ID_LIKE" = "debian" ]; } 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 + libssl-dev libkrb5-dev libnuma-dev libz-dev localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 elif [ "$os" = "maccatalyst" ] || [ "$os" = "osx" ] || [ "$os" = "macos" ] || [ "$os" = "tvos" ] || [ "$os" = "ios" ]; then From 9995b36b689857394f708af8b36fde6381a5498f Mon Sep 17 00:00:00 2001 From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Mon, 17 Oct 2022 13:30:28 +0300 Subject: [PATCH 3/4] Use zlib1g-dev instead of libz-dev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Köplinger --- eng/install-native-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/install-native-dependencies.sh b/eng/install-native-dependencies.sh index 876ee8001c229..62cb2d76e5c03 100755 --- a/eng/install-native-dependencies.sh +++ b/eng/install-native-dependencies.sh @@ -25,7 +25,7 @@ if [ "$os" = "linux" ] && { [ "$ID" = "debian" ] || [ "$ID_LIKE" = "debian" ]; } 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 libz-dev + libssl-dev libkrb5-dev libnuma-dev zlib1g-dev localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 elif [ "$os" = "maccatalyst" ] || [ "$os" = "osx" ] || [ "$os" = "macos" ] || [ "$os" = "tvos" ] || [ "$os" = "ios" ]; then From 0611b81cc2d49d852a3dd27893286d6c1d80a381 Mon Sep 17 00:00:00 2001 From: Adeel <3840695+am11@users.noreply.github.com> Date: Tue, 18 Oct 2022 08:01:35 +0300 Subject: [PATCH 4/4] Remove obsolete arguments --- eng/install-native-dependencies.sh | 19 +------------------ eng/pipelines/common/global-build-job.yml | 2 +- .../templates/runtimes/build-test-job.yml | 2 +- .../coreclr/templates/build-jit-job.yml | 2 +- eng/pipelines/coreclr/templates/build-job.yml | 2 +- eng/pipelines/installer/jobs/build-job.yml | 2 +- eng/pipelines/libraries/build-job.yml | 2 +- eng/pipelines/mono/templates/build-job.yml | 2 +- .../mono/templates/generate-offsets.yml | 2 +- 9 files changed, 9 insertions(+), 26 deletions(-) diff --git a/eng/install-native-dependencies.sh b/eng/install-native-dependencies.sh index 62cb2d76e5c03..a0b0b16ddda2c 100755 --- a/eng/install-native-dependencies.sh +++ b/eng/install-native-dependencies.sh @@ -4,14 +4,7 @@ set -e # This is a simple script primarily used for CI to install necessary dependencies # -# For CI typical usage is -# -# ./install-native-dependencies.sh azDO -# -# For developer use it is not recommended to include the azDO final argument as that -# makes installation and configuration setting only required for azDO -# -# So simple developer usage would currently be +# Usage: # # ./install-native-dependencies.sh @@ -31,16 +24,6 @@ if [ "$os" = "linux" ] && { [ "$ID" = "debian" ] || [ "$ID_LIKE" = "debian" ]; } 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 uninstall openssl@1.0.2t >/dev/null 2>&1; then - 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 "$(dirname "$0")/Brewfile" else diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index 171d71960cdbf..a431f78563fda 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -147,7 +147,7 @@ jobs: name: ${{ parameters.platform }} - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS', 'MacCatalyst') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} displayName: Install Build Dependencies - script: | diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index 1e8e33277b8cd..9788d20a76a9d 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -111,7 +111,7 @@ jobs: # Install test build dependencies - ${{ if eq(parameters.osGroup, 'OSX') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) displayName: Install native dependencies # Build core/libraries dependencies of test build diff --git a/eng/pipelines/coreclr/templates/build-jit-job.yml b/eng/pipelines/coreclr/templates/build-jit-job.yml index e91e0da1b813e..648cc122babc1 100644 --- a/eng/pipelines/coreclr/templates/build-jit-job.yml +++ b/eng/pipelines/coreclr/templates/build-jit-job.yml @@ -85,7 +85,7 @@ jobs: # and FreeBSD builds use a build agent with dependencies # preinstalled, so we only need this step for OSX and Windows. - ${{ if eq(parameters.osGroup, 'OSX') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) displayName: Install native dependencies (OSX) # Install internal tools on official builds diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 12acad00bdc7b..6fdc6631fe289 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -159,7 +159,7 @@ jobs: # and FreeBSD builds use a build agent with dependencies # preinstalled, so we only need this step for OSX and Windows. - ${{ if eq(parameters.osGroup, 'OSX') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) displayName: Install native dependencies # Install internal tools on official builds diff --git a/eng/pipelines/installer/jobs/build-job.yml b/eng/pipelines/installer/jobs/build-job.yml index e89474059ff21..00c08f0c2f385 100644 --- a/eng/pipelines/installer/jobs/build-job.yml +++ b/eng/pipelines/installer/jobs/build-job.yml @@ -310,7 +310,7 @@ jobs: cleanUnpackFolder: false - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} displayName: Install Build Dependencies - script: | diff --git a/eng/pipelines/libraries/build-job.yml b/eng/pipelines/libraries/build-job.yml index 44db3c1726768..01c7ac916cf2c 100644 --- a/eng/pipelines/libraries/build-job.yml +++ b/eng/pipelines/libraries/build-job.yml @@ -86,7 +86,7 @@ jobs: - template: /eng/pipelines/common/restore-internal-tools.yml - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} displayName: Install Build Dependencies - script: | diff --git a/eng/pipelines/mono/templates/build-job.yml b/eng/pipelines/mono/templates/build-job.yml index 80432308ebbdf..63d439c436ebc 100644 --- a/eng/pipelines/mono/templates/build-job.yml +++ b/eng/pipelines/mono/templates/build-job.yml @@ -122,7 +122,7 @@ jobs: # and FreeBSD builds use a build agent with dependencies # preinstalled, so we only need this step for OSX and Windows. - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) displayName: Install native dependencies - ${{ each monoCrossAOTTargetOS in parameters.monoCrossAOTTargetOS }}: diff --git a/eng/pipelines/mono/templates/generate-offsets.yml b/eng/pipelines/mono/templates/generate-offsets.yml index 6c84674b2becf..7bb83887c5cc5 100644 --- a/eng/pipelines/mono/templates/generate-offsets.yml +++ b/eng/pipelines/mono/templates/generate-offsets.yml @@ -57,7 +57,7 @@ jobs: # and FreeBSD builds use a build agent with dependencies # preinstalled, so we only need this step for OSX and Windows. - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) displayName: Install native dependencies # Build