Skip to content
This repository was archived by the owner on Jan 8, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ for .NET Core SDK preview2.

## Build

[![Windows](https://ci.appveyor.com/api/projects/status/yj3r6p4u4eby99ge/branch/master?svg=true)](https://ci.appveyor.com/project/enricosada/netcorecli-fsc/branch/master)

To build a package and run the tests:

```
Expand Down
56 changes: 22 additions & 34 deletions run-build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
REPOROOT="$DIR"

ARCHITECTURE="x64"
source "$REPOROOT/scripts/common/_prettyprint.sh"

BUILD=1

Expand Down Expand Up @@ -121,16 +120,12 @@ temp="${args[@]}"
args=($temp)

# Load Branch Info
while read line; do
if [[ $line != \#* ]]; then
IFS='=' read -ra splat <<< "$line"
export ${splat[0]}="${splat[1]}"
fi
done < "$REPOROOT/branchinfo.txt"

# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot
[ -z "$DOTNET_INSTALL_DIR_PJ" ] && export DOTNET_INSTALL_DIR_PJ=$REPOROOT/.dotnet_stage0PJ/$ARCHITECTURE
[ -d "$DOTNET_INSTALL_DIR_PJ" ] || mkdir -p $DOTNET_INSTALL_DIR_PJ
# while read line; do
# if [[ $line != \#* ]]; then
# IFS='=' read -ra splat <<< "$line"
# export ${splat[0]}="${splat[1]}"
# fi
# done < "$REPOROOT/branchinfo.txt"

# Also create an install directory for a post-PJnistic CLI
[ -z "$DOTNET_INSTALL_DIR" ] && export DOTNET_INSTALL_DIR=$REPOROOT/.dotnet_stage0/$ARCHITECTURE
Expand All @@ -140,34 +135,32 @@ done < "$REPOROOT/branchinfo.txt"
export __INIT_TOOLS_RESTORE_ARGS="$__INIT_TOOLS_RESTORE_ARGS --disable-parallel"

DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
toolsLocalPath="$REPOROOT/build_tools"
bootStrapperPath="$toolsLocalPath/bootstrap.sh"
dotnetInstallPath="$toolsLocalPath/dotnet-install.sh"
if [ ! -f $bootStrapperPath ]; then
if [ ! -d $toolsLocalPath ]; then
mkdir $toolsLocalPath
fi
download "https://raw.githubusercontent.com/dotnet/buildtools/master/bootstrap/bootstrap.sh" "$bootStrapperPath"
chmod u+x $bootStrapperPath

if [ ! -d ".dotnetsdk" ]; then
mkdir ".dotnetsdk"
fi

$bootStrapperPath --repositoryRoot "$REPOROOT" --toolsLocalPath "$toolsLocalPath" --cliInstallPath $DOTNET_INSTALL_DIR_PJ --architecture $ARCHITECTURE > bootstrap.log
sdkInstallScriptUrl=https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview3/scripts/obtain/dotnet-install.sh
sdkInstallScriptPath=$REPOROOT/.dotnetsdk/dotnet_cli_install.ps1

if [ $? != 0 ]; then
echo "run-build: Error: Boot-strapping failed with exit code $?, see bootstrap.log for more information." >&2
exit $?
fi
download $sdkInstallScriptUrl $sdkInstallScriptPath
chmod u+x $sdkInstallScriptPath

sdkVersion=1.0.0-preview3-004056
sdkPath=$REPOROOT/.dotnetsdk/sdk-$sdkVersion

DOTNET_INSTALL_DIR=$sdkPath

# now execute the script
echo "installing CLI: $dotnetInstallPath --version \"latest\" --install-dir $DOTNET_INSTALL_DIR --architecture \"$ARCHITECTURE\""
$dotnetInstallPath --version "latest" --install-dir $DOTNET_INSTALL_DIR --architecture "$ARCHITECTURE"
echo "installing CLI: $sdkInstallScriptPath --version \"$sdkVersion\" --install-dir $DOTNET_INSTALL_DIR --architecture \"$ARCHITECTURE\""
$sdkInstallScriptPath --version "$sdkVersion" --install-dir $DOTNET_INSTALL_DIR --architecture "$ARCHITECTURE"
if [ $? != 0 ]; then
echo "run-build: Error: Boot-strapping post-PJ stage0 with exit code $?." >&2
exit $?
fi

# Put stage 0 on the PATH (for this shell only)
PATH="$DOTNET_INSTALL_DIR:$PATH"
export PATH="$DOTNET_INSTALL_DIR:$PATH"

# Increases the file descriptors limit for this bash. It prevents an issue we were hitting during restore
FILE_DESCRIPTOR_LIMIT=$( ulimit -n )
Expand All @@ -182,9 +175,4 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1

echo "${args[@]}"

if [ $BUILD -eq 1 ]; then
dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE "${args[@]}"
else
echo "Not building due to --nobuild"
echo "Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE ${args[@]}'"
fi
dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE "${args[@]}"
54 changes: 54 additions & 0 deletions scripts/docker/centos/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#

# Dockerfile that creates a container suitable to build dotnet-cli
FROM centos:7.1.1503

RUN yum -q -y install deltarpm
RUN yum -q -y install epel-release
# RUN yum -y update

# This could become a "microsoft/coreclr" image, since it just installs the dependencies for CoreCLR (and stdlib)
# Install CoreCLR and CoreFx dependencies
RUN yum -q -y install unzip libunwind gettext libcurl-devel openssl-devel zlib libicu-devel

# RUN apt-get update && \
# apt-get -qqy install unzip curl libicu-dev libunwind8 gettext libssl-dev libcurl3-gnutls zlib1g liblttng-ust-dev lldb-3.6-dev lldb-3.6

# Install Build Prereqs
# CMake 3.3.2 from GhettoForge; LLVM 3.6.2 built from source ourselves;
RUN yum install -y http://mirror.symnds.com/distributions/gf/el/7/plus/x86_64/cmake-3.3.2-1.gf.el7.x86_64.rpm \
https://matell.blob.core.windows.net/rpms/clang-3.6.2-1.el7.centos.x86_64.rpm \
https://matell.blob.core.windows.net/rpms/clang-libs-3.6.2-1.el7.centos.x86_64.rpm \
https://matell.blob.core.windows.net/rpms/lldb-3.6.2-1.el7.centos.x86_64.rpm \
https://matell.blob.core.windows.net/rpms/lldb-devel-3.6.2-1.el7.centos.x86_64.rpm \
https://matell.blob.core.windows.net/rpms/llvm-3.6.2-1.el7.centos.x86_64.rpm \
https://matell.blob.core.windows.net/rpms/llvm-libs-3.6.2-1.el7.centos.x86_64.rpm \
which \
make

RUN yum -q -y install tar git

# Use clang as c++ compiler
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
RUN update-alternatives --set c++ /usr/bin/clang++

RUN yum -q -y install sudo

# Setup User to match Host User, and give superuser permissions
ARG USER_ID=0
RUN useradd -m code_executor -u ${USER_ID} -g root
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# With the User Change, we need to change permssions on these directories
RUN chmod -R a+rwx /usr/local
RUN chmod -R a+rwx /home
RUN chmod -R 755 /usr/bin/sudo

# Set user to the one we just created
USER ${USER_ID}

# Set working directory
WORKDIR /opt/code
62 changes: 62 additions & 0 deletions scripts/docker/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#

# Dockerfile that creates a container suitable to build dotnet-cli
FROM debian:jessie

# Misc Dependencies for build
RUN apt-get update && \
apt-get -qqy install \
curl \
unzip \
gettext \
sudo && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# This could become a "microsoft/coreclr" image, since it just installs the dependencies for CoreCLR (and stdlib)
RUN apt-get update &&\
apt-get -qqy install \
libunwind8 \
libkrb5-3 \
libicu52 \
liblttng-ust0 \
libssl1.0.0 \
zlib1g \
libuuid1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install Build Prereqs
RUN apt-get update && \
apt-get -qqy install \
debhelper \
build-essential \
devscripts \
git \
cmake \
clang-3.5 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Use clang as c++ compiler
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-3.5 100
RUN update-alternatives --set c++ /usr/bin/clang++-3.5

# Setup User to match Host User, and give superuser permissions
ARG USER_ID=0
RUN useradd -m code_executor -u ${USER_ID} -g sudo
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# With the User Change, we need to change permissions on these directories
RUN chmod -R a+rwx /usr/local
RUN chmod -R a+rwx /home
RUN chmod -R 755 /usr/lib/sudo

# Set user to the one we just created
USER ${USER_ID}

# Set working directory
WORKDIR /opt/code
56 changes: 56 additions & 0 deletions scripts/docker/fedora.23/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#

# Dockerfile that creates a container suitable to build dotnet-cli
FROM fedora:23

# Install the base toolchain we need to build anything (clang, cmake, make and the like)
# this does not include libraries that we need to compile different projects, we'd like
# them in a different layer.
RUN dnf install -y cmake \
clang \
lldb-devel \
make \
which && \
dnf clean all

# Install tools used by the VSO build automation.
RUN dnf install -y git \
zip \
tar \
nodejs \
findutils \
npm && \
dnf clean all && \
npm install -g azure-cli && \
npm cache clean

# Dependencies of CoreCLR and CoreFX.
RUN dnf install -y libicu-devel \
libuuid-devel \
libcurl-devel \
openssl-devel \
libunwind-devel \
lttng-ust-devel && \
dnf clean all

# Upgrade NSS, used for SSL, to avoid NuGet restore timeouts.
RUN dnf upgrade -y nss
RUN dnf clean all

# Setup User to match Host User, and give superuser permissions
ARG USER_ID=0
RUN useradd -m code_executor -u ${USER_ID} -g wheel
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# With the User Change, we need to change permissions on these directories
RUN chmod -R a+rwx /usr/local
RUN chmod -R a+rwx /home

# Set user to the one we just created
USER ${USER_ID}

# Set working directory
WORKDIR /opt/code
51 changes: 51 additions & 0 deletions scripts/docker/opensuse.13.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#

FROM opensuse:13.2

# Install the base toolchain we need to build anything (clang, cmake, make and the like)
# this does not include libraries that we need to compile different projects, we'd like
# them in a different layer.
RUN zypper -n install binutils \
cmake \
which \
gcc \
llvm-clang \
tar \
ncurses-utils \
curl \
git \
sudo && \
ln -s /usr/bin/clang++ /usr/bin/clang++-3.5 && \
zypper clean -a

# Dependencies of CoreCLR and CoreFX. We need to add an additional repository to get lttng.
RUN zypper addrepo -G http://download.opensuse.org/repositories/devel:/tools:/lttng/openSUSE_13.2/devel:tools:lttng.repo && \
zypper refresh && \
zypper -n remove krb5-mini && \
zypper -n install libunwind \
libicu \
lttng-ust \
libuuid1 \
libopenssl1_0_0 \
libcurl4 \
krb5 && \
zypper clean -a

# Setup User to match Host User, and give superuser permissions
ARG USER_ID=0
RUN useradd -m code_executor -u ${USER_ID} -g wheel
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# With the User Change, we need to change permissions on these directories
RUN chmod -R a+rwx /usr/local
RUN chmod -R a+rwx /home
RUN chmod -R 755 /usr/lib/sudo

# Set user to the one we just created
USER ${USER_ID}

# Set working directory
WORKDIR /opt/code
63 changes: 63 additions & 0 deletions scripts/docker/ubuntu.14.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#

# Dockerfile that creates a container suitable to build dotnet-cli
FROM ubuntu:14.04

# Misc Dependencies for build
RUN apt-get update && \
apt-get -qqy install \
curl \
unzip \
gettext \
sudo && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# This could become a "microsoft/coreclr" image, since it just installs the dependencies for CoreCLR (and stdlib)
RUN apt-get update && \
apt-get -qqy install \
libunwind8 \
libkrb5-3 \
libicu52 \
liblttng-ust0 \
libssl1.0.0 \
zlib1g \
libuuid1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install Build Prereqs
RUN apt-get update && \
apt-get -qqy install \
debhelper \
build-essential \
devscripts \
git \
cmake \
clang-3.5 \
lldb-3.6 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Use clang as c++ compiler
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-3.5 100
RUN update-alternatives --set c++ /usr/bin/clang++-3.5

# Setup User to match Host User, and give superuser permissions
ARG USER_ID=0
RUN useradd -m code_executor -u ${USER_ID} -g sudo
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# With the User Change, we need to change permissions on these directories
RUN chmod -R a+rwx /usr/local
RUN chmod -R a+rwx /home
RUN chmod -R 755 /usr/lib/sudo

# Set user to the one we just created
USER ${USER_ID}

# Set working directory
WORKDIR /opt/code
Loading