diff options
author | Jo Shields <joshield@microsoft.com> | 2019-10-15 23:21:21 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2019-10-15 23:21:21 +0300 |
commit | dc0eea6fd1c76c1060751d24ba8d0e93b8ea0277 (patch) | |
tree | a292522560ea23a163c2cbedc22c26af1bc8e12c /netcore/build.sh | |
parent | 82a07273c22b996b08fa88ee2e6632d782ac2242 (diff) |
Initial telemetry for netcore builds (#17331)
* Load VSTS telemetry helpers into build.sh script
* First cut adding some basic VSTS-compatible telemetry on failures
* Don't make `ci=true` the default, make it a build.sh flag
Diffstat (limited to 'netcore/build.sh')
-rwxr-xr-x | netcore/build.sh | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/netcore/build.sh b/netcore/build.sh index 5e83023d675..128fd7b4a36 100755 --- a/netcore/build.sh +++ b/netcore/build.sh @@ -7,6 +7,12 @@ set -u # Prevents hidden errors caused by missing error code propagation. set -e +# Handle being in the "wrong" directory +cd "${BASH_SOURCE%/*}/" + +# Include VSTS logging helpers +. ../eng/common/pipeline-logging-functions.sh + usage() { echo "Common settings:" @@ -21,6 +27,7 @@ usage() echo " --llvm Enable LLVM support" echo " --skipnative Do not build runtime" echo " --skipmscorlib Do not build System.Private.CoreLib" + echo " --ci Enable Azure DevOps telemetry decoration" echo "" echo "Command line arguments starting with '/p:' are passed through to MSBuild." @@ -36,6 +43,7 @@ skipmscorlib=false skipnative=false llvm=false autogen_params='' +ci=false while [[ $# > 0 ]]; do opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')" @@ -67,6 +75,9 @@ while [[ $# > 0 ]]; do -llvm) llvm=true ;; + -ci) + ci=true + ;; -p:*|/p:*) properties="$properties $1" ;; @@ -100,35 +111,35 @@ elif [[ "$configuration" == "Release" ]]; then fi if [ "$llvm" = "true" ]; then - git submodule update --init -- ../external/llvm + git submodule update --init -- ../external/llvm || (Write-PipelineTelemetryError -c "git" -e 1 "Error fetching LLVM submodule" && exit 1) autogen_params="$autogen_params --enable-llvm" fi # run .././autogen.sh only once or if "--rebuild" argument is provided if [[ "$force_rebuild" == "true" || ! -f .configured ]]; then - (cd .. && ./autogen.sh --with-core=only $autogen_params CFLAGS="$EXTRA_CFLAGS" CXXFLAGS="$EXTRA_CXXFLAGS") + (cd .. && ./autogen.sh --with-core=only $autogen_params CFLAGS="$EXTRA_CFLAGS" CXXFLAGS="$EXTRA_CXXFLAGS") || (Write-PipelineTelemetryError -c "configure" -e 1 "Error running autogen" && exit 1) touch .configured fi # build mono runtime if [ "$skipnative" = "false" ]; then - make runtime -j$CPU_COUNT + make runtime -j$CPU_COUNT || (Write-PipelineTelemetryError -c "runtime" -e 1 "Error building unmanaged runtime" && exit 1) fi # build System.Private.CoreLib (../mcs/class/System.Private.CoreLib) if [ "$skipmscorlib" = "false" ]; then - make bcl CORLIB_BUILD_FLAGS="$properties" + make bcl CORLIB_BUILD_FLAGS="$properties" || (Write-PipelineTelemetryError -c "bcl" -e 1 "Error building System.Private.CoreLib" && exit 1) fi # create a nupkg with runtime and System.Private.CoreLib if [ "$pack" = "true" ]; then - make nupkg + make nupkg || (Write-PipelineTelemetryError -c "nupkg" -e 1 "Error packing NuGet package" && exit 1) fi # run all xunit tests if [ "$test" = "true" ]; then make update-tests-corefx for testdir in corefx/tests/extracted/*; do - ../scripts/ci/./run-step.sh --label=$(basename $testdir) --timeout=15m make run-tests-corefx-$(basename $testdir) + ../scripts/ci/./run-step.sh --label=$(basename $testdir) --timeout=15m make run-tests-corefx-$(basename $testdir) || (Write-PipelineTelemetryError -c "tests" -e 1 "Error running tests from ${testdir}" && exit 1) done -fi
\ No newline at end of file +fi |