Add .NET Core install script that works on Fedora, OpenSuse, etc.
Update to dotnet 2.1.300-rc1-008673
+# 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.
+
# Verify minimum required version
cmake_minimum_required(VERSION 2.8.12)
+# 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.
+
if (CLR_CMAKE_PLATFORM_UNIX)
# Disable frame pointer optimizations so profilers can get better call stacks
add_compile_options(-fno-omit-frame-pointer)
#!/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.
# Obtain the location of the bash script to figure out where the root of the repo is.
source="${BASH_SOURCE[0]}"
#!/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.
source="${BASH_SOURCE[0]}"
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
+# install .NET Core - setting DOTNET_INSTALL_DIR prevents build.sh from installing it
+export DOTNET_INSTALL_DIR=$scriptroot/../.dotnet
+"$scriptroot/install-dotnet.sh" $DOTNET_INSTALL_DIR 2.1.300-rc1-008673
+
# build/test managed components
"$scriptroot/common/build.sh" $@
#!/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.
source="${BASH_SOURCE[0]}"
#!/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.
+
#
# This file invokes cmake and generates the build system for Clang.
#
--- /dev/null
+#!/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.
+
+# The "https://dot.net/v1/dotnet-install.sh" script doesn't work on Fedora or OpenSuse
+
+source="${BASH_SOURCE[0]}"
+
+# resolve $SOURCE until the file is no longer a symlink
+while [[ -h $source ]]; do
+ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
+ source="$(readlink "$source")"
+
+ # if $source was a relative symlink, we need to resolve it relative to the path where the
+ # symlink file was located
+ [[ $source != /* ]] && source="$scriptroot/$source"
+done
+
+scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
+
+dotnet_root=$1
+dotnet_sdk_version=$2
+
+if [ ! -e "$dotnet_root" ]; then
+ if [ "$(uname -m | grep "i[3456]86")" = "i686" ]; then
+ echo "Warning: build not supported on 32 bit Unix"
+ fi
+
+ pkg_arch=x64
+ OSName=$(uname -s)
+ case $OSName in
+ Darwin)
+ OS=OSX
+ pkg_rid=osx
+ ulimit -n 2048
+ # Format x.y.z as single integer with three digits for each part
+ VERSION=`sw_vers -productVersion| sed -e 's/\./ /g' | xargs printf "%03d%03d%03d"`
+ if [ "$VERSION" -lt 010012000 ]; then
+ echo error: macOS version `sw_vers -productVersion` is too old. 10.12 is needed as minimum.
+ exit 1
+ fi
+ ;;
+
+ Linux)
+ pkg_rid=linux
+ OS=Linux
+
+ if [ -e /etc/os-release ]; then
+ source /etc/os-release
+ if [[ $ID == "alpine" ]]; then
+ pkg_rid=linux-musl
+ fi
+ elif [ -e /etc/redhat-release ]; then
+ redhatRelease=$(</etc/redhat-release)
+ if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
+ pkg_rid=rhel.6
+ fi
+ fi
+
+ ;;
+
+ *)
+ echo "Unsupported OS '$OSName' detected. Downloading linux-$pkg_arch tools."
+ OS=Linux
+ pkg_rid=linux
+ ;;
+ esac
+
+ dotnet_pkg=dotnet-sdk-${dotnet_sdk_version}-$pkg_rid-$pkg_arch
+
+ mkdir -p "$dotnet_root"
+
+ echo "Installing dotnet cli..."
+ dotnet_location="https://dotnetcli.azureedge.net/dotnet/Sdk/${dotnet_sdk_version}/${dotnet_pkg}.tar.gz"
+
+ echo "Installing '${dotnet_location}' to '$dotnet_root/dotnet.tar'"
+ rm -rf -- "$dotnet_root/*"
+ # curl has HTTPS CA trust-issues less often than wget, so lets try that first.
+ if command -v curl > /dev/null; then
+ curl --retry 10 -sSL --create-dirs -o $dotnet_root/dotnet.tar ${dotnet_location}
+ else
+ wget -q -O $dotnet_root/dotnet.tar ${dotnet_location}
+ fi
+
+ cd "$dotnet_root"
+ tar -xf "$dotnet_root/dotnet.tar"
+fi
+
+# 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.
+
function(clr_unknown_arch)
if (WIN32)
message(FATAL_ERROR "Only AMD64, ARM64, ARM and I386 are supported")
{
"sdk": {
- "version": "2.1.101"
+ "version": "2.1.300-rc1-008673"
},
"msbuild-sdks": {
"RoslynTools.RepoToolset": "1.0.0-beta2-62810-01"
// The input branch name (e.g. master)
def branch = GithubBranchName
-// Possible OS's
-//
-// 'Windows_NT'
-// 'Ubuntu'
-// 'Ubuntu16.04'
-// 'Ubuntu16.10'
-// 'Debian8.4'
-// 'RHEL7.2'
-// 'Fedora24'
-// 'CentOS7.1'
-// 'OSX10.12'
-
-// Possible Architechures
-//
-// 'arm',
-// 'arm64'
-// 'x86'
-// 'x64'
-
-def configurations = [
- ['OS':'Windows_NT', 'Architechure':'x64', 'Configuration':'Release'],
- ['OS':'Ubuntu16.04', 'Architechure':'x64', 'Configuration':'Release'],
- ['OS':'CentOS7.1', 'Architechure':'x64', 'Configuration':'Release'],
-]
-
// Create build and test pipeline job
def pipeline = Pipeline.createPipelineForGithub(this, project, branch, 'pipeline.groovy')
-configurations.each { configParams ->
- def triggerName = "${configParams.OS} ${configParams.Architechure} ${configParams.Configuration} Build and Test"
-
- // Add PR trigger
- pipeline.triggerPipelineOnEveryGithubPR(triggerName, configParams)
+// Add PR trigger
+pipeline.triggerPipelineOnEveryGithubPR('Build and Test')
- // Add trigger to run on merge
- pipeline.triggerPipelineOnGithubPush(configParams)
-}
+// Add trigger to run on merge
+pipeline.triggerPipelineOnGithubPush()
@Library('dotnet-ci') _
import jobs.generation.Utilities
-// Accepts parameters
-// OS - Windows_NT, Ubuntu, Ubuntu16.04, Ubuntu16.10, Debian8.4, CentOS7.1, RHEL7.2, Fedora24
-// Architechure - x64, x86, arm, arm64
-// Configuration - Debug or Release
+// Possible OS's
+//
+// 'Windows_NT'
+// 'Ubuntu'
+// 'Ubuntu16.04'
+// 'Ubuntu16.10'
+// 'Debian8.4'
+// 'RHEL7.2'
+// 'Fedora24'
+// 'CentOS7.1'
+// 'OSX10.12'
-def os = params.OS
-def architechure = params.Architechure
-def configuration = params.Configuration
+// Possible Architechures
+//
+// 'arm',
+// 'arm64'
+// 'x86'
+// 'x64'
-// build and test
-simpleNode(os, 'latest') {
+def buildConfigurations = [
+ ['OS':'Windows_NT', 'Architechure':'x64', 'Configuration':'Release'],
+ ['OS':'Ubuntu16.04', 'Architechure':'x64', 'Configuration':'Release'],
+ ['OS':'CentOS7.1', 'Architechure':'x64', 'Configuration':'Release'],
+]
- stage ('Checkout Source') {
- checkout scm
- }
+def testConfigurations = [
+ ['OS':'Ubuntu16.04', 'Architechure':'x64', 'Configuration':'Release'],
+]
+
+buildConfigurations.each { config ->
+
+ simpleNode(config.OS, 'latest') {
+
+ stage ('Checkout Source') {
+ checkout scm
+ }
- stage ('Build/Test') {
+ stage ('Build/Test') {
- if (os == "Windows_NT") {
- bat ".\\eng\\common\\CIBuild.cmd -configuration ${configuration} -prepareMachine"
- } else {
- sh "./eng/cibuild.sh --configuration ${configuration} --architechure ${architechure} --prepareMachine"
+ if (os == "Windows_NT") {
+ bat ".\\eng\\common\\CIBuild.cmd -configuration ${config.Configuration} -prepareMachine"
+ } else {
+ sh "./eng/cibuild.sh --configuration ${config.Configuration} --architechure ${config.Architechure} --prepareMachine"
+ }
}
- }
- stage ('Archive artifacts') {
- def resultFilePattern = "**/artifacts/${configuration}/TestResults/*.xml"
- Utilities.addXUnitDotNETResults(job, resultFilePattern, skipIfNoTestFiles: false)
+ stage ('Archive artifacts') {
+ def resultFilePattern = "**/artifacts/${config.Configuration}/TestResults/*.xml"
+ Utilities.addXUnitDotNETResults(job, resultFilePattern, skipIfNoTestFiles: false)
- def filesToArchive = "**/artifacts/${configuration}/**"
- archiveArtifacts allowEmptyArchive: true, artifacts: filesToArchive
+ def filesToArchive = "**/artifacts/${config.Configuration}/**"
+ archiveArtifacts allowEmptyArchive: true, artifacts: filesToArchive
+ }
}
}
__Plugin=$__NativeBinDir/libsosplugin.so
__Host=$__ProjectRoot/.dotnet/dotnet
__TestProgram=$__ManagedBinDir/TestDebuggee/netcoreapp2.0/TestDebuggee.dll
+__LLDB_Path=$LLDB_PATH
+
+if [[ "$__LLDB_Path" = "" ]]; then
+ __LLDB_Path=lldb
+fi
cd $__ProjectRoot/src/SOS/tests/
-rm StressLog.txt
-python2 $__ProjectRoot/src/SOS/tests/test_libsosplugin.py --lldb $LLDB_PATH --host $__Host --plugin $__Plugin --logfiledir $__LogFileDir --assembly $__TestProgram
+rm -f StressLog.txt
+python2 $__ProjectRoot/src/SOS/tests/test_libsosplugin.py --lldb $__LLDB_Path --host $__Host --plugin $__Plugin --logfiledir $__LogFileDir --assembly $__TestProgram