Skip to content

Commit

Permalink
Merge pull request #23507 from khyperia/linux_stuff
Browse files Browse the repository at this point in the history
General improvements to Linux story
  • Loading branch information
khyperia authored Dec 7, 2017
2 parents 906d5cb + e19143d commit 2c1d648
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 173 deletions.
39 changes: 32 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ usage()
echo " --bootstrap Implies --build-bootstrap and --use-bootstrap"
}

this_dir="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${this_dir}"/build/scripts/build-utils.sh
root_path="$(get_repo_dir)"
root_path="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
binaries_path="${root_path}"/Binaries
bootstrap_path="${binaries_path}"/Bootstrap
bootstrap_framework=netcoreapp2.0
Expand All @@ -34,11 +32,20 @@ build=false
test_=false
build_bootstrap=false
use_bootstrap=false
stop_vbcscompiler=false

# LTTNG is the logging infrastructure used by coreclr. Need this variable set
# so it doesn't output warnings to the console.
export LTTNG_HOME="$HOME"

if [[ $# = 0 ]]
then
usage
echo ""
echo "To build and test this repo, try: ./build.sh --restore --build --test"
exit 1
fi

while [[ $# > 0 ]]
do
opt="$(echo "$1" | awk '{print tolower($0)}')"
Expand All @@ -55,15 +62,15 @@ do
build_configuration=Release
shift 1
;;
--restore)
--restore|-r)
restore=true
shift 1
;;
--build)
--build|-b)
build=true
shift 1
;;
--test)
--test|-t)
test_=true
shift 1
;;
Expand All @@ -80,13 +87,19 @@ do
use_bootstrap=true
shift 1
;;
--stop-vbcscompiler)
stop_vbcscompiler=true
shift 1
;;
*)
usage
exit 1
;;
esac
done

source "${root_path}"/build/scripts/obtain_dotnet.sh

if [[ "$restore" == true ]]
then
"${root_path}"/build/scripts/restore.sh
Expand Down Expand Up @@ -115,7 +128,19 @@ then
dotnet build "${root_path}"/Compilers.sln ${build_args} "/bl:${binaries_path}/Build.binlog"
fi

if [[ "${stop_vbcscompiler}" == true ]]
then
if [[ "${use_bootstrap}" == true ]]
then
echo "Stopping VBCSCompiler"
dotnet "${bootstrap_path}"/bincore/VBCSCompiler.dll -shutdown
else
echo "--stop-vbcscompiler requires --use-bootstrap. Aborting."
exit 1
fi
fi

if [[ "${test_}" == true ]]
then
"${root_path}"/build/scripts/tests.sh
"${root_path}"/build/scripts/tests.sh "${build_configuration}"
fi
12 changes: 0 additions & 12 deletions build/linux/setup-certs.sh

This file was deleted.

36 changes: 0 additions & 36 deletions build/linux/setup-pcl.sh

This file was deleted.

22 changes: 0 additions & 22 deletions build/linux/setup-snapshot.sh

This file was deleted.

10 changes: 0 additions & 10 deletions build/linux/setup.sh

This file was deleted.

27 changes: 27 additions & 0 deletions build/scripts/cibuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# 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.

set -e
set -u

root_path="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"

# $HOME is unset when running the mac unit tests.
if [[ -z "${HOME+x}" ]]
then
# Note that while ~ usually refers to $HOME, in the case where $HOME is unset,
# it looks up the current user's home dir, which is what we want.
# https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html
export HOME="$(cd ~ && pwd)"
fi

# There's no reason to send telemetry or prime a local package cach when building
# in CI.
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1

echo "Building this commit:"
git show --no-patch --pretty=raw HEAD

"${root_path}"/build.sh --restore --bootstrap --build --stop-vbcscompiler --test "$@"
6 changes: 2 additions & 4 deletions build/scripts/obtain_dotnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,20 @@ install_dotnet () {
# check if the correct `dotnet` is already on the PATH
if command -v dotnet >/dev/null 2>&1
then
if [[ "${FORCE_DOWNLOAD:-false}" != true && "$(dotnet --version)" = "${DOTNET_VERSION}" ]]
if [[ "${FORCE_DOWNLOAD:-false}" != true && "$(dotnet --version)" = "${DOTNET_SDK_VERSION}" ]]
then
return 0
fi
fi

if [[ ! -x "${DOTNET_PATH}/dotnet" || "$(${DOTNET_PATH}/dotnet --version)" != "${DOTNET_VERSION}" ]]
if [[ ! -x "${DOTNET_PATH}/dotnet" || "$(${DOTNET_PATH}/dotnet --version)" != "${DOTNET_SDK_VERSION}" ]]
then
echo "Downloading and installing .NET CLI version ${DOTNET_SDK_VERSION} to ${DOTNET_PATH}"
curl https://dot.net/v1/dotnet-install.sh | \
/usr/bin/env bash -s -- --version "${DOTNET_SDK_VERSION}" --install-dir "${DOTNET_PATH}"

curl https://dot.net/v1/dotnet-install.sh | \
/usr/bin/env bash -s -- --version "${DOTNET_RUNTIME_VERSION}" --shared-runtime --install-dir "${DOTNET_PATH}"
else
echo "Skipping download of .NET CLI: Already installed at ${DOTNET_PATH}"
fi

export PATH="${DOTNET_PATH}:${PATH}"
Expand Down
11 changes: 0 additions & 11 deletions build/scripts/unzip.sh

This file was deleted.

1 change: 0 additions & 1 deletion build/unix/extra_unix_args.rsp

This file was deleted.

69 changes: 2 additions & 67 deletions cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,5 @@
# 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.

set -e
set -u

usage()
{
echo "Runs our integration suite on Linux"
echo "usage: cibuild.sh [options]"
echo ""
echo "Options"
echo " --debug Build Debug (default)"
echo " --release Build Release"
}

THIS_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${THIS_DIR}"/build/scripts/build-utils.sh
ROOT_PATH="$(get_repo_dir)"

BUILD_CONFIGURATION=--debug

# $HOME is unset when running the mac unit tests.
if [[ -z "${HOME+x}" ]]
then
# Note that while ~ usually refers to $HOME, in the case where $HOME is unset,
# it looks up the current user's home dir, which is what we want.
# https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html
export HOME="$(cd ~ && pwd)"
fi

# There's no reason to send telemetry or prime a local package cach when building
# in CI.
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1

while [[ $# > 0 ]]
do
opt="$(echo "$1" | awk '{print tolower($0)}')"
case "$opt" in
-h|--help)
usage
exit 1
;;
--debug)
BUILD_CONFIGURATION=--debug
shift 1
;;
--release)
BUILD_CONFIGURATION=--release
shift 1
;;
*)
usage
exit 1
;;
esac
done

echo Building this commit:
git show --no-patch --pretty=raw HEAD

# obtain_dotnet.sh puts the right dotnet on the PATH
FORCE_DOWNLOAD=true
source "${ROOT_PATH}"/build/scripts/obtain_dotnet.sh

"${ROOT_PATH}"/build.sh --restore --bootstrap --build --test "${BUILD_CONFIGURATION}"

echo "Killing VBCSCompiler"
dotnet "${ROOT_PATH}"/Binaries/Bootstrap/bincore/VBCSCompiler.dll -shutdown
# Temporary file until the netci.groovy change to use the new location propogates
exec ./build/scripts/cibuild.sh "$@"
6 changes: 3 additions & 3 deletions netci.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ commitPullList.each { isPr ->
def myJob = job(jobName) {
description("Ubuntu 14.04 tests")
steps {
shell("./cibuild.sh --debug")
shell("./build/scripts/cibuild.sh --debug")
}
}

Expand All @@ -122,7 +122,7 @@ commitPullList.each { isPr ->
def myJob = job(jobName) {
description("Ubuntu 16.04 tests")
steps {
shell("./cibuild.sh --debug")
shell("./build/scripts/cibuild.sh --debug")
}
}

Expand All @@ -139,7 +139,7 @@ commitPullList.each { isPr ->
def myJob = job(jobName) {
description("Mac tests")
steps {
shell("./cibuild.sh --debug")
shell("./build/scripts/cibuild.sh --debug")
}
}

Expand Down

0 comments on commit 2c1d648

Please sign in to comment.