summaryrefslogtreecommitdiff
path: root/init-tools.sh
diff options
context:
space:
mode:
authorYi Zhang (CLR) <yzha@microsoft.com>2016-04-01 19:52:43 -0700
committerYi Zhang (CLR) <yzha@microsoft.com>2016-04-01 19:52:43 -0700
commitd7653d909ad252b9e9ffab9c6d2089767cb6981f (patch)
treeb73788a16a890e65889d0709716add57d24cbe92 /init-tools.sh
parent21f5e97a0eea6d24965a7cda3e892befaf5daea1 (diff)
downloadcoreclr-d7653d909ad252b9e9ffab9c6d2089767cb6981f.tar.gz
coreclr-d7653d909ad252b9e9ffab9c6d2089767cb6981f.tar.bz2
coreclr-d7653d909ad252b9e9ffab9c6d2089767cb6981f.zip
Add mac ulimit -n 2048 workaround and more debug spew in CLI installation into init-tools.sh
Diffstat (limited to 'init-tools.sh')
-rwxr-xr-xinit-tools.sh71
1 files changed, 42 insertions, 29 deletions
diff --git a/init-tools.sh b/init-tools.sh
index 326e6519ea..759a2ec89a 100755
--- a/init-tools.sh
+++ b/init-tools.sh
@@ -73,42 +73,55 @@ if [ "$__DistroName" == "rhel" ]; then
__DOTNET_PKG=dotnet-dev-centos-x64
fi
+# Work around mac build issue
+if [ "$OS"=="OSX" ]; then
+ echo Raising file open limit - otherwise Mac build may fail
+ echo ulimit -n 2048
+ ulimit -n 2048
+fi
+
__CLIDownloadURL=https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.${__DOTNET_TOOLS_VERSION}.tar.gz
echo ".NET CLI will be downloaded from $__CLIDownloadURL"
+echo "Locating $__PROJECT_JSON_FILE to see if we already downloaded .NET CLI tools..."
if [ ! -e $__PROJECT_JSON_FILE ]; then
- if [ -e $__TOOLRUNTIME_DIR ]; then rm -rf -- $__TOOLRUNTIME_DIR; fi
-
- if [ ! -e $__DOTNET_PATH ]; then
- # curl has HTTPS CA trust-issues less often than wget, so lets try that first.
- which curl > /dev/null 2> /dev/null
- if [ $? -ne 0 ]; then
- mkdir -p "$__DOTNET_PATH"
- wget -q -O $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL
- else
- curl -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL
- fi
- cd $__DOTNET_PATH
- tar -xf $__DOTNET_PATH/dotnet.tar
- if [ -n "$BUILDTOOLS_OVERRIDE_RUNTIME" ]; then
- find $__DOTNET_PATH -name *.ni.* | xargs rm 2>/dev/null
- cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/bin
- cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/bin/dnx
- cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/runtime/coreclr
- fi
+ echo "$__PROJECT_JSON_FILE not found. Proceeding to download .NET CLI tools. "
+ if [ -e $__TOOLRUNTIME_DIR ]; then rm -rf -- $__TOOLRUNTIME_DIR; fi
+
+ if [ ! -e $__DOTNET_PATH ]; then
+ # curl has HTTPS CA trust-issues less often than wget, so lets try that first.
+ which curl > /dev/null 2> /dev/null
+ if [ $? -ne 0 ]; then
+ mkdir -p "$__DOTNET_PATH"
+ wget -q -O $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL
+ echo "wget -q -O $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL"
+ else
+ curl -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL
+ echo "curl -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL"
+ fi
+ cd $__DOTNET_PATH
+ tar -xf $__DOTNET_PATH/dotnet.tar
+ if [ -n "$BUILDTOOLS_OVERRIDE_RUNTIME" ]; then
+ find $__DOTNET_PATH -name *.ni.* | xargs rm 2>/dev/null
+ cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/bin
+ cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/bin/dnx
+ cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/runtime/coreclr
+ fi
- cd $__scriptpath
- fi
+ cd $__scriptpath
+ fi
- mkdir "$__PROJECT_JSON_PATH"
- echo $__PROJECT_JSON_CONTENTS > "$__PROJECT_JSON_FILE"
+ mkdir "$__PROJECT_JSON_PATH"
+ echo $__PROJECT_JSON_CONTENTS > "$__PROJECT_JSON_FILE"
- if [ ! -e $__BUILD_TOOLS_PATH ]; then
- $__DOTNET_CMD restore "$__PROJECT_JSON_FILE" --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE
- fi
+ if [ ! -e $__BUILD_TOOLS_PATH ]; then
+ $__DOTNET_CMD restore "$__PROJECT_JSON_FILE" --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE
+ fi
- # On ubuntu 14.04, /bin/sh (symbolic link) calls /bin/dash by default.
- $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR
+ # On ubuntu 14.04, /bin/sh (symbolic link) calls /bin/dash by default.
+ $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR
- chmod a+x $__TOOLRUNTIME_DIR/corerun
+ chmod a+x $__TOOLRUNTIME_DIR/corerun
+else
+ echo "$__PROJECT_JSON_FILE found. Skipping .NET CLI installation."
fi