diff --git a/CMakeLists.txt b/CMakeLists.txt index 8801d1447..ff558391a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/compileoptions.cmake b/compileoptions.cmake index a6047d919..791101c9f 100644 --- a/compileoptions.cmake +++ b/compileoptions.cmake @@ -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) diff --git a/eng/build-native.sh b/eng/build-native.sh index f18cf969d..d72343434 100755 --- a/eng/build-native.sh +++ b/eng/build-native.sh @@ -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]}" diff --git a/eng/build.sh b/eng/build.sh index 31a667030..70501e53f 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -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" $@ diff --git a/eng/cibuild.sh b/eng/cibuild.sh index ef435ef03..da5b4e51d 100755 --- a/eng/cibuild.sh +++ b/eng/cibuild.sh @@ -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]}" diff --git a/eng/gen-buildsys-clang.sh b/eng/gen-buildsys-clang.sh index 649dd1fd5..413a4ab50 100755 --- a/eng/gen-buildsys-clang.sh +++ b/eng/gen-buildsys-clang.sh @@ -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 index 000000000..8dd36a283 --- /dev/null +++ b/eng/install-dotnet.sh @@ -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=$( /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 + diff --git a/functions.cmake b/functions.cmake index 0b383efa1..913e71a65 100644 --- a/functions.cmake +++ b/functions.cmake @@ -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") diff --git a/global.json b/global.json index 2ecbc0560..ad8f2a530 100644 --- a/global.json +++ b/global.json @@ -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" diff --git a/netci.groovy b/netci.groovy index efc74e2d2..e4a7b766a 100644 --- a/netci.groovy +++ b/netci.groovy @@ -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('Build and Test') - // Add PR trigger - pipeline.triggerPipelineOnEveryGithubPR(triggerName, configParams) - - // Add trigger to run on merge - pipeline.triggerPipelineOnGithubPush(configParams) -} +// Add trigger to run on merge +pipeline.triggerPipelineOnGithubPush() diff --git a/pipeline.groovy b/pipeline.groovy index f8f6c5761..e1a440b50 100644 --- a/pipeline.groovy +++ b/pipeline.groovy @@ -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/${config.Configuration}/TestResults/*.xml" + Utilities.addXUnitDotNETResults(job, resultFilePattern, skipIfNoTestFiles: false) + + def filesToArchive = "**/artifacts/${config.Configuration}/**" + archiveArtifacts allowEmptyArchive: true, artifacts: filesToArchive } } - - stage ('Archive artifacts') { - def resultFilePattern = "**/artifacts/${configuration}/TestResults/*.xml" - Utilities.addXUnitDotNETResults(job, resultFilePattern, skipIfNoTestFiles: false) - - def filesToArchive = "**/artifacts/${configuration}/**" - archiveArtifacts allowEmptyArchive: true, artifacts: filesToArchive - } } diff --git a/src/SOS/tests/testsos.sh b/src/SOS/tests/testsos.sh index fae049f5e..f94d0574f 100755 --- a/src/SOS/tests/testsos.sh +++ b/src/SOS/tests/testsos.sh @@ -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