Add license headers
authorMike McLaughlin <mikem@microsoft.com>
Wed, 9 May 2018 19:42:25 +0000 (12:42 -0700)
committerMike McLaughlin <mikem@microsoft.com>
Thu, 10 May 2018 00:10:11 +0000 (17:10 -0700)
Add .NET Core install script that works on Fedora, OpenSuse, etc.

Update to dotnet 2.1.300-rc1-008673

12 files changed:
CMakeLists.txt
compileoptions.cmake
eng/build-native.sh
eng/build.sh
eng/cibuild.sh
eng/gen-buildsys-clang.sh
eng/install-dotnet.sh [new file with mode: 0755]
functions.cmake
global.json
netci.groovy
pipeline.groovy
src/SOS/tests/testsos.sh

index 8801d1447a4c787105e1dd4f2d80622457137029..ff558391a70d66bc4ed55f53da86dab36d84ca57 100644 (file)
@@ -1,3 +1,6 @@
+# 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)
 
index a6047d9190cb375a0fea426559678a26d470d4fa..791101c9f1d670176c93aa5de7c264e5296eaa62 100644 (file)
@@ -1,3 +1,6 @@
+# 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)
index f18cf969d96e9355983d989db3e8742c200ef511..d72343434a2928bc1e67f4dc647bdad133e17e3e 100755 (executable)
@@ -1,4 +1,6 @@
 #!/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]}"
index 31a667030859cdf9c75f260c7adb433821eaf439..70501e53f864c046ad168f5ef4f0a798f7db6f04 100755 (executable)
@@ -1,4 +1,6 @@
 #!/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]}"
 
@@ -14,6 +16,10 @@ done
 
 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" $@
 
index ef435ef0334c78067e3e7f6bc81995bee80ae27e..da5b4e51d5bd50477a508bf593bc1023849b6530 100755 (executable)
@@ -1,4 +1,6 @@
 #!/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]}"
 
index 649dd1fd5a87395ce5f0ab37b8a507339fd091ae..413a4ab5084d298dbb706e3fc54bd923630ec713 100755 (executable)
@@ -1,4 +1,7 @@
 #!/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.
 #
diff --git a/eng/install-dotnet.sh b/eng/install-dotnet.sh
new file mode 100755 (executable)
index 0000000..8dd36a2
--- /dev/null
@@ -0,0 +1,88 @@
+#!/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
+
index 0b383efa10712810a47c6ffe0e2bc5f32db468d5..913e71a651542c5fb3ce9cd2420f0c4295e724b7 100644 (file)
@@ -1,3 +1,6 @@
+# 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")
index 2ecbc0560dee2407b237042fcf639081179899ed..ad8f2a5300bf0f95e48f9af838ce7aca79210b3e 100644 (file)
@@ -1,6 +1,6 @@
 {
   "sdk": {
-    "version": "2.1.101"
+    "version": "2.1.300-rc1-008673"
   },
   "msbuild-sdks": {
     "RoslynTools.RepoToolset": "1.0.0-beta2-62810-01"
index efc74e2d285e048308f2dbe553375fc0437ae838..e4a7b766a89bd68606ce4a66b5bf7cfc75cc7394 100644 (file)
@@ -7,40 +7,11 @@ def project = GithubProject
 // 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()
index f8f6c5761c5d8e400a2fd8e145447a4148f2722e..e1a440b5030a33c9ef45230709647890c47c31d8 100644 (file)
@@ -1,36 +1,58 @@
 @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
+        }
     }
 }
index fae049f5ec707e85acdbdc1ff2e4e48099a789f4..f94d0574f5df9ca2cc8f62cf412ab2eab80ea728 100755 (executable)
@@ -13,8 +13,13 @@ fi
 __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