From 11a3bf307681b9edc1299c8e31137589ea7f1454 Mon Sep 17 00:00:00 2001 From: Andrew Stanton-Nurse Date: Thu, 29 Oct 2015 10:02:14 -0700 Subject: [PATCH] clean up dependency on DNX --- scripts/bootstrap.sh | 45 ++++++--------------------------------- scripts/docker/Dockerfile | 20 ++++++++++------- scripts/install-stage0.sh | 13 ----------- 3 files changed, 18 insertions(+), 60 deletions(-) delete mode 100755 scripts/install-stage0.sh diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 812b73619..c1e079c5a 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -35,47 +35,19 @@ fi OUTPUT_ROOT=$REPOROOT/artifacts/$RID DNX_DIR=$OUTPUT_ROOT/dnx -STAGE0_DIR=$OUTPUT_ROOT/stage0 STAGE1_DIR=$OUTPUT_ROOT/stage1 STAGE2_DIR=$OUTPUT_ROOT/stage2 -if [ "$DOTNET_CI_SKIP_STAGE0_INSTALL" != "1" ]; then - echo "Installing stage0" - # Use a sub-shell to ensure the DNVM gets cleaned up - rm -Rf $STAGE0_DIR - mkdir -p $STAGE0_DIR - $DIR/install-stage0.sh $STAGE0_DIR $DIR/dnvm2.sh -else - echo "Skipping stage0 because DOTNET_CI_SKIP_STAGE0_INSTALL" -fi +echo "Installing stage0" -export PATH=$STAGE0_DIR/bin:$PATH +source $DIR/dnvm2.sh +dnvm upgrade -a dotnet_stage0 -echo "Installing and use-ing the latest CoreCLR x64 DNX ..." -mkdir -p $DNX_DIR +DNX_ROOT="$(dirname $(which dotnet))/dnx" -export DNX_HOME=$DNX_DIR -export DNX_USER_HOME=$DNX_DIR -export DNX_GLOBAL_HOME=$DNX_DIR +echo "Restoring packages" -if ! type dnvm > /dev/null 2>&1; then - curl -o $DNX_DIR/dnvm.sh https://raw.githubusercontent.com/aspnet/Home/dev/dnvm.sh - source $DNX_DIR/dnvm.sh -fi - -dnvm install latest -u -r coreclr - -# Make sure we got a DNX -if ! type dnx > /dev/null 2>&1; then - echo "DNX is required to bootstrap stage1" 1>&2 - exit 1 -fi - -DNX_ROOT=$(dirname $(which dnx)) - -echo "Running 'dnu restore' to restore packages" - -dnu restore "$REPOROOT" --runtime osx.10.10-x64 --runtime ubuntu.14.04-x64 --runtime osx.10.11-x64 +dotnet restore "$REPOROOT" --runtime osx.10.10-x64 --runtime ubuntu.14.04-x64 --runtime osx.10.11-x64 # Clean up stage1 [ -d "$STAGE1_DIR" ] && rm -Rf "$STAGE1_DIR" @@ -109,11 +81,6 @@ chmod -R a+r $REPOROOT # Copy DNX in to stage2 cp -R $DNX_ROOT $STAGE2_DIR/dnx -# Clean up some things we don't need -rm -Rf $STAGE2_DIR/dnx/lib/Microsoft.Dnx.DesignTimeHost -rm -Rf $STAGE2_DIR/dnx/lib/Microsoft.Dnx.Project -rm $STAGE2_DIR/dnx/dnu - # Copy and CHMOD the dotnet-restore script cp $DIR/dotnet-restore.sh $STAGE2_DIR/dotnet-restore chmod a+x $STAGE2_DIR/dotnet-restore diff --git a/scripts/docker/Dockerfile b/scripts/docker/Dockerfile index ce020e821..8bdd5ee94 100644 --- a/scripts/docker/Dockerfile +++ b/scripts/docker/Dockerfile @@ -1,14 +1,18 @@ # Dockerfile that creates a container suitable to build dotnet-cli -FROM microsoft/aspnet:1.0.0-beta8-coreclr +FROM debian:jessie -RUN apt-get update -RUN apt-get install -y wget +# This could become a "microsoft/coreclr" image, since it just installs the dependencies for CoreCLR (and stdlib) +# Install CoreCLR dependencies (and clean APT cache) +RUN apt-get update && \ + apt-get -qqy install unzip curl libicu-dev libunwind8 gettext libssl-dev libcurl3-gnutls zlib1g && \ + rm -rf /var/lib/apt/lists/* -# Install Package Build Prereqs -RUN echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.6 main" | tee /etc/apt/sources.list.d/llvm.list -RUN wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add - -RUN apt-get update -RUN apt-get install -y debhelper build-essential devscripts git liblttng-ust-dev lldb-3.6-dev +# Install Package Build Prereqs (and clean up APT cache after to save space in the image) +RUN echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.6 main" | tee /etc/apt/sources.list.d/llvm.list && \ + curl http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add - && \ + apt-get update && \ + apt-get install -y debhelper build-essential devscripts git liblttng-ust-dev lldb-3.6-dev && \ + rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /opt/code diff --git a/scripts/install-stage0.sh b/scripts/install-stage0.sh deleted file mode 100755 index 82a35c329..000000000 --- a/scripts/install-stage0.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -STAGE0_DIR=$1 -DNVM_PATH=$2 - -export DOTNET_USER_HOME=$STAGE0_DIR - -source $DNVM_PATH - -dnvm upgrade -a dotnet_stage0 - -VER=`dnvm alias dotnet_stage0` -mv $STAGE0_DIR/sdks/$VER $STAGE0_DIR/bin