This commit is contained in:
John Luo 2020-07-17 11:56:28 -07:00 коммит произвёл GitHub
Родитель 1424d36ed0
Коммит ae9e3b317d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
63 изменённых файлов: 573 добавлений и 1184 удалений

Просмотреть файл

@ -3,25 +3,25 @@
<ProductDependencies> <ProductDependencies>
</ProductDependencies> </ProductDependencies>
<ToolsetDependencies> <ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20330.3"> <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20228.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>243cc92161ad44c2a07464425892daee19121c99</Sha> <Sha>590a102630c7efc7ca6f652f7c6c47dee4c4086c</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="5.0.0-beta.20330.3"> <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="5.0.0-beta.20228.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>243cc92161ad44c2a07464425892daee19121c99</Sha> <Sha>590a102630c7efc7ca6f652f7c6c47dee4c4086c</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.SignTool" Version="5.0.0-beta.20330.3"> <Dependency Name="Microsoft.DotNet.SignTool" Version="5.0.0-beta.20228.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>243cc92161ad44c2a07464425892daee19121c99</Sha> <Sha>590a102630c7efc7ca6f652f7c6c47dee4c4086c</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20330.3"> <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20228.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>243cc92161ad44c2a07464425892daee19121c99</Sha> <Sha>590a102630c7efc7ca6f652f7c6c47dee4c4086c</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.SwaggerGenerator.MSBuild" Version="5.0.0-beta.20330.3"> <Dependency Name="Microsoft.DotNet.SwaggerGenerator.MSBuild" Version="5.0.0-beta.20228.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>243cc92161ad44c2a07464425892daee19121c99</Sha> <Sha>590a102630c7efc7ca6f652f7c6c47dee4c4086c</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Maestro.Client" Version="1.1.0-beta.19556.4"> <Dependency Name="Microsoft.DotNet.Maestro.Client" Version="1.1.0-beta.19556.4">
<Uri>https://github.com/dotnet/arcade-services</Uri> <Uri>https://github.com/dotnet/arcade-services</Uri>

Просмотреть файл

@ -20,7 +20,6 @@ Param(
[switch] $publish, [switch] $publish,
[switch] $clean, [switch] $clean,
[switch][Alias('bl')]$binaryLog, [switch][Alias('bl')]$binaryLog,
[switch][Alias('nobl')]$excludeCIBinarylog,
[switch] $ci, [switch] $ci,
[switch] $prepareMachine, [switch] $prepareMachine,
[switch] $help, [switch] $help,
@ -59,7 +58,6 @@ function Print-Usage() {
Write-Host "Advanced settings:" Write-Host "Advanced settings:"
Write-Host " -projects <value> Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)" Write-Host " -projects <value> Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)"
Write-Host " -ci Set when running on CI server" Write-Host " -ci Set when running on CI server"
Write-Host " -excludeCIBinarylog Don't output binary log (short: -nobl)"
Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build" Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build"
Write-Host " -warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')" Write-Host " -warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)." Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
@ -136,9 +134,7 @@ try {
} }
if ($ci) { if ($ci) {
if (-not $excludeCIBinarylog) { $binaryLog = $true
$binaryLog = $true
}
$nodeReuse = $false $nodeReuse = $false
} }

Просмотреть файл

@ -32,7 +32,6 @@ usage()
echo "Advanced settings:" echo "Advanced settings:"
echo " --projects <value> Project or solution file(s) to build" echo " --projects <value> Project or solution file(s) to build"
echo " --ci Set when running on CI server" echo " --ci Set when running on CI server"
echo " --excludeCIBinarylog Don't output binary log (short: -nobl)"
echo " --prepareMachine Prepare machine for CI run, clean up processes after build" echo " --prepareMachine Prepare machine for CI run, clean up processes after build"
echo " --nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')" echo " --nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')"
echo " --warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')" echo " --warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
@ -69,7 +68,6 @@ clean=false
warn_as_error=true warn_as_error=true
node_reuse=true node_reuse=true
binary_log=false binary_log=false
exclude_ci_binary_log=false
pipelines_log=false pipelines_log=false
projects='' projects=''
@ -100,9 +98,6 @@ while [[ $# > 0 ]]; do
-binarylog|-bl) -binarylog|-bl)
binary_log=true binary_log=true
;; ;;
-excludeCIBinarylog|-nobl)
exclude_ci_binary_log=true
;;
-pipelineslog|-pl) -pipelineslog|-pl)
pipelines_log=true pipelines_log=true
;; ;;
@ -161,10 +156,8 @@ done
if [[ "$ci" == true ]]; then if [[ "$ci" == true ]]; then
pipelines_log=true pipelines_log=true
binary_log=true
node_reuse=false node_reuse=false
if [[ "$exclude_ci_binary_log" == false ]]; then
binary_log=true
fi
fi fi
. "$scriptroot/tools.sh" . "$scriptroot/tools.sh"

Просмотреть файл

@ -9,6 +9,13 @@ if [[ -z "$ROOTFS_DIR" ]]; then
exit 1; exit 1;
fi fi
# Clean-up (TODO-Cleanup: We may already delete $ROOTFS_DIR at ./cross/build-rootfs.sh.)
# hk0110
if [ -d "$ROOTFS_DIR" ]; then
umount $ROOTFS_DIR/*
rm -rf $ROOTFS_DIR
fi
TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp
mkdir -p $TIZEN_TMP_DIR mkdir -p $TIZEN_TMP_DIR

Просмотреть файл

@ -8,10 +8,8 @@ usage()
echo "BuildArch can be: arm(default), armel, arm64, x86" echo "BuildArch can be: arm(default), armel, arm64, x86"
echo "CodeName - optional, Code name for Linux, can be: trusty, xenial(default), zesty, bionic, alpine. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen." echo "CodeName - optional, Code name for Linux, can be: trusty, xenial(default), zesty, bionic, alpine. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen."
echo " for FreeBSD can be: freebsd11 or freebsd12." echo " for FreeBSD can be: freebsd11 or freebsd12."
echo " for illumos can be: illumos."
echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine and FReeBSD" echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine and FReeBSD"
echo "--skipunmount - optional, will skip the unmount of rootfs folder." echo "--skipunmount - optional, will skip the unmount of rootfs folder."
echo "--use-mirror - optional, use mirror URL to fetch resources, when available."
exit 1 exit 1
} }
@ -69,13 +67,6 @@ __FreeBSDPackages+=" libinotify"
__FreeBSDPackages+=" lttng-ust" __FreeBSDPackages+=" lttng-ust"
__FreeBSDPackages+=" krb5" __FreeBSDPackages+=" krb5"
__IllumosPackages="icu-64.2nb2"
__IllumosPackages+=" mit-krb5-1.16.2nb4"
__IllumosPackages+=" openssl-1.1.1e"
__IllumosPackages+=" zlib-1.2.11"
__UseMirror=0
__UnprocessedBuildArgs= __UnprocessedBuildArgs=
while :; do while :; do
if [ $# -le 0 ]; then if [ $# -le 0 ]; then
@ -167,8 +158,8 @@ while :; do
__LLDB_Package="liblldb-6.0-dev" __LLDB_Package="liblldb-6.0-dev"
;; ;;
tizen) tizen)
if [ "$__BuildArch" != "armel" ] && [ "$__BuildArch" != "arm64" ]; then if [ "$__BuildArch" != "armel" ]; then
echo "Tizen is available only for armel and arm64." echo "Tizen is available only for armel."
usage; usage;
exit 1; exit 1;
fi fi
@ -188,11 +179,6 @@ while :; do
__BuildArch=x64 __BuildArch=x64
__SkipUnmount=1 __SkipUnmount=1
;; ;;
illumos)
__CodeName=illumos
__BuildArch=x64
__SkipUnmount=1
;;
--skipunmount) --skipunmount)
__SkipUnmount=1 __SkipUnmount=1
;; ;;
@ -200,9 +186,6 @@ while :; do
shift shift
__RootfsDir=$1 __RootfsDir=$1
;; ;;
--use-mirror)
__UseMirror=1
;;
*) *)
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $1" __UnprocessedBuildArgs="$__UnprocessedBuildArgs $1"
;; ;;
@ -231,9 +214,6 @@ if [ -d "$__RootfsDir" ]; then
rm -rf $__RootfsDir rm -rf $__RootfsDir
fi fi
mkdir -p $__RootfsDir
__RootfsDir="$( cd "$__RootfsDir" && pwd )"
if [[ "$__CodeName" == "alpine" ]]; then if [[ "$__CodeName" == "alpine" ]]; then
__ApkToolsVersion=2.9.1 __ApkToolsVersion=2.9.1
__AlpineVersion=3.9 __AlpineVersion=3.9
@ -277,51 +257,6 @@ elif [[ "$__CodeName" == "freebsd" ]]; then
# install packages we need. # install packages we need.
INSTALL_AS_USER=$(whoami) $__RootfsDir/host/sbin/pkg -r $__RootfsDir -C $__RootfsDir/usr/local/etc/pkg.conf update INSTALL_AS_USER=$(whoami) $__RootfsDir/host/sbin/pkg -r $__RootfsDir -C $__RootfsDir/usr/local/etc/pkg.conf update
INSTALL_AS_USER=$(whoami) $__RootfsDir/host/sbin/pkg -r $__RootfsDir -C $__RootfsDir/usr/local/etc/pkg.conf install --yes $__FreeBSDPackages INSTALL_AS_USER=$(whoami) $__RootfsDir/host/sbin/pkg -r $__RootfsDir -C $__RootfsDir/usr/local/etc/pkg.conf install --yes $__FreeBSDPackages
elif [[ "$__CodeName" == "illumos" ]]; then
mkdir "$__RootfsDir/tmp"
pushd "$__RootfsDir/tmp"
JOBS="$(getconf _NPROCESSORS_ONLN)"
echo "Downloading sysroot."
wget -O - https://github.com/illumos/sysroot/releases/download/20181213-de6af22ae73b-v1/illumos-sysroot-i386-20181213-de6af22ae73b-v1.tar.gz | tar -C "$__RootfsDir" -xzf -
echo "Building binutils. Please wait.."
wget -O - https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf -
mkdir build-binutils && cd build-binutils
../binutils-2.33.1/configure --prefix="$__RootfsDir" --target="x86_64-sun-solaris2.10" --program-prefix="x86_64-illumos-" --with-sysroot="$__RootfsDir"
make -j "$JOBS" && make install && cd ..
echo "Building gcc. Please wait.."
wget -O - https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf -
CFLAGS="-fPIC"
CXXFLAGS="-fPIC"
CXXFLAGS_FOR_TARGET="-fPIC"
CFLAGS_FOR_TARGET="-fPIC"
export CFLAGS CXXFLAGS CXXFLAGS_FOR_TARGET CFLAGS_FOR_TARGET
mkdir build-gcc && cd build-gcc
../gcc-8.4.0/configure --prefix="$__RootfsDir" --target="x86_64-sun-solaris2.10" --program-prefix="x86_64-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \
--with-gnu-ld --disable-nls --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libcilkrts --disable-libada --disable-libsanitizer \
--disable-libquadmath-support --disable-shared --enable-tls
make -j "$JOBS" && make install && cd ..
BaseUrl=https://pkgsrc.joyent.com
if [[ "$__UseMirror" == 1 ]]; then
BaseUrl=http://pkgsrc.smartos.skylime.net
fi
BaseUrl="$BaseUrl"/packages/SmartOS/2020Q1/x86_64/All
echo "Downloading dependencies."
read -ra array <<<"$__IllumosPackages"
for package in "${array[@]}"; do
echo "Installing $package..."
wget "$BaseUrl"/"$package".tgz
ar -x "$package".tgz
tar --skip-old-files -xzf "$package".tmp.tgz -C "$__RootfsDir" 2>/dev/null
done
echo "Cleaning up temporary files."
popd
rm -rf "$__RootfsDir"/{tmp,+*}
mkdir -p "$__RootfsDir"/usr/include/net
mkdir -p "$__RootfsDir"/usr/include/netpacket
wget -P "$__RootfsDir"/usr/include/net https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/io/bpf/net/bpf.h
wget -P "$__RootfsDir"/usr/include/net https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/io/bpf/net/dlt.h
wget -P "$__RootfsDir"/usr/include/netpacket https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/inet/sockmods/netpacket/packet.h
wget -P "$__RootfsDir"/usr/include/sys https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/sys/sdt.h
elif [[ -n $__CodeName ]]; then elif [[ -n $__CodeName ]]; then
qemu-debootstrap --arch $__UbuntuArch $__CodeName $__RootfsDir $__UbuntuRepo qemu-debootstrap --arch $__UbuntuArch $__CodeName $__RootfsDir $__UbuntuRepo
cp $__CrossDir/$__BuildArch/sources.list.$__CodeName $__RootfsDir/etc/apt/sources.list cp $__CrossDir/$__BuildArch/sources.list.$__CodeName $__RootfsDir/etc/apt/sources.list
@ -340,7 +275,7 @@ elif [[ -n $__CodeName ]]; then
patch -p1 < $__CrossDir/$__BuildArch/trusty-lttng-2.4.patch patch -p1 < $__CrossDir/$__BuildArch/trusty-lttng-2.4.patch
popd popd
fi fi
elif [[ "$__Tizen" == "tizen" ]]; then elif [ "$__Tizen" == "tizen" ]; then
ROOTFS_DIR=$__RootfsDir $__CrossDir/$__BuildArch/tizen-build-rootfs.sh ROOTFS_DIR=$__RootfsDir $__CrossDir/$__BuildArch/tizen-build-rootfs.sh
else else
echo "Unsupported target platform." echo "Unsupported target platform."

Просмотреть файл

@ -3,9 +3,6 @@ set(CROSS_ROOTFS $ENV{ROOTFS_DIR})
set(TARGET_ARCH_NAME $ENV{TARGET_BUILD_ARCH}) set(TARGET_ARCH_NAME $ENV{TARGET_BUILD_ARCH})
if(EXISTS ${CROSS_ROOTFS}/bin/freebsd-version) if(EXISTS ${CROSS_ROOTFS}/bin/freebsd-version)
set(CMAKE_SYSTEM_NAME FreeBSD) set(CMAKE_SYSTEM_NAME FreeBSD)
elseif(EXISTS ${CROSS_ROOTFS}/usr/platform/i86pc)
set(CMAKE_SYSTEM_NAME SunOS)
set(ILLUMOS 1)
else() else()
set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_NAME Linux)
endif() endif()
@ -31,18 +28,12 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64")
else() else()
set(TOOLCHAIN "aarch64-linux-gnu") set(TOOLCHAIN "aarch64-linux-gnu")
endif() endif()
if("$ENV{__DistroRid}" MATCHES "tizen.*")
set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/9.2.0")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "x86") elseif(TARGET_ARCH_NAME STREQUAL "x86")
set(CMAKE_SYSTEM_PROCESSOR i686) set(CMAKE_SYSTEM_PROCESSOR i686)
set(TOOLCHAIN "i686-linux-gnu") set(TOOLCHAIN "i686-linux-gnu")
elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(CMAKE_SYSTEM_PROCESSOR "x86_64") set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(triple "x86_64-unknown-freebsd11") set(triple "x86_64-unknown-freebsd11")
elseif (ILLUMOS)
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(TOOLCHAIN "x86_64-illumos")
else() else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64 and x86 are supported!") message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64 and x86 are supported!")
endif() endif()
@ -52,15 +43,11 @@ if(DEFINED ENV{TOOLCHAIN})
endif() endif()
# Specify include paths # Specify include paths
if(DEFINED TIZEN_TOOLCHAIN) if(TARGET_ARCH_NAME STREQUAL "armel")
if(TARGET_ARCH_NAME STREQUAL "armel") if(DEFINED TIZEN_TOOLCHAIN)
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/) include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi) include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi)
endif() endif()
if(TARGET_ARCH_NAME STREQUAL "arm64")
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}/include/c++/aarch64-tizen-linux-gnu)
endif()
endif() endif()
if("$ENV{__DistroRid}" MATCHES "android.*") if("$ENV{__DistroRid}" MATCHES "android.*")
@ -80,43 +67,12 @@ if("$ENV{__DistroRid}" MATCHES "android.*")
# include official NDK toolchain script # include official NDK toolchain script
include(${CROSS_ROOTFS}/../build/cmake/android.toolchain.cmake) include(${CROSS_ROOTFS}/../build/cmake/android.toolchain.cmake)
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
# we cross-compile by instructing clang # we cross-compile by instructing clang
set(CMAKE_C_COMPILER_TARGET ${triple}) set(CMAKE_C_COMPILER_TARGET ${triple})
set(CMAKE_CXX_COMPILER_TARGET ${triple}) set(CMAKE_CXX_COMPILER_TARGET ${triple})
set(CMAKE_ASM_COMPILER_TARGET ${triple}) set(CMAKE_ASM_COMPILER_TARGET ${triple})
set(CMAKE_SYSROOT "${CROSS_ROOTFS}") set(CMAKE_SYSROOT "${CROSS_ROOTFS}")
elseif(ILLUMOS)
set(CMAKE_SYSROOT "${CROSS_ROOTFS}")
include_directories(SYSTEM ${CROSS_ROOTFS}/include)
set(TOOLSET_PREFIX ${TOOLCHAIN}-)
function(locate_toolchain_exec exec var)
string(TOUPPER ${exec} EXEC_UPPERCASE)
if(NOT "$ENV{CLR_${EXEC_UPPERCASE}}" STREQUAL "")
set(${var} "$ENV{CLR_${EXEC_UPPERCASE}}" PARENT_SCOPE)
return()
endif()
find_program(EXEC_LOCATION_${exec}
NAMES
"${TOOLSET_PREFIX}${exec}${CLR_CMAKE_COMPILER_FILE_NAME_VERSION}"
"${TOOLSET_PREFIX}${exec}")
if (EXEC_LOCATION_${exec} STREQUAL "EXEC_LOCATION_${exec}-NOTFOUND")
message(FATAL_ERROR "Unable to find toolchain executable. Name: ${exec}, Prefix: ${TOOLSET_PREFIX}.")
endif()
set(${var} ${EXEC_LOCATION_${exec}} PARENT_SCOPE)
endfunction()
set(CMAKE_SYSTEM_PREFIX_PATH "${CROSS_ROOTFS}")
locate_toolchain_exec(gcc CMAKE_C_COMPILER)
locate_toolchain_exec(g++ CMAKE_CXX_COMPILER)
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lssp")
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lssp")
else() else()
set(CMAKE_SYSROOT "${CROSS_ROOTFS}") set(CMAKE_SYSROOT "${CROSS_ROOTFS}")
@ -134,27 +90,13 @@ if(TARGET_ARCH_NAME STREQUAL "armel")
add_link_options("-L${CROSS_ROOTFS}/usr/lib") add_link_options("-L${CROSS_ROOTFS}/usr/lib")
add_link_options("-L${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}") add_link_options("-L${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
endif() endif()
elseif(TARGET_ARCH_NAME STREQUAL "arm64")
if(DEFINED TIZEN_TOOLCHAIN) # For Tizen only
add_link_options("-B${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
add_link_options("-L${CROSS_ROOTFS}/lib64")
add_link_options("-L${CROSS_ROOTFS}/usr/lib64")
add_link_options("-L${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
add_link_options("-Wl,--rpath-link=${CROSS_ROOTFS}/lib64")
add_link_options("-Wl,--rpath-link=${CROSS_ROOTFS}/usr/lib64")
add_link_options("-Wl,--rpath-link=${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "x86") elseif(TARGET_ARCH_NAME STREQUAL "x86")
add_link_options(-m32) add_link_options(-m32)
elseif(ILLUMOS)
add_link_options("-L${CROSS_ROOTFS}/lib/amd64")
add_link_options("-L${CROSS_ROOTFS}/usr/amd64/lib")
endif() endif()
# Specify compile options # Specify compile options
if((TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$" AND NOT "$ENV{__DistroRid}" MATCHES "android.*") OR ILLUMOS) if(TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$" AND NOT "$ENV{__DistroRid}" MATCHES "android.*")
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN})
@ -175,19 +117,16 @@ if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$")
if(TARGET_ARCH_NAME STREQUAL "armel") if(TARGET_ARCH_NAME STREQUAL "armel")
add_compile_options(-mfloat-abi=softfp) add_compile_options(-mfloat-abi=softfp)
if(DEFINED TIZEN_TOOLCHAIN)
add_compile_options(-Wno-deprecated-declarations) # compile-time option
add_compile_options(-D__extern_always_inline=inline) # compile-time option
endif()
endif() endif()
elseif(TARGET_ARCH_NAME STREQUAL "x86") elseif(TARGET_ARCH_NAME STREQUAL "x86")
add_compile_options(-m32) add_compile_options(-m32)
add_compile_options(-Wno-error=unused-command-line-argument) add_compile_options(-Wno-error=unused-command-line-argument)
endif() endif()
if(DEFINED TIZEN_TOOLCHAIN)
if(TARGET_ARCH_NAME MATCHES "^(armel|arm64)$")
add_compile_options(-Wno-deprecated-declarations) # compile-time option
add_compile_options(-D__extern_always_inline=inline) # compile-time option
endif()
endif()
# Set LLDB include and library paths for builds that need lldb. # Set LLDB include and library paths for builds that need lldb.
if(TARGET_ARCH_NAME MATCHES "^(arm|armel|x86)$") if(TARGET_ARCH_NAME MATCHES "^(arm|armel|x86)$")
if(TARGET_ARCH_NAME STREQUAL "x86") if(TARGET_ARCH_NAME STREQUAL "x86")
@ -216,6 +155,7 @@ if(TARGET_ARCH_NAME MATCHES "^(arm|armel|x86)$")
endif() endif()
endif() endif()
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Просмотреть файл

@ -63,7 +63,6 @@ function SetupCredProvider {
} }
if (($endpoints | Measure-Object).Count -gt 0) { if (($endpoints | Measure-Object).Count -gt 0) {
# [SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Endpoint code example with no real credentials.")]
# Create the JSON object. It should look like '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}' # Create the JSON object. It should look like '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}'
$endpointCredentials = @{endpointCredentials=$endpoints} | ConvertTo-Json -Compress $endpointCredentials = @{endpointCredentials=$endpoints} | ConvertTo-Json -Compress

Просмотреть файл

@ -62,7 +62,6 @@ function SetupCredProvider {
endpoints+=']' endpoints+=']'
if [ ${#endpoints} -gt 2 ]; then if [ ${#endpoints} -gt 2 ]; then
# [SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Endpoint code example with no real credentials.")]
# Create the JSON object. It should look like '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}' # Create the JSON object. It should look like '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}'
local endpointCredentials="{\"endpointCredentials\": "$endpoints"}" local endpointCredentials="{\"endpointCredentials\": "$endpoints"}"

Просмотреть файл

@ -4,7 +4,6 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net472</TargetFramework> <TargetFramework>net472</TargetFramework>
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets> <ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
<AutomaticallyUseReferenceAssemblyPackages>false</AutomaticallyUseReferenceAssemblyPackages>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<!-- Clear references, the SDK may add some depending on UsuingToolXxx settings, but we only want to restore the following --> <!-- Clear references, the SDK may add some depending on UsuingToolXxx settings, but we only want to restore the following -->

Просмотреть файл

@ -145,12 +145,9 @@ function Get-File {
New-Item -path $DownloadDirectory -force -itemType "Directory" | Out-Null New-Item -path $DownloadDirectory -force -itemType "Directory" | Out-Null
} }
$TempPath = "$Path.tmp"
if (Test-Path -IsValid -Path $Uri) { if (Test-Path -IsValid -Path $Uri) {
Write-Verbose "'$Uri' is a file path, copying temporarily to '$TempPath'" Write-Verbose "'$Uri' is a file path, copying file to '$Path'"
Copy-Item -Path $Uri -Destination $TempPath Copy-Item -Path $Uri -Destination $Path
Write-Verbose "Moving temporary file to '$Path'"
Move-Item -Path $TempPath -Destination $Path
return $? return $?
} }
else { else {
@ -160,10 +157,8 @@ function Get-File {
while($Attempt -Lt $DownloadRetries) while($Attempt -Lt $DownloadRetries)
{ {
try { try {
Invoke-WebRequest -UseBasicParsing -Uri $Uri -OutFile $TempPath Invoke-WebRequest -UseBasicParsing -Uri $Uri -OutFile $Path
Write-Verbose "Downloaded to temporary location '$TempPath'" Write-Verbose "Downloaded to '$Path'"
Move-Item -Path $TempPath -Destination $Path
Write-Verbose "Moved temporary file to '$Path'"
return $True return $True
} }
catch { catch {
@ -364,21 +359,16 @@ function Expand-Zip {
return $False return $False
} }
} }
if (-Not (Test-Path $OutputDirectory)) {
$TempOutputDirectory = Join-Path "$(Split-Path -Parent $OutputDirectory)" "$(Split-Path -Leaf $OutputDirectory).tmp" New-Item -path $OutputDirectory -Force -itemType "Directory" | Out-Null
if (Test-Path $TempOutputDirectory) {
Remove-Item $TempOutputDirectory -Force -Recurse
} }
New-Item -Path $TempOutputDirectory -Force -ItemType "Directory" | Out-Null
Add-Type -assembly "system.io.compression.filesystem" Add-Type -assembly "system.io.compression.filesystem"
[io.compression.zipfile]::ExtractToDirectory("$ZipPath", "$TempOutputDirectory") [io.compression.zipfile]::ExtractToDirectory("$ZipPath", "$OutputDirectory")
if ($? -Eq $False) { if ($? -Eq $False) {
Write-Error "Unable to extract '$ZipPath'" Write-Error "Unable to extract '$ZipPath'"
return $False return $False
} }
Move-Item -Path $TempOutputDirectory -Destination $OutputDirectory
} }
catch { catch {
Write-Host $_ Write-Host $_

Просмотреть файл

@ -6,7 +6,6 @@
<Python>py -3</Python> <Python>py -3</Python>
<CoreRun>%HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe</CoreRun> <CoreRun>%HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe</CoreRun>
<BaselineCoreRun>%HELIX_CORRELATION_PAYLOAD%\Baseline_Core_Root\CoreRun.exe</BaselineCoreRun> <BaselineCoreRun>%HELIX_CORRELATION_PAYLOAD%\Baseline_Core_Root\CoreRun.exe</BaselineCoreRun>
<HelixPreCommands>$(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd;set PYTHONPATH=%HELIX_WORKITEM_PAYLOAD%\scripts%3B%HELIX_WORKITEM_PAYLOAD%</HelixPreCommands> <HelixPreCommands>$(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd;set PYTHONPATH=%HELIX_WORKITEM_PAYLOAD%\scripts%3B%HELIX_WORKITEM_PAYLOAD%</HelixPreCommands>
<ArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts</ArtifactsDirectory> <ArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts</ArtifactsDirectory>
<BaselineArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts_Baseline</BaselineArtifactsDirectory> <BaselineArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts_Baseline</BaselineArtifactsDirectory>
@ -41,13 +40,6 @@
<XMLResults>$HELIX_WORKITEM_ROOT/testResults.xml</XMLResults> <XMLResults>$HELIX_WORKITEM_ROOT/testResults.xml</XMLResults>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(MonoDotnet)' == 'true' and '$(AGENT_OS)' == 'Windows_NT'">
<CoreRunArgument>--corerun %HELIX_CORRELATION_PAYLOAD%\dotnet-mono\shared\Microsoft.NETCore.App\5.0.0\corerun.exe</CoreRunArgument>
</PropertyGroup>
<PropertyGroup Condition="'$(MonoDotnet)' == 'true' and '$(AGENT_OS)' != 'Windows_NT'">
<CoreRunArgument>--corerun $(BaseDirectory)/dotnet-mono/shared/Microsoft.NETCore.App/5.0.0/corerun</CoreRunArgument>
</PropertyGroup>
<PropertyGroup Condition="'$(UseCoreRun)' == 'true'"> <PropertyGroup Condition="'$(UseCoreRun)' == 'true'">
<CoreRunArgument>--corerun $(CoreRun)</CoreRunArgument> <CoreRunArgument>--corerun $(CoreRun)</CoreRunArgument>
</PropertyGroup> </PropertyGroup>
@ -63,11 +55,6 @@
<PropertyGroup Condition="'$(_Framework)' != 'net461'"> <PropertyGroup Condition="'$(_Framework)' != 'net461'">
<WorkItemCommand>$(WorkItemCommand) $(CliArguments)</WorkItemCommand> <WorkItemCommand>$(WorkItemCommand) $(CliArguments)</WorkItemCommand>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<WorkItemTimeout>2:30</WorkItemTimeout>
<WorkItemTimeout Condition="'$(HelixSourcePrefix)' != 'official'">0:15</WorkItemTimeout>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<HelixCorrelationPayload Include="$(CorrelationPayloadDirectory)"> <HelixCorrelationPayload Include="$(CorrelationPayloadDirectory)">
@ -76,7 +63,7 @@
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
<PartitionCount>30</PartitionCount> <PartitionCount>5</PartitionCount>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Partition Include="$(BuildConfig).Partition0" Index="0" /> <Partition Include="$(BuildConfig).Partition0" Index="0" />
@ -84,31 +71,6 @@
<Partition Include="$(BuildConfig).Partition2" Index="2" /> <Partition Include="$(BuildConfig).Partition2" Index="2" />
<Partition Include="$(BuildConfig).Partition3" Index="3" /> <Partition Include="$(BuildConfig).Partition3" Index="3" />
<Partition Include="$(BuildConfig).Partition4" Index="4" /> <Partition Include="$(BuildConfig).Partition4" Index="4" />
<Partition Include="$(BuildConfig).Partition5" Index="5" />
<Partition Include="$(BuildConfig).Partition6" Index="6" />
<Partition Include="$(BuildConfig).Partition7" Index="7" />
<Partition Include="$(BuildConfig).Partition8" Index="8" />
<Partition Include="$(BuildConfig).Partition9" Index="9" />
<Partition Include="$(BuildConfig).Partition10" Index="10" />
<Partition Include="$(BuildConfig).Partition11" Index="11" />
<Partition Include="$(BuildConfig).Partition12" Index="12" />
<Partition Include="$(BuildConfig).Partition13" Index="13" />
<Partition Include="$(BuildConfig).Partition14" Index="14" />
<Partition Include="$(BuildConfig).Partition15" Index="15" />
<Partition Include="$(BuildConfig).Partition16" Index="16" />
<Partition Include="$(BuildConfig).Partition17" Index="17" />
<Partition Include="$(BuildConfig).Partition18" Index="18" />
<Partition Include="$(BuildConfig).Partition19" Index="19" />
<Partition Include="$(BuildConfig).Partition20" Index="20" />
<Partition Include="$(BuildConfig).Partition21" Index="21" />
<Partition Include="$(BuildConfig).Partition22" Index="22" />
<Partition Include="$(BuildConfig).Partition23" Index="23" />
<Partition Include="$(BuildConfig).Partition24" Index="24" />
<Partition Include="$(BuildConfig).Partition25" Index="25" />
<Partition Include="$(BuildConfig).Partition26" Index="26" />
<Partition Include="$(BuildConfig).Partition27" Index="27" />
<Partition Include="$(BuildConfig).Partition28" Index="28" />
<Partition Include="$(BuildConfig).Partition29" Index="29" />
</ItemGroup> </ItemGroup>
<PropertyGroup Condition="'$(Compare)' == 'true'"> <PropertyGroup Condition="'$(Compare)' == 'true'">
@ -124,7 +86,7 @@
<PreCommands Condition="'$(Compare)' == 'true'">$(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"</PreCommands> <PreCommands Condition="'$(Compare)' == 'true'">$(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"</PreCommands>
<Command>$(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"</Command> <Command>$(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"</Command>
<PostCommands Condition="'$(Compare)' == 'true'">$(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults);$(FinalCommand)</PostCommands> <PostCommands Condition="'$(Compare)' == 'true'">$(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults);$(FinalCommand)</PostCommands>
<Timeout>$(WorkItemTimeout)</Timeout> <Timeout>4:00</Timeout>
</HelixWorkItem> </HelixWorkItem>
</ItemGroup> </ItemGroup>
@ -143,50 +105,17 @@
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory> <PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Private.Xml.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command> <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Private.Xml.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem> </HelixWorkItem>
<HelixWorkItem Include="Crossgen System.Linq.Expressions.dll"> <HelixWorkItem Include="Crossgen System.Linq.Expressions.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory> <PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Linq.Expressions.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command> <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Linq.Expressions.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem> </HelixWorkItem>
<HelixWorkItem Include="Crossgen Microsoft.CodeAnalysis.VisualBasic.dll"> <HelixWorkItem Include="Crossgen Microsoft.CodeAnalysis.VisualBasic.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory> <PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.VisualBasic.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command> <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.VisualBasic.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem> </HelixWorkItem>
<HelixWorkItem Include="Crossgen Microsoft.CodeAnalysis.CSharp.dll"> <HelixWorkItem Include="Crossgen Microsoft.CodeAnalysis.CSharp.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory> <PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.CSharp.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command> <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.CSharp.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem> </HelixWorkItem>
<HelixWorkItem Include="Crossgen System.Private.CoreLib.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Private.CoreLib.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
</ItemGroup>
<ItemGroup Condition="'$(AGENT_OS)' == 'Windows_NT' and '$(Architecture)' == 'x64'">
<HelixWorkItem Include="Crossgen2 System.Private.Xml.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\test.py crossgen2 --single System.Private.Xml.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
<HelixWorkItem Include="Crossgen2 System.Linq.Expressions.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\test.py crossgen2 --single System.Linq.Expressions.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
<HelixWorkItem Include="Crossgen2 Microsoft.CodeAnalysis.VisualBasic.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\test.py crossgen2 --single Microsoft.CodeAnalysis.VisualBasic.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
<HelixWorkItem Include="Crossgen2 Microsoft.CodeAnalysis.CSharp.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\test.py crossgen2 --single Microsoft.CodeAnalysis.CSharp.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
<HelixWorkItem Include="Crossgen2 System.Private.CoreLib.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\test.py crossgen2 --single System.Private.CoreLib.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
<HelixWorkItem Include="Crossgen2 Composite Framework R2R">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\test.py crossgen2 --composite %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\framework-r2r.dll.rsp --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
<Timeout>1:00</Timeout>
</HelixWorkItem>
</ItemGroup> </ItemGroup>
</Project> </Project>

Просмотреть файл

@ -3,7 +3,7 @@ Param(
[string] $CoreRootDirectory, [string] $CoreRootDirectory,
[string] $BaselineCoreRootDirectory, [string] $BaselineCoreRootDirectory,
[string] $Architecture="x64", [string] $Architecture="x64",
[string] $Framework="net5.0", [string] $Framework="netcoreapp5.0",
[string] $CompilationMode="Tiered", [string] $CompilationMode="Tiered",
[string] $Repository=$env:BUILD_REPOSITORY_NAME, [string] $Repository=$env:BUILD_REPOSITORY_NAME,
[string] $Branch=$env:BUILD_SOURCEBRANCH, [string] $Branch=$env:BUILD_SOURCEBRANCH,
@ -12,12 +12,8 @@ Param(
[string] $RunCategories="Libraries Runtime", [string] $RunCategories="Libraries Runtime",
[string] $Csproj="src\benchmarks\micro\MicroBenchmarks.csproj", [string] $Csproj="src\benchmarks\micro\MicroBenchmarks.csproj",
[string] $Kind="micro", [string] $Kind="micro",
[switch] $LLVM,
[switch] $MonoInterpreter,
[switch] $MonoAOT,
[switch] $Internal, [switch] $Internal,
[switch] $Compare, [switch] $Compare,
[string] $MonoDotnet="",
[string] $Configurations="CompilationMode=$CompilationMode RunKind=$Kind" [string] $Configurations="CompilationMode=$CompilationMode RunKind=$Kind"
) )
@ -35,8 +31,7 @@ $HelixSourcePrefix = "pr"
$Queue = "Windows.10.Amd64.ClientRS4.DevEx.15.8.Open" $Queue = "Windows.10.Amd64.ClientRS4.DevEx.15.8.Open"
# TODO: Implement a better logic to determine if Framework is .NET Core or >= .NET 5. if ($Framework.StartsWith("netcoreapp")) {
if ($Framework.StartsWith("netcoreapp") -or ($Framework -eq "net5.0")) {
$Queue = "Windows.10.Amd64.ClientRS5.Open" $Queue = "Windows.10.Amd64.ClientRS5.Open"
} }
@ -54,21 +49,6 @@ if ($Internal) {
$HelixSourcePrefix = "official" $HelixSourcePrefix = "official"
} }
if($MonoDotnet -ne "")
{
$Configurations += " LLVM=$LLVM MonoInterpreter=$MonoInterpreter MonoAOT=$MonoAOT"
if($ExtraBenchmarkDotNetArguments -eq "")
{
#FIX ME: We need to block these tests as they don't run on mono for now
$ExtraBenchmarkDotNetArguments = "--exclusion-filter *Perf_Image* *Perf_NamedPipeStream*"
}
else
{
#FIX ME: We need to block these tests as they don't run on mono for now
$ExtraBenchmarkDotNetArguments += " --exclusion-filter *Perf_Image* *Perf_NamedPipeStream*"
}
}
# FIX ME: This is a workaround until we get this from the actual pipeline # FIX ME: This is a workaround until we get this from the actual pipeline
$CommonSetupArguments="--channel master --queue $Queue --build-number $BuildNumber --build-configs $Configurations --architecture $Architecture" $CommonSetupArguments="--channel master --queue $Queue --build-number $BuildNumber --build-configs $Configurations --architecture $Architecture"
$SetupArguments = "--repository https://github.com/$Repository --branch $Branch --get-perf-hash --commit-sha $CommitSha $CommonSetupArguments" $SetupArguments = "--repository https://github.com/$Repository --branch $Branch --get-perf-hash --commit-sha $CommitSha $CommonSetupArguments"
@ -89,13 +69,6 @@ else {
git clone --branch master --depth 1 --quiet https://github.com/dotnet/performance $PerformanceDirectory git clone --branch master --depth 1 --quiet https://github.com/dotnet/performance $PerformanceDirectory
} }
if($MonoDotnet -ne "")
{
$UsingMono = "true"
$MonoDotnetPath = (Join-Path $PayloadDirectory "dotnet-mono")
Move-Item -Path $MonoDotnet -Destination $MonoDotnetPath
}
if ($UseCoreRun) { if ($UseCoreRun) {
$NewCoreRoot = (Join-Path $PayloadDirectory "Core_Root") $NewCoreRoot = (Join-Path $PayloadDirectory "Core_Root")
Move-Item -Path $CoreRootDirectory -Destination $NewCoreRoot Move-Item -Path $CoreRootDirectory -Destination $NewCoreRoot
@ -131,7 +104,6 @@ Write-PipelineSetVariable -Name 'UseCoreRun' -Value "$UseCoreRun" -IsMultiJobVar
Write-PipelineSetVariable -Name 'UseBaselineCoreRun' -Value "$UseBaselineCoreRun" -IsMultiJobVariable $false Write-PipelineSetVariable -Name 'UseBaselineCoreRun' -Value "$UseBaselineCoreRun" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'RunFromPerfRepo' -Value "$RunFromPerformanceRepo" -IsMultiJobVariable $false Write-PipelineSetVariable -Name 'RunFromPerfRepo' -Value "$RunFromPerformanceRepo" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'Compare' -Value "$Compare" -IsMultiJobVariable $false Write-PipelineSetVariable -Name 'Compare' -Value "$Compare" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'MonoDotnet' -Value "$UsingMono" -IsMultiJobVariable $false
# Helix Arguments # Helix Arguments
Write-PipelineSetVariable -Name 'Creator' -Value "$Creator" -IsMultiJobVariable $false Write-PipelineSetVariable -Name 'Creator' -Value "$Creator" -IsMultiJobVariable $false

Просмотреть файл

@ -4,7 +4,7 @@ source_directory=$BUILD_SOURCESDIRECTORY
core_root_directory= core_root_directory=
baseline_core_root_directory= baseline_core_root_directory=
architecture=x64 architecture=x64
framework=net5.0 framework=netcoreapp5.0
compilation_mode=tiered compilation_mode=tiered
repository=$BUILD_REPOSITORY_NAME repository=$BUILD_REPOSITORY_NAME
branch=$BUILD_SOURCEBRANCH branch=$BUILD_SOURCEBRANCH
@ -12,18 +12,13 @@ commit_sha=$BUILD_SOURCEVERSION
build_number=$BUILD_BUILDNUMBER build_number=$BUILD_BUILDNUMBER
internal=false internal=false
compare=false compare=false
mono_dotnet=
kind="micro" kind="micro"
llvm=false
monointerpreter=false
monoaot=false
run_categories="Libraries Runtime" run_categories="Libraries Runtime"
csproj="src\benchmarks\micro\MicroBenchmarks.csproj" csproj="src\benchmarks\micro\MicroBenchmarks.csproj"
configurations="CompliationMode=$compilation_mode RunKind=$kind" configurations="CompliationMode=$compilation_mode RunKind=$kind"
run_from_perf_repo=false run_from_perf_repo=false
use_core_run=true use_core_run=true
use_baseline_core_run=true use_baseline_core_run=true
using_mono=false
while (($# > 0)); do while (($# > 0)); do
lowerI="$(echo $1 | awk '{print tolower($0)}')" lowerI="$(echo $1 | awk '{print tolower($0)}')"
@ -70,7 +65,6 @@ while (($# > 0)); do
;; ;;
--kind) --kind)
kind=$2 kind=$2
configurations="CompliationMode=$compilation_mode RunKind=$kind"
shift 2 shift 2
;; ;;
--runcategories) --runcategories)
@ -85,22 +79,6 @@ while (($# > 0)); do
internal=true internal=true
shift 1 shift 1
;; ;;
--llvm)
llvm=true
shift 1
;;
--monointerpreter)
monointerpreter=true
shift 1
;;
--monoaot)
monoaot=true
shift 1
;;
--monodotnet)
mono_dotnet=$2
shift 2
;;
--compare) --compare)
compare=true compare=true
shift 1 shift 1
@ -129,7 +107,6 @@ while (($# > 0)); do
echo " --kind <value> Related to csproj. The kind of benchmarks that should be run. Defaults to micro" echo " --kind <value> Related to csproj. The kind of benchmarks that should be run. Defaults to micro"
echo " --runcategories <value> Related to csproj. Categories of benchmarks to run. Defaults to \"coreclr corefx\"" echo " --runcategories <value> Related to csproj. Categories of benchmarks to run. Defaults to \"coreclr corefx\""
echo " --internal If the benchmarks are running as an official job." echo " --internal If the benchmarks are running as an official job."
echo " --monodotnet Pass the path to the mono dotnet for mono performance testing."
echo "" echo ""
exit 0 exit 0
;; ;;
@ -187,10 +164,6 @@ if [[ "$internal" == true ]]; then
fi fi
fi fi
if [[ "$mono_dotnet" != "" ]]; then
configurations="$configurations LLVM=$llvm MonoInterpreter=$monointerpreter MonoAOT=$monoaot"
fi
common_setup_arguments="--channel master --queue $queue --build-number $build_number --build-configs $configurations --architecture $architecture" common_setup_arguments="--channel master --queue $queue --build-number $build_number --build-configs $configurations --architecture $architecture"
setup_arguments="--repository https://github.com/$repository --branch $branch --get-perf-hash --commit-sha $commit_sha $common_setup_arguments" setup_arguments="--repository https://github.com/$repository --branch $branch --get-perf-hash --commit-sha $commit_sha $common_setup_arguments"
@ -213,12 +186,6 @@ else
mv $docs_directory $workitem_directory mv $docs_directory $workitem_directory
fi fi
if [[ "$mono_dotnet" != "" ]]; then
using_mono=true
mono_dotnet_path=$payload_directory/dotnet-mono
mv $mono_dotnet $mono_dotnet_path
fi
if [[ "$use_core_run" = true ]]; then if [[ "$use_core_run" = true ]]; then
new_core_root=$payload_directory/Core_Root new_core_root=$payload_directory/Core_Root
mv $core_root_directory $new_core_root mv $core_root_directory $new_core_root
@ -254,4 +221,3 @@ Write-PipelineSetVariable -name "HelixSourcePrefix" -value "$helix_source_prefix
Write-PipelineSetVariable -name "Kind" -value "$kind" -is_multi_job_variable false Write-PipelineSetVariable -name "Kind" -value "$kind" -is_multi_job_variable false
Write-PipelineSetVariable -name "_BuildConfig" -value "$architecture.$kind.$framework" -is_multi_job_variable false Write-PipelineSetVariable -name "_BuildConfig" -value "$architecture.$kind.$framework" -is_multi_job_variable false
Write-PipelineSetVariable -name "Compare" -value "$compare" -is_multi_job_variable false Write-PipelineSetVariable -name "Compare" -value "$compare" -is_multi_job_variable false
Write-PipelineSetVariable -name "MonoDotnet" -value "$using_mono" -is_multi_job_variable false

Просмотреть файл

@ -31,21 +31,26 @@ function Write-PipelineTelemetryError {
return return
fi fi
message="(NETCORE_ENGINEERING_TELEMETRY=$telemetry_category) $message"
function_args+=("$message")
if [[ $force == true ]]; then if [[ $force == true ]]; then
function_args+=("-force") function_args+=("-force")
fi fi
message="(NETCORE_ENGINEERING_TELEMETRY=$telemetry_category) $message"
function_args+=("$message") Write-PipelineTaskError $function_args
Write-PipelineTaskError ${function_args[@]}
} }
function Write-PipelineTaskError { function Write-PipelineTaskError {
if [[ $force != true ]] && [[ "$ci" != true ]]; then
echo "$@" >&2
return
fi
local message_type="error" local message_type="error"
local sourcepath='' local sourcepath=''
local linenumber='' local linenumber=''
local columnnumber='' local columnnumber=''
local error_code='' local error_code=''
local force=false
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')" opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
@ -70,9 +75,6 @@ function Write-PipelineTaskError {
error_code=$2 error_code=$2
shift shift
;; ;;
-force|-f)
force=true
;;
*) *)
break break
;; ;;
@ -81,11 +83,6 @@ function Write-PipelineTaskError {
shift shift
done done
if [[ $force != true ]] && [[ "$ci" != true ]]; then
echo "$@" >&2
return
fi
local message="##vso[task.logissue" local message="##vso[task.logissue"
message="$message type=$message_type" message="$message type=$message_type"

Просмотреть файл

@ -15,22 +15,12 @@ try {
# is available in YAML # is available in YAML
$PromoteToChannelsIds = $PromoteToChannels -split "\D" | Where-Object { $_ } $PromoteToChannelsIds = $PromoteToChannels -split "\D" | Where-Object { $_ }
$hasErrors = $false
foreach ($id in $PromoteToChannelsIds) { foreach ($id in $PromoteToChannelsIds) {
if (($id -ne 0) -and ($id -notin $AvailableChannelIds)) { if (($id -ne 0) -and ($id -notin $AvailableChannelIds)) {
Write-PipelineTaskError -Message "Channel $id is not present in the post-build YAML configuration! This is an error scenario. Please contact @dnceng." Write-PipelineTaskError -Message "Channel $id is not present in the post-build YAML configuration! This is an error scenario. Please contact @dnceng."
$hasErrors = $true
} }
} }
# The `Write-PipelineTaskError` doesn't error the script and we might report several errors
# in the previous lines. The check below makes sure that we return an error state from the
# script if we reported any validation error
if ($hasErrors) {
ExitWithExitCode 1
}
Write-Host 'done.' Write-Host 'done.'
} }
catch { catch {

Просмотреть файл

@ -1,71 +0,0 @@
param(
[Parameter(Mandatory=$true)][int] $BuildId,
[Parameter(Mandatory=$true)][string] $AzdoToken,
[Parameter(Mandatory=$true)][string] $MaestroToken,
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com',
[Parameter(Mandatory=$true)][string] $WaitPublishingFinish,
[Parameter(Mandatory=$true)][string] $EnableSourceLinkValidation,
[Parameter(Mandatory=$true)][string] $EnableSigningValidation,
[Parameter(Mandatory=$true)][string] $EnableNugetValidation,
[Parameter(Mandatory=$true)][string] $PublishInstallersAndChecksums,
[Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters,
[Parameter(Mandatory=$false)][string] $SigningValidationAdditionalParameters
)
try {
. $PSScriptRoot\post-build-utils.ps1
. $PSScriptRoot\..\darc-init.ps1
$optionalParams = [System.Collections.ArrayList]::new()
if ("" -ne $ArtifactsPublishingAdditionalParameters) {
$optionalParams.Add("artifact-publishing-parameters") | Out-Null
$optionalParams.Add($ArtifactsPublishingAdditionalParameters) | Out-Null
}
if ("false" -eq $WaitPublishingFinish) {
$optionalParams.Add("--no-wait") | Out-Null
}
if ("true" -eq $PublishInstallersAndChecksums) {
$optionalParams.Add("--publish-installers-and-checksums") | Out-Null
}
if ("true" -eq $EnableNugetValidation) {
$optionalParams.Add("--validate-nuget") | Out-Null
}
if ("true" -eq $EnableSourceLinkValidation) {
$optionalParams.Add("--validate-sourcelinkchecksums") | Out-Null
}
if ("true" -eq $EnableSigningValidation) {
$optionalParams.Add("--validate-signingchecksums") | Out-Null
if ("" -ne $SigningValidationAdditionalParameters) {
$optionalParams.Add("--signing-validation-parameters") | Out-Null
$optionalParams.Add($SigningValidationAdditionalParameters) | Out-Null
}
}
& darc add-build-to-channel `
--id $buildId `
--default-channels `
--source-branch master `
--azdev-pat $AzdoToken `
--bar-uri $MaestroApiEndPoint `
--password $MaestroToken `
@optionalParams
if ($LastExitCode -ne 0) {
Write-Host "Problems using Darc to promote build ${buildId} to default channels. Stopping execution..."
exit 1
}
Write-Host 'done.'
}
catch {
Write-Host $_
Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "There was an error while trying to publish build '$BuildId' to default channels."
ExitWithExitCode 1
}

Просмотреть файл

@ -196,8 +196,6 @@ function ValidateSourceLinkLinks {
Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue
} }
$ValidationFailures = 0
# Process each NuGet package in parallel # Process each NuGet package in parallel
Get-ChildItem "$InputPath\*.symbols.nupkg" | Get-ChildItem "$InputPath\*.symbols.nupkg" |
ForEach-Object { ForEach-Object {
@ -211,20 +209,17 @@ function ValidateSourceLinkLinks {
} }
foreach ($Job in @(Get-Job -State 'Completed')) { foreach ($Job in @(Get-Job -State 'Completed')) {
$jobResult = Receive-Job -Id $Job.Id Receive-Job -Id $Job.Id
if ($jobResult -ne '0') {
$ValidationFailures++
}
Remove-Job -Id $Job.Id Remove-Job -Id $Job.Id
} }
} }
$ValidationFailures = 0
foreach ($Job in @(Get-Job)) { foreach ($Job in @(Get-Job)) {
$jobResult = Wait-Job -Id $Job.Id | Receive-Job $jobResult = Wait-Job -Id $Job.Id | Receive-Job
if ($jobResult -ne '0') { if ($jobResult -ne '0') {
$ValidationFailures++ $ValidationFailures++
} }
Remove-Job -Id $Job.Id
} }
if ($ValidationFailures -gt 0) { if ($ValidationFailures -gt 0) {
Write-PipelineTelemetryError -Category 'SourceLink' -Message "$ValidationFailures package(s) failed validation." Write-PipelineTelemetryError -Category 'SourceLink' -Message "$ValidationFailures package(s) failed validation."

Просмотреть файл

@ -2,29 +2,72 @@ param(
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored
[Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation [Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
[Parameter(Mandatory=$true)][string] $DotnetSymbolVersion, # Version of dotnet symbol to use [Parameter(Mandatory=$true)][string] $DotnetSymbolVersion, # Version of dotnet symbol to use
[Parameter(Mandatory=$false)][switch] $ContinueOnError, # If we should keep checking symbols after an error [Parameter(Mandatory=$false)][switch] $ContinueOnError # If we should keep checking symbols after an error
[Parameter(Mandatory=$false)][switch] $Clean # Clean extracted symbols directory after checking symbols
) )
# Maximum number of jobs to run in parallel function FirstMatchingSymbolDescriptionOrDefault {
$MaxParallelJobs = 6 param(
[string] $FullPath, # Full path to the module that has to be checked
[string] $TargetServerParam, # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols
[string] $SymbolsPath
)
# Wait time between check for system load $FileName = [System.IO.Path]::GetFileName($FullPath)
$SecondsBetweenLoadChecks = 10 $Extension = [System.IO.Path]::GetExtension($FullPath)
$CountMissingSymbols = { # Those below are potential symbol files that the `dotnet symbol` might
# return. Which one will be returned depend on the type of file we are
# checking and which type of file was uploaded.
# The file itself is returned
$SymbolPath = $SymbolsPath + '\' + $FileName
# PDB file for the module
$PdbPath = $SymbolPath.Replace($Extension, '.pdb')
# PDB file for R2R module (created by crossgen)
$NGenPdb = $SymbolPath.Replace($Extension, '.ni.pdb')
# DBG file for a .so library
$SODbg = $SymbolPath.Replace($Extension, '.so.dbg')
# DWARF file for a .dylib
$DylibDwarf = $SymbolPath.Replace($Extension, '.dylib.dwarf')
$dotnetSymbolExe = "$env:USERPROFILE\.dotnet\tools"
$dotnetSymbolExe = Resolve-Path "$dotnetSymbolExe\dotnet-symbol.exe"
& $dotnetSymbolExe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath | Out-Null
if (Test-Path $PdbPath) {
return 'PDB'
}
elseif (Test-Path $NGenPdb) {
return 'NGen PDB'
}
elseif (Test-Path $SODbg) {
return 'DBG for SO'
}
elseif (Test-Path $DylibDwarf) {
return 'Dwarf for Dylib'
}
elseif (Test-Path $SymbolPath) {
return 'Module'
}
else {
return $null
}
}
function CountMissingSymbols {
param( param(
[string] $PackagePath # Path to a NuGet package [string] $PackagePath # Path to a NuGet package
) )
. $using:PSScriptRoot\..\tools.ps1
Add-Type -AssemblyName System.IO.Compression.FileSystem
# Ensure input file exist # Ensure input file exist
if (!(Test-Path $PackagePath)) { if (!(Test-Path $PackagePath)) {
Write-PipelineTaskError "Input file does not exist: $PackagePath" Write-PipelineTaskError "Input file does not exist: $PackagePath"
return -2 ExitWithExitCode 1
} }
# Extensions for which we'll look for symbols # Extensions for which we'll look for symbols
@ -35,88 +78,23 @@ $CountMissingSymbols = {
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$PackageGuid = New-Guid $PackageGuid = New-Guid
$ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageGuid $ExtractPath = Join-Path -Path $ExtractPath -ChildPath $PackageGuid
$SymbolsPath = Join-Path -Path $ExtractPath -ChildPath 'Symbols' $SymbolsPath = Join-Path -Path $ExtractPath -ChildPath 'Symbols'
try { [System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath)
[System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath)
}
catch {
Write-Host "Something went wrong extracting $PackagePath"
Write-Host $_
return [pscustomobject]@{
result = -1
packagePath = $PackagePath
}
}
Get-ChildItem -Recurse $ExtractPath | Get-ChildItem -Recurse $ExtractPath |
Where-Object {$RelevantExtensions -contains $_.Extension} | Where-Object {$RelevantExtensions -contains $_.Extension} |
ForEach-Object { ForEach-Object {
$FileName = $_.FullName if ($_.FullName -Match '\\ref\\') {
if ($FileName -Match '\\ref\\') { Write-Host "`t Ignoring reference assembly file " $_.FullName
Write-Host "`t Ignoring reference assembly file " $FileName
return return
} }
$FirstMatchingSymbolDescriptionOrDefault = { $SymbolsOnMSDL = FirstMatchingSymbolDescriptionOrDefault $_.FullName '--microsoft-symbol-server' $SymbolsPath
param( $SymbolsOnSymWeb = FirstMatchingSymbolDescriptionOrDefault $_.FullName '--internal-server' $SymbolsPath
[string] $FullPath, # Full path to the module that has to be checked
[string] $TargetServerParam, # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols
[string] $SymbolsPath
)
$FileName = [System.IO.Path]::GetFileName($FullPath) Write-Host -NoNewLine "`t Checking file " $_.FullName "... "
$Extension = [System.IO.Path]::GetExtension($FullPath)
# Those below are potential symbol files that the `dotnet symbol` might
# return. Which one will be returned depend on the type of file we are
# checking and which type of file was uploaded.
# The file itself is returned
$SymbolPath = $SymbolsPath + '\' + $FileName
# PDB file for the module
$PdbPath = $SymbolPath.Replace($Extension, '.pdb')
# PDB file for R2R module (created by crossgen)
$NGenPdb = $SymbolPath.Replace($Extension, '.ni.pdb')
# DBG file for a .so library
$SODbg = $SymbolPath.Replace($Extension, '.so.dbg')
# DWARF file for a .dylib
$DylibDwarf = $SymbolPath.Replace($Extension, '.dylib.dwarf')
$dotnetSymbolExe = "$env:USERPROFILE\.dotnet\tools"
$dotnetSymbolExe = Resolve-Path "$dotnetSymbolExe\dotnet-symbol.exe"
& $dotnetSymbolExe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath | Out-Null
if (Test-Path $PdbPath) {
return 'PDB'
}
elseif (Test-Path $NGenPdb) {
return 'NGen PDB'
}
elseif (Test-Path $SODbg) {
return 'DBG for SO'
}
elseif (Test-Path $DylibDwarf) {
return 'Dwarf for Dylib'
}
elseif (Test-Path $SymbolPath) {
return 'Module'
}
else {
return $null
}
}
$SymbolsOnMSDL = & $FirstMatchingSymbolDescriptionOrDefault $FileName '--microsoft-symbol-server' $SymbolsPath
$SymbolsOnSymWeb = & $FirstMatchingSymbolDescriptionOrDefault $FileName '--internal-server' $SymbolsPath
Write-Host -NoNewLine "`t Checking file " $FileName "... "
if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) { if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) {
Write-Host "Symbols found on MSDL ($SymbolsOnMSDL) and SymWeb ($SymbolsOnSymWeb)" Write-Host "Symbols found on MSDL ($SymbolsOnMSDL) and SymWeb ($SymbolsOnSymWeb)"
@ -138,35 +116,9 @@ $CountMissingSymbols = {
} }
} }
if ($using:Clean) {
Remove-Item $ExtractPath -Recurse -Force
}
if ($MissingSymbols -ne 0)
{
Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Missing symbols for $MissingSymbols modules in the package $FileName"
}
Pop-Location Pop-Location
return [pscustomobject]@{ return $MissingSymbols
result = $MissingSymbols
packagePath = $PackagePath
}
}
function CheckJobResult(
$result,
$packagePath,
[ref]$DupedSymbols,
[ref]$TotalFailures) {
if ($result -eq '-1') {
Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$packagePath has duplicated symbol files"
$DupedSymbols.Value++
}
elseif ($jobResult.result -ne '0') {
$TotalFailures.Value++
}
} }
function CheckSymbolsAvailable { function CheckSymbolsAvailable {
@ -175,12 +127,10 @@ function CheckSymbolsAvailable {
} }
$TotalFailures = 0 $TotalFailures = 0
$DupedSymbols = 0
Get-ChildItem "$InputPath\*.nupkg" | Get-ChildItem "$InputPath\*.nupkg" |
ForEach-Object { ForEach-Object {
$FileName = $_.Name $FileName = $_.Name
$FullName = $_.FullName
# These packages from Arcade-Services include some native libraries that # These packages from Arcade-Services include some native libraries that
# our current symbol uploader can't handle. Below is a workaround until # our current symbol uploader can't handle. Below is a workaround until
@ -197,45 +147,26 @@ function CheckSymbolsAvailable {
} }
Write-Host "Validating $FileName " Write-Host "Validating $FileName "
$Status = CountMissingSymbols "$InputPath\$FileName"
Start-Job -ScriptBlock $CountMissingSymbols -ArgumentList $FullName | Out-Null if ($Status -ne 0) {
Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Missing symbols for $Status modules in the package $FileName"
$NumJobs = @(Get-Job -State 'Running').Count if ($ContinueOnError) {
Write-Host $NumJobs $TotalFailures++
}
while ($NumJobs -ge $MaxParallelJobs) { else {
Write-Host "There are $NumJobs validation jobs running right now. Waiting $SecondsBetweenLoadChecks seconds to check again." ExitWithExitCode 1
sleep $SecondsBetweenLoadChecks }
$NumJobs = @(Get-Job -State 'Running').Count
} }
foreach ($Job in @(Get-Job -State 'Completed')) {
$jobResult = Wait-Job -Id $Job.Id | Receive-Job
CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$DupedSymbols) ([ref]$TotalFailures)
Remove-Job -Id $Job.Id
}
Write-Host Write-Host
} }
foreach ($Job in @(Get-Job)) { if ($TotalFailures -ne 0) {
$jobResult = Wait-Job -Id $Job.Id | Receive-Job Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Symbols missing for $TotalFailures packages"
CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$DupedSymbols) ([ref]$TotalFailures)
}
if ($TotalFailures -gt 0 -or $DupedSymbols -gt 0) {
if ($TotalFailures -gt 0) {
Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Symbols missing for $TotalFailures packages"
}
if ($DupedSymbols -gt 0) {
Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$DupedSymbols packages had duplicated symbol files"
}
ExitWithExitCode 1 ExitWithExitCode 1
} }
else {
Write-Host "All symbols validated!"
}
} }
function InstallDotnetSymbol { function InstallDotnetSymbol {
@ -257,13 +188,11 @@ function InstallDotnetSymbol {
try { try {
. $PSScriptRoot\post-build-utils.ps1 . $PSScriptRoot\post-build-utils.ps1
Add-Type -AssemblyName System.IO.Compression.FileSystem
InstallDotnetSymbol InstallDotnetSymbol
foreach ($Job in @(Get-Job)) {
Remove-Job -Id $Job.Id
}
CheckSymbolsAvailable CheckSymbolsAvailable
} }
catch { catch {

Просмотреть файл

@ -59,20 +59,14 @@ try {
if( $msbuildEngine -eq "vs") { if( $msbuildEngine -eq "vs") {
# Ensure desktop MSBuild is available for sdk tasks. # Ensure desktop MSBuild is available for sdk tasks.
if( -not ($GlobalJson.tools.PSObject.Properties.Name -contains "vs" )) { if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "vs" )) {
$GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty $GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.4`" }") -MemberType NoteProperty
} }
if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) { if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) {
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "16.5.0-alpha" -MemberType NoteProperty $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "16.4.0-alpha" -MemberType NoteProperty
}
if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") {
$xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true
}
if ($xcopyMSBuildToolsFolder -eq $null) {
throw 'Unable to get xcopy downloadable version of msbuild'
} }
$global:_MSBuildExe = "$($xcopyMSBuildToolsFolder)\MSBuild\Current\Bin\MSBuild.exe" InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true
} }
$taskProject = GetSdkTaskProject $task $taskProject = GetSdkTaskProject $task

Просмотреть файл

@ -24,8 +24,7 @@ Param(
[string] $TsaIterationPath, # Optional: only needed if TsaOnboard is true; the iteration path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. [string] $TsaIterationPath, # Optional: only needed if TsaOnboard is true; the iteration path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs.
[string] $GuardianLoggerLevel='Standard', # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error [string] $GuardianLoggerLevel='Standard', # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error
[string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional Params to custom build a CredScan run config in the format @("xyz:abc","sdf:1") [string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional Params to custom build a CredScan run config in the format @("xyz:abc","sdf:1")
[string[]] $PoliCheckAdditionalRunConfigParams, # Optional: Additional Params to custom build a Policheck run config in the format @("xyz:abc","sdf:1") [string[]] $PoliCheckAdditionalRunConfigParams # Optional: Additional Params to custom build a Policheck run config in the format @("xyz:abc","sdf:1")
[bool] $BreakOnFailure=$False # Optional: Fail the build if there were errors during the run
) )
try { try {
@ -107,11 +106,6 @@ try {
ExitWithExitCode 1 ExitWithExitCode 1
} }
} }
if ($BreakOnFailure) {
Write-Host "Failing the build in case of breaking results..."
& $guardianCliLocation break
}
} }
catch { catch {
Write-Host $_.ScriptStackTrace Write-Host $_.ScriptStackTrace

Просмотреть файл

@ -26,7 +26,7 @@ parameters:
enablePublishUsingPipelines: false enablePublishUsingPipelines: false
useBuildManifest: false useBuildManifest: false
mergeTestResults: false mergeTestResults: false
testRunTitle: '' testRunTitle: $(AgentOsName)-$(BuildConfiguration)-xunit
name: '' name: ''
preSteps: [] preSteps: []
runAsPublic: false runAsPublic: false
@ -197,7 +197,7 @@ jobs:
testResultsFormat: 'xUnit' testResultsFormat: 'xUnit'
testResultsFiles: '*.xml' testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
testRunTitle: ${{ coalesce(parameters.testRunTitle, parameters.name, '$(System.JobName)') }}-xunit testRunTitle: ${{ parameters.testRunTitle }}
mergeTestResults: ${{ parameters.mergeTestResults }} mergeTestResults: ${{ parameters.mergeTestResults }}
continueOnError: true continueOnError: true
condition: always() condition: always()

Просмотреть файл

@ -1,13 +1,4 @@
parameters: parameters:
# When set to true the publishing templates from the repo will be used
# otherwise Darc add-build-to-channel will be used to trigger the promotion pipeline
inline: true
# Only used if inline==false. When set to true will stall the current build until
# the Promotion Pipeline build finishes. Otherwise, the current build continue
# execution concurrently with the promotion build.
waitPublishingFinish: true
enableSourceLinkValidation: false enableSourceLinkValidation: false
enableSigningValidation: true enableSigningValidation: true
enableSymbolValidation: false enableSymbolValidation: false
@ -46,478 +37,374 @@ parameters:
NETCoreExperimentalChannelId: 562 NETCoreExperimentalChannelId: 562
NetEngServicesIntChannelId: 678 NetEngServicesIntChannelId: 678
NetEngServicesProdChannelId: 679 NetEngServicesProdChannelId: 679
Net5Preview3ChannelId: 739
Net5Preview4ChannelId: 856
Net5Preview5ChannelId: 857 Net5Preview5ChannelId: 857
Net5Preview6ChannelId: 1013
Net5Preview7ChannelId: 1065
NetCoreSDK313xxChannelId: 759
NetCoreSDK313xxInternalChannelId: 760
NetCoreSDK314xxChannelId: 921 NetCoreSDK314xxChannelId: 921
NetCoreSDK314xxInternalChannelId: 922 NetCoreSDK314xxInternalChannelId: 922
VS166ChannelId: 1010
VS167ChannelId: 1011
VSMasterChannelId: 1012
stages: stages:
- ${{ if ne(parameters.inline, 'true') }}: - stage: Validate
- stage: publish_using_darc dependsOn: ${{ parameters.validateDependsOn }}
dependsOn: ${{ parameters.validateDependsOn }} displayName: Validate
displayName: Publish using Darc variables:
- template: common-variables.yml
jobs:
- template: setup-maestro-vars.yml
- job:
displayName: Post-build Checks
dependsOn: setupMaestroVars
variables:
- name: TargetChannels
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'] ]
pool:
vmImage: 'windows-2019'
steps:
- task: PowerShell@2
displayName: Maestro Channels Consistency
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/check-channel-consistency.ps1
arguments: -PromoteToChannels "$(TargetChannels)"
-AvailableChannelIds ${{parameters.NetEngLatestChannelId}},${{parameters.NetEngValidationChannelId}},${{parameters.NetDev5ChannelId}},${{parameters.GeneralTestingChannelId}},${{parameters.NETCoreToolingDevChannelId}},${{parameters.NETCoreToolingReleaseChannelId}},${{parameters.NETInternalToolingChannelId}},${{parameters.NETCoreExperimentalChannelId}},${{parameters.NetEngServicesIntChannelId}},${{parameters.NetEngServicesProdChannelId}},${{parameters.Net5Preview3ChannelId}},${{parameters.Net5Preview4ChannelId}},${{parameters.Net5Preview5ChannelId}},${{parameters.NetCoreSDK314xxChannelId}},${{parameters.NetCoreSDK314xxInternalChannelId}}
- job:
displayName: NuGet Validation
dependsOn: setupMaestroVars
condition: eq( ${{ parameters.enableNugetValidation }}, 'true')
pool:
vmImage: 'windows-2019'
variables:
- name: AzDOProjectName
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ]
- name: AzDOPipelineId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ]
- name: AzDOBuildId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ]
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Package Artifacts
inputs:
buildType: specific
buildVersionToDownload: specific
project: $(AzDOProjectName)
pipeline: $(AzDOPipelineId)
buildId: $(AzDOBuildId)
artifactName: PackageArtifacts
- task: PowerShell@2
displayName: Validate
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1
arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/
-ToolDestinationPath $(Agent.BuildDirectory)/Extract/
- job:
displayName: Signing Validation
dependsOn: setupMaestroVars
condition: eq( ${{ parameters.enableSigningValidation }}, 'true')
variables: variables:
- template: common-variables.yml - template: common-variables.yml
jobs: - name: AzDOProjectName
- template: setup-maestro-vars.yml value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ]
- name: AzDOPipelineId
- job: value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ]
displayName: Publish Using Darc - name: AzDOBuildId
dependsOn: setupMaestroVars value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ]
variables: pool:
- name: BARBuildId vmImage: 'windows-2019'
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] steps:
pool: - ${{ if eq(parameters.useBuildManifest, true) }}:
vmImage: 'windows-2019' - task: DownloadBuildArtifacts@0
steps: displayName: Download build manifest
- task: PowerShell@2
displayName: Publish Using Darc
inputs: inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 buildType: specific
arguments: -BuildId $(BARBuildId) buildVersionToDownload: specific
-AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' project: $(AzDOProjectName)
-MaestroToken '$(MaestroApiAccessToken)' pipeline: $(AzDOPipelineId)
-WaitPublishingFinish ${{ parameters.waitPublishingFinish }} buildId: $(AzDOBuildId)
-EnableSourceLinkValidation ${{ parameters.enableSourceLinkValidation }} artifactName: BuildManifests
-EnableSigningValidation ${{ parameters.enableSourceLinkValidation }} - task: DownloadBuildArtifacts@0
-EnableNugetValidation ${{ parameters.enableSourceLinkValidation }} displayName: Download Package Artifacts
-PublishInstallersAndChecksums ${{ parameters.publishInstallersAndChecksums }} inputs:
-ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' buildType: specific
-SigningValidationAdditionalParameters '${{ parameters.signingValidationAdditionalParameters }}' buildVersionToDownload: specific
project: $(AzDOProjectName)
pipeline: $(AzDOPipelineId)
buildId: $(AzDOBuildId)
artifactName: PackageArtifacts
- ${{ if eq(parameters.inline, 'true') }}: # This is necessary whenever we want to publish/restore to an AzDO private feed
- stage: Validate # Since sdk-task.ps1 tries to restore packages we need to do this authentication here
dependsOn: ${{ parameters.validateDependsOn }} # otherwise it'll complain about accessing a private feed.
displayName: Validate Build Assets - task: NuGetAuthenticate@0
displayName: 'Authenticate to AzDO Feeds'
- task: PowerShell@2
displayName: Enable cross-org publishing
inputs:
filePath: eng\common\enable-cross-org-publishing.ps1
arguments: -token $(dn-bot-dnceng-artifact-feeds-rw)
# Signing validation will optionally work with the buildmanifest file which is downloaded from
# Azure DevOps above.
- task: PowerShell@2
displayName: Validate
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task SigningValidation -restore -msbuildEngine vs
/p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts'
/p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt'
${{ parameters.signingValidationAdditionalParameters }}
- template: ../steps/publish-logs.yml
parameters:
StageLabel: 'Validation'
JobLabel: 'Signing'
- job:
displayName: SourceLink Validation
dependsOn: setupMaestroVars
condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true')
variables: variables:
- template: common-variables.yml - template: common-variables.yml
jobs: - name: AzDOProjectName
- template: setup-maestro-vars.yml value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ]
- name: AzDOPipelineId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ]
- name: AzDOBuildId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ]
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Blob Artifacts
inputs:
buildType: specific
buildVersionToDownload: specific
project: $(AzDOProjectName)
pipeline: $(AzDOPipelineId)
buildId: $(AzDOBuildId)
artifactName: BlobArtifacts
- job: - task: PowerShell@2
displayName: Post-build Checks displayName: Validate
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1
arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/
-ExtractPath $(Agent.BuildDirectory)/Extract/
-GHRepoName $(Build.Repository.Name)
-GHCommit $(Build.SourceVersion)
-SourcelinkCliVersion $(SourceLinkCLIVersion)
continueOnError: true
- template: /eng/common/templates/job/execute-sdl.yml
parameters:
enable: ${{ parameters.SDLValidationParameters.enable }}
dependsOn: setupMaestroVars dependsOn: setupMaestroVars
variables: additionalParameters: ${{ parameters.SDLValidationParameters.params }}
- name: TargetChannels continueOnError: ${{ parameters.SDLValidationParameters.continueOnError }}
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'] ] artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }}
pool: downloadArtifacts: ${{ parameters.SDLValidationParameters.downloadArtifacts }}
vmImage: 'windows-2019'
steps:
- task: PowerShell@2
displayName: Maestro Channels Consistency
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/check-channel-consistency.ps1
arguments: -PromoteToChannels "$(TargetChannels)"
-AvailableChannelIds ${{parameters.NetEngLatestChannelId}},${{parameters.NetEngValidationChannelId}},${{parameters.NetDev5ChannelId}},${{parameters.GeneralTestingChannelId}},${{parameters.NETCoreToolingDevChannelId}},${{parameters.NETCoreToolingReleaseChannelId}},${{parameters.NETInternalToolingChannelId}},${{parameters.NETCoreExperimentalChannelId}},${{parameters.NetEngServicesIntChannelId}},${{parameters.NetEngServicesProdChannelId}},${{parameters.Net5Preview5ChannelId}},${{parameters.Net5Preview6ChannelId}},${{parameters.Net5Preview7ChannelId}},${{parameters.NetCoreSDK313xxChannelId}},${{parameters.NetCoreSDK313xxInternalChannelId}},${{parameters.NetCoreSDK314xxChannelId}},${{parameters.NetCoreSDK314xxInternalChannelId}},${{parameters.VS166ChannelId}},${{parameters.VS167ChannelId}},${{parameters.VSMasterChannelId}}
- job: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
displayName: NuGet Validation parameters:
dependsOn: setupMaestroVars artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
condition: eq( ${{ parameters.enableNugetValidation }}, 'true') dependsOn: ${{ parameters.publishDependsOn }}
pool: publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
vmImage: 'windows-2019' symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
variables: stageName: 'NetCore_Dev5_Publish'
- name: AzDOProjectName channelName: '.NET 5 Dev'
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] akaMSChannelName: 'net5/dev'
- name: AzDOPipelineId channelId: ${{ parameters.NetDev5ChannelId }}
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json'
- name: AzDOBuildId shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json'
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Package Artifacts
inputs:
buildType: specific
buildVersionToDownload: specific
project: $(AzDOProjectName)
pipeline: $(AzDOPipelineId)
buildId: $(AzDOBuildId)
artifactName: PackageArtifacts
- task: PowerShell@2 - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
displayName: Validate parameters:
inputs: artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1 dependsOn: ${{ parameters.publishDependsOn }}
arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
-ToolDestinationPath $(Agent.BuildDirectory)/Extract/ symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net5_Preview3_Publish'
channelName: '.NET 5 Preview 3'
akaMSChannelName: 'net5/preview3'
channelId: ${{ parameters.Net5Preview3ChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
- job: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
displayName: Signing Validation parameters:
dependsOn: setupMaestroVars artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
condition: eq( ${{ parameters.enableSigningValidation }}, 'true') dependsOn: ${{ parameters.publishDependsOn }}
variables: publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
- template: common-variables.yml symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
- name: AzDOProjectName stageName: 'Net5_Preview4_Publish'
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] channelName: '.NET 5 Preview 4'
- name: AzDOPipelineId akaMSChannelName: 'net5/preview4'
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] channelId: ${{ parameters.Net5Preview4ChannelId }}
- name: AzDOBuildId transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json'
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json'
pool: symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
vmImage: 'windows-2019'
steps:
- ${{ if eq(parameters.useBuildManifest, true) }}:
- task: DownloadBuildArtifacts@0
displayName: Download build manifest
inputs:
buildType: specific
buildVersionToDownload: specific
project: $(AzDOProjectName)
pipeline: $(AzDOPipelineId)
buildId: $(AzDOBuildId)
artifactName: BuildManifests
- task: DownloadBuildArtifacts@0
displayName: Download Package Artifacts
inputs:
buildType: specific
buildVersionToDownload: specific
project: $(AzDOProjectName)
pipeline: $(AzDOPipelineId)
buildId: $(AzDOBuildId)
artifactName: PackageArtifacts
# This is necessary whenever we want to publish/restore to an AzDO private feed - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
# Since sdk-task.ps1 tries to restore packages we need to do this authentication here parameters:
# otherwise it'll complain about accessing a private feed. artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
- task: NuGetAuthenticate@0 dependsOn: ${{ parameters.publishDependsOn }}
displayName: 'Authenticate to AzDO Feeds' publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net5_Preview5_Publish'
channelName: '.NET 5 Preview 5'
akaMSChannelName: 'net5/preview5'
channelId: ${{ parameters.Net5Preview5ChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
- task: PowerShell@2 - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
displayName: Enable cross-org publishing parameters:
inputs: artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
filePath: eng\common\enable-cross-org-publishing.ps1 dependsOn: ${{ parameters.publishDependsOn }}
arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net_Eng_Latest_Publish'
channelName: '.NET Eng - Latest'
akaMSChannelName: 'eng/daily'
channelId: ${{ parameters.NetEngLatestChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
# Signing validation will optionally work with the buildmanifest file which is downloaded from - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
# Azure DevOps above. parameters:
- task: PowerShell@2 artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
displayName: Validate dependsOn: ${{ parameters.publishDependsOn }}
inputs: publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
filePath: eng\common\sdk-task.ps1 symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
arguments: -task SigningValidation -restore -msbuildEngine vs stageName: 'Net_Eng_Validation_Publish'
/p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' channelName: '.NET Eng - Validation'
/p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt' akaMSChannelName: 'eng/validation'
${{ parameters.signingValidationAdditionalParameters }} channelId: ${{ parameters.NetEngValidationChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
- template: ../steps/publish-logs.yml - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters: parameters:
StageLabel: 'Validation' artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
JobLabel: 'Signing' dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'General_Testing_Publish'
channelName: 'General Testing'
akaMSChannelName: 'generaltesting'
channelId: ${{ parameters.GeneralTestingChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing-symbols/nuget/v3/index.json'
- job: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
displayName: SourceLink Validation parameters:
dependsOn: setupMaestroVars artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true') dependsOn: ${{ parameters.publishDependsOn }}
variables: publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
- template: common-variables.yml symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
- name: AzDOProjectName stageName: 'NETCore_Tooling_Dev_Publishing'
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] channelName: '.NET Core Tooling Dev'
- name: AzDOPipelineId channelId: ${{ parameters.NETCoreToolingDevChannelId }}
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
- name: AzDOBuildId shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json'
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Blob Artifacts
inputs:
buildType: specific
buildVersionToDownload: specific
project: $(AzDOProjectName)
pipeline: $(AzDOPipelineId)
buildId: $(AzDOBuildId)
artifactName: BlobArtifacts
- task: PowerShell@2 - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
displayName: Validate parameters:
inputs: artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1 dependsOn: ${{ parameters.publishDependsOn }}
arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/ publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
-ExtractPath $(Agent.BuildDirectory)/Extract/ symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
-GHRepoName $(Build.Repository.Name) stageName: 'NETCore_Tooling_Release_Publishing'
-GHCommit $(Build.SourceVersion) channelName: '.NET Core Tooling Release'
-SourcelinkCliVersion $(SourceLinkCLIVersion) channelId: ${{ parameters.NETCoreToolingReleaseChannelId }}
continueOnError: true transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json'
- template: /eng/common/templates/job/execute-sdl.yml - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml
parameters: parameters:
enable: ${{ parameters.SDLValidationParameters.enable }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: setupMaestroVars dependsOn: ${{ parameters.publishDependsOn }}
additionalParameters: ${{ parameters.SDLValidationParameters.params }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
continueOnError: ${{ parameters.SDLValidationParameters.continueOnError }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }} stageName: 'NET_Internal_Tooling_Publishing'
downloadArtifacts: ${{ parameters.SDLValidationParameters.downloadArtifacts }} channelName: '.NET Internal Tooling'
channelId: ${{ parameters.NETInternalToolingChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters: parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }} dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NetCore_Dev5_Publish' stageName: 'NETCore_Experimental_Publishing'
channelName: '.NET 5 Dev' channelName: '.NET Core Experimental'
akaMSChannelName: 'net5/dev' channelId: ${{ parameters.NETCoreExperimentalChannelId }}
channelId: ${{ parameters.NetDev5ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json'
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental-symbols/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters: parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }} dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net5_Preview5_Publish' stageName: 'Net_Eng_Services_Int_Publish'
channelName: '.NET 5 Preview 5' channelName: '.NET Eng Services - Int'
akaMSChannelName: 'net5/preview5' channelId: ${{ parameters.NetEngServicesIntChannelId }}
channelId: ${{ parameters.Net5Preview5ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters: parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }} dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net5_Preview6_Publish' stageName: 'Net_Eng_Services_Prod_Publish'
channelName: '.NET 5 Preview 6' channelName: '.NET Eng Services - Prod'
akaMSChannelName: 'net5/preview6' channelId: ${{ parameters.NetEngServicesProdChannelId }}
channelId: ${{ parameters.Net5Preview6ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml - template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters: parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }} dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net5_Preview7_Publish' stageName: 'NETCore_SDK_314xx_Publishing'
channelName: '.NET 5 Preview 7' channelName: '.NET Core SDK 3.1.4xx'
akaMSChannelName: 'net5/preview7' channelId: ${{ parameters.NetCoreSDK314xxChannelId }}
channelId: ${{ parameters.Net5Preview7ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json'
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml
parameters: parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }} dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net_Eng_Latest_Publish' stageName: 'NETCore_SDK_314xx_Internal_Publishing'
channelName: '.NET Eng - Latest' channelName: '.NET Core SDK 3.1.4xx Internal'
akaMSChannelName: 'eng/daily' channelId: ${{ parameters.NetCoreSDK314xxInternalChannelId }}
channelId: ${{ parameters.NetEngLatestChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json'
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-symbols/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net_Eng_Validation_Publish'
channelName: '.NET Eng - Validation'
akaMSChannelName: 'eng/validation'
channelId: ${{ parameters.NetEngValidationChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'General_Testing_Publish'
channelName: 'General Testing'
akaMSChannelName: 'generaltesting'
channelId: ${{ parameters.GeneralTestingChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NETCore_Tooling_Dev_Publishing'
channelName: '.NET Core Tooling Dev'
channelId: ${{ parameters.NETCoreToolingDevChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NETCore_Tooling_Release_Publishing'
channelName: '.NET Core Tooling Release'
channelId: ${{ parameters.NETCoreToolingReleaseChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-internal-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NET_Internal_Tooling_Publishing'
channelName: '.NET Internal Tooling'
channelId: ${{ parameters.NETInternalToolingChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NETCore_Experimental_Publishing'
channelName: '.NET Core Experimental'
channelId: ${{ parameters.NETCoreExperimentalChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net_Eng_Services_Int_Publish'
channelName: '.NET Eng Services - Int'
channelId: ${{ parameters.NetEngServicesIntChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net_Eng_Services_Prod_Publish'
channelName: '.NET Eng Services - Prod'
channelId: ${{ parameters.NetEngServicesProdChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NETCore_SDK_314xx_Publishing'
channelName: '.NET Core SDK 3.1.4xx'
channelId: ${{ parameters.NetCoreSDK314xxChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-internal-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NETCore_SDK_314xx_Internal_Publishing'
channelName: '.NET Core SDK 3.1.4xx Internal'
channelId: ${{ parameters.NetCoreSDK314xxInternalChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NETCore_SDK_313xx_Publishing'
channelName: '.NET Core SDK 3.1.3xx'
channelId: ${{ parameters.NetCoreSDK313xxChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-internal-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NETCore_SDK_313xx_Internal_Publishing'
channelName: '.NET Core SDK 3.1.3xx Internal'
channelId: ${{ parameters.NetCoreSDK313xxInternalChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'VS16_6_Publishing'
channelName: 'VS 16.6'
channelId: ${{ parameters.VS166ChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'VS16_7_Publishing'
channelName: 'VS 16.7'
channelId: ${{ parameters.VS167ChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'VS_Master_Publishing'
channelName: 'VS Master'
channelId: ${{ parameters.VSMasterChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json'

Просмотреть файл

@ -7,11 +7,9 @@
# Build configuration. Common values include 'Debug' and 'Release', but the repository may use other names. # Build configuration. Common values include 'Debug' and 'Release', but the repository may use other names.
[string]$configuration = if (Test-Path variable:configuration) { $configuration } else { 'Debug' } [string]$configuration = if (Test-Path variable:configuration) { $configuration } else { 'Debug' }
# Set to true to opt out of outputting binary log while running in CI
[bool]$excludeCIBinarylog = if (Test-Path variable:excludeCIBinarylog) { $excludeCIBinarylog } else { $false }
# Set to true to output binary log from msbuild. Note that emitting binary log slows down the build. # Set to true to output binary log from msbuild. Note that emitting binary log slows down the build.
[bool]$binaryLog = if (Test-Path variable:binaryLog) { $binaryLog } else { $ci -and !$excludeCIBinarylog } # Binary log must be enabled on CI.
[bool]$binaryLog = if (Test-Path variable:binaryLog) { $binaryLog } else { $ci }
# Set to true to use the pipelines logger which will enable Azure logging output. # Set to true to use the pipelines logger which will enable Azure logging output.
# https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md # https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md
@ -57,8 +55,10 @@ set-strictmode -version 2.0
$ErrorActionPreference = 'Stop' $ErrorActionPreference = 'Stop'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
function Create-Directory ([string[]] $path) { function Create-Directory([string[]] $path) {
New-Item -Path $path -Force -ItemType 'Directory' | Out-Null if (!(Test-Path $path)) {
New-Item -path $path -force -itemType 'Directory' | Out-Null
}
} }
function Unzip([string]$zipfile, [string]$outpath) { function Unzip([string]$zipfile, [string]$outpath) {
@ -124,9 +124,7 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) {
# Find the first path on %PATH% that contains the dotnet.exe # Find the first path on %PATH% that contains the dotnet.exe
if ($useInstalledDotNetCli -and (-not $globalJsonHasRuntimes) -and ($env:DOTNET_INSTALL_DIR -eq $null)) { if ($useInstalledDotNetCli -and (-not $globalJsonHasRuntimes) -and ($env:DOTNET_INSTALL_DIR -eq $null)) {
$dotnetExecutable = GetExecutableFileName 'dotnet' $dotnetCmd = Get-Command 'dotnet.exe' -ErrorAction SilentlyContinue
$dotnetCmd = Get-Command $dotnetExecutable -ErrorAction SilentlyContinue
if ($dotnetCmd -ne $null) { if ($dotnetCmd -ne $null) {
$env:DOTNET_INSTALL_DIR = Split-Path $dotnetCmd.Path -Parent $env:DOTNET_INSTALL_DIR = Split-Path $dotnetCmd.Path -Parent
} }
@ -285,19 +283,12 @@ function InstallDotNet([string] $dotnetRoot,
# Throws on failure. # Throws on failure.
# #
function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = $null) { function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = $null) {
if (-not (IsWindowsPlatform)) {
throw "Cannot initialize Visual Studio on non-Windows"
}
if (Test-Path variable:global:_MSBuildExe) { if (Test-Path variable:global:_MSBuildExe) {
return $global:_MSBuildExe return $global:_MSBuildExe
} }
$vsMinVersionReqdStr = '16.5'
$vsMinVersionReqd = [Version]::new($vsMinVersionReqdStr)
if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs } if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs }
$vsMinVersionStr = if ($vsRequirements.version) { $vsRequirements.version } else { $vsMinVersionReqdStr } $vsMinVersionStr = if ($vsRequirements.version) { $vsRequirements.version } else { '15.9' }
$vsMinVersion = [Version]::new($vsMinVersionStr) $vsMinVersion = [Version]::new($vsMinVersionStr)
# Try msbuild command available in the environment. # Try msbuild command available in the environment.
@ -330,18 +321,8 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
$xcopyMSBuildVersion = $GlobalJson.tools.'xcopy-msbuild' $xcopyMSBuildVersion = $GlobalJson.tools.'xcopy-msbuild'
$vsMajorVersion = $xcopyMSBuildVersion.Split('.')[0] $vsMajorVersion = $xcopyMSBuildVersion.Split('.')[0]
} else { } else {
#if vs version provided in global.json is incompatible then use the default version for xcopy msbuild download $vsMajorVersion = $vsMinVersion.Major
if($vsMinVersion -lt $vsMinVersionReqd){ $xcopyMSBuildVersion = "$vsMajorVersion.$($vsMinVersion.Minor).0-alpha"
Write-Host "Using xcopy-msbuild version of $vsMinVersionReqdStr.0-alpha since VS version $vsMinVersionStr provided in global.json is not compatible"
$vsMajorVersion = $vsMinVersionReqd.Major
$vsMinorVersion = $vsMinVersionReqd.Minor
}
else{
$vsMajorVersion = $vsMinVersion.Major
$vsMinorVersion = $vsMinVersion.Minor
}
$xcopyMSBuildVersion = "$vsMajorVersion.$vsMinorVersion.0-alpha"
} }
$vsInstallDir = $null $vsInstallDir = $null
@ -406,10 +387,6 @@ function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) {
# or $null if no instance meeting the requirements is found on the machine. # or $null if no instance meeting the requirements is found on the machine.
# #
function LocateVisualStudio([object]$vsRequirements = $null){ function LocateVisualStudio([object]$vsRequirements = $null){
if (-not (IsWindowsPlatform)) {
throw "Cannot run vswhere on non-Windows platforms."
}
if (Get-Member -InputObject $GlobalJson.tools -Name 'vswhere') { if (Get-Member -InputObject $GlobalJson.tools -Name 'vswhere') {
$vswhereVersion = $GlobalJson.tools.vswhere $vswhereVersion = $GlobalJson.tools.vswhere
} else { } else {
@ -475,8 +452,7 @@ function InitializeBuildTool() {
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "/global.json must specify 'tools.dotnet'." Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "/global.json must specify 'tools.dotnet'."
ExitWithExitCode 1 ExitWithExitCode 1
} }
$dotnetPath = Join-Path $dotnetRoot (GetExecutableFileName 'dotnet') $buildTool = @{ Path = Join-Path $dotnetRoot 'dotnet.exe'; Command = 'msbuild'; Tool = 'dotnet'; Framework = 'netcoreapp2.1' }
$buildTool = @{ Path = $dotnetPath; Command = 'msbuild'; Tool = 'dotnet'; Framework = 'netcoreapp2.1' }
} elseif ($msbuildEngine -eq "vs") { } elseif ($msbuildEngine -eq "vs") {
try { try {
$msbuildPath = InitializeVisualStudioMSBuild -install:$restore $msbuildPath = InitializeVisualStudioMSBuild -install:$restore
@ -629,8 +605,8 @@ function MSBuild() {
# #
function MSBuild-Core() { function MSBuild-Core() {
if ($ci) { if ($ci) {
if (!$binaryLog -and !$excludeCIBinarylog) { if (!$binaryLog) {
Write-PipelineTelemetryError -Category 'Build' -Message 'Binary log must be enabled in CI build, or explicitly opted-out from with the -excludeCIBinarylog switch.' Write-PipelineTelemetryError -Category 'Build' -Message 'Binary log must be enabled in CI build.'
ExitWithExitCode 1 ExitWithExitCode 1
} }
@ -690,19 +666,6 @@ function GetMSBuildBinaryLogCommandLineArgument($arguments) {
return $null return $null
} }
function GetExecutableFileName($baseName) {
if (IsWindowsPlatform) {
return "$baseName.exe"
}
else {
return $baseName
}
}
function IsWindowsPlatform() {
return [environment]::OSVersion.Platform -eq [PlatformID]::Win32NT
}
. $PSScriptRoot\pipeline-logging-functions.ps1 . $PSScriptRoot\pipeline-logging-functions.ps1
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..') $RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..')

Просмотреть файл

@ -18,17 +18,9 @@ fi
# Build configuration. Common values include 'Debug' and 'Release', but the repository may use other names. # Build configuration. Common values include 'Debug' and 'Release', but the repository may use other names.
configuration=${configuration:-'Debug'} configuration=${configuration:-'Debug'}
# Set to true to opt out of outputting binary log while running in CI
exclude_ci_binary_log=${exclude_ci_binary_log:-false}
if [[ "$ci" == true && "$exclude_ci_binary_log" == false ]]; then
binary_log_default=true
else
binary_log_default=false
fi
# Set to true to output binary log from msbuild. Note that emitting binary log slows down the build. # Set to true to output binary log from msbuild. Note that emitting binary log slows down the build.
binary_log=${binary_log:-$binary_log_default} # Binary log must be enabled on CI.
binary_log=${binary_log:-$ci}
# Turns on machine preparation/clean up code that changes the machine state (e.g. kills build processes). # Turns on machine preparation/clean up code that changes the machine state (e.g. kills build processes).
prepare_machine=${prepare_machine:-false} prepare_machine=${prepare_machine:-false}
@ -412,8 +404,8 @@ function MSBuild {
function MSBuild-Core { function MSBuild-Core {
if [[ "$ci" == true ]]; then if [[ "$ci" == true ]]; then
if [[ "$binary_log" != true && "$exclude_ci_binary_log" != true ]]; then if [[ "$binary_log" != true ]]; then
Write-PipelineTelemetryError -category 'Build' "Binary log must be enabled in CI build, or explicitly opted-out from with the -noBinaryLog switch." Write-PipelineTelemetryError -category 'Build' "Binary log must be enabled in CI build."
ExitWithExitCode 1 ExitWithExitCode 1
fi fi

Просмотреть файл

@ -1,16 +1,13 @@
{ {
"tools": { "tools": {
"dotnet": "5.0.100-preview.6.20310.4", "dotnet": "3.1.102",
"runtimes": { "runtimes": {
"dotnet": [ "dotnet": [
"3.1.2" "3.1.2"
],
"aspnetcore": [
"3.1.4"
] ]
} }
}, },
"msbuild-sdks": { "msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20330.3" "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20228.4"
} }
} }

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Backend</RootNamespace> <RootNamespace>Backend</RootNamespace>
</PropertyGroup> </PropertyGroup>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Frontend</RootNamespace> <RootNamespace>Frontend</RootNamespace>
</PropertyGroup> </PropertyGroup>

Просмотреть файл

@ -88,7 +88,7 @@ namespace Microsoft.Tye
if (!string.IsNullOrEmpty(configService.Project)) if (!string.IsNullOrEmpty(configService.Project))
{ {
var expandedProject = Environment.ExpandEnvironmentVariables(configService.Project); var expandedProject = Environment.ExpandEnvironmentVariables(configService.Project);
var projectFile = new FileInfo(Path.Combine(config.Source.DirectoryName!, expandedProject)); var projectFile = new FileInfo(Path.Combine(config.Source.DirectoryName, expandedProject));
var project = new DotnetProjectServiceBuilder(configService.Name!, projectFile); var project = new DotnetProjectServiceBuilder(configService.Name!, projectFile);
service = project; service = project;
@ -131,7 +131,7 @@ namespace Microsoft.Tye
Args = configService.Args, Args = configService.Args,
Build = configService.Build ?? true, Build = configService.Build ?? true,
Replicas = configService.Replicas ?? 1, Replicas = configService.Replicas ?? 1,
DockerFile = Path.Combine(source.DirectoryName!, configService.DockerFile), DockerFile = Path.Combine(source.DirectoryName, configService.DockerFile),
// Supplying an absolute path with trailing slashes fails for DockerFileContext when calling docker build, so trim trailing slash. // Supplying an absolute path with trailing slashes fails for DockerFileContext when calling docker build, so trim trailing slash.
DockerFileContext = GetDockerFileContext(source, configService), DockerFileContext = GetDockerFileContext(source, configService),
BuildArgs = configService.DockerFileArgs BuildArgs = configService.DockerFileArgs
@ -156,7 +156,7 @@ namespace Microsoft.Tye
// Special handling of .dlls as executables (it will be executed as dotnet {dll}) // Special handling of .dlls as executables (it will be executed as dotnet {dll})
if (Path.GetExtension(expandedExecutable) == ".dll") if (Path.GetExtension(expandedExecutable) == ".dll")
{ {
expandedExecutable = Path.GetFullPath(Path.Combine(config.Source.Directory!.FullName, expandedExecutable)); expandedExecutable = Path.GetFullPath(Path.Combine(config.Source.Directory.FullName, expandedExecutable));
workingDirectory = Path.GetDirectoryName(expandedExecutable)!; workingDirectory = Path.GetDirectoryName(expandedExecutable)!;
} }
@ -164,7 +164,7 @@ namespace Microsoft.Tye
{ {
Args = configService.Args, Args = configService.Args,
WorkingDirectory = configService.WorkingDirectory != null ? WorkingDirectory = configService.WorkingDirectory != null ?
Path.GetFullPath(Path.Combine(config.Source.Directory!.FullName, Environment.ExpandEnvironmentVariables(configService.WorkingDirectory))) : Path.GetFullPath(Path.Combine(config.Source.Directory.FullName, Environment.ExpandEnvironmentVariables(configService.WorkingDirectory))) :
workingDirectory, workingDirectory,
Replicas = configService.Replicas ?? 1 Replicas = configService.Replicas ?? 1
}; };
@ -177,7 +177,7 @@ namespace Microsoft.Tye
{ {
var expandedYaml = Environment.ExpandEnvironmentVariables(configService.Include); var expandedYaml = Environment.ExpandEnvironmentVariables(configService.Include);
var nestedConfig = GetNestedConfig(rootConfig, Path.Combine(config.Source.DirectoryName!, expandedYaml)); var nestedConfig = GetNestedConfig(rootConfig, Path.Combine(config.Source.DirectoryName, expandedYaml));
queue.Enqueue((nestedConfig, new HashSet<string>())); queue.Enqueue((nestedConfig, new HashSet<string>()));
AddToRootServices(root, dependencies, configService.Name); AddToRootServices(root, dependencies, configService.Name);
@ -405,11 +405,11 @@ namespace Microsoft.Tye
// but it's the exact opposite on linux, where it needs to have the trailing slash. // but it's the exact opposite on linux, where it needs to have the trailing slash.
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{ {
return Path.TrimEndingDirectorySeparator(Path.Combine(source.DirectoryName!, configService.DockerFileContext)); return Path.TrimEndingDirectorySeparator(Path.Combine(source.DirectoryName, configService.DockerFileContext));
} }
else else
{ {
var path = Path.Combine(source.DirectoryName!, configService.DockerFileContext); var path = Path.Combine(source.DirectoryName, configService.DockerFileContext);
if (!Path.EndsInDirectorySeparator(path)) if (!Path.EndsInDirectorySeparator(path))
{ {
@ -422,7 +422,7 @@ namespace Microsoft.Tye
private static ConfigApplication GetNestedConfig(ConfigApplication rootConfig, string? file) private static ConfigApplication GetNestedConfig(ConfigApplication rootConfig, string? file)
{ {
var nestedConfig = ConfigFactory.FromFile(new FileInfo(file!)); var nestedConfig = ConfigFactory.FromFile(new FileInfo(file));
nestedConfig.Validate(); nestedConfig.Validate();
if (nestedConfig.Name != rootConfig.Name) if (nestedConfig.Name != rootConfig.Name)

Просмотреть файл

@ -71,7 +71,7 @@ namespace Microsoft.Tye.ConfigModel
// //
// We want a *fast* heuristic that excludes unit test projects and class libraries without // We want a *fast* heuristic that excludes unit test projects and class libraries without
// having to load all of the projects. // having to load all of the projects.
var launchSettings = Path.Combine(projectFile.DirectoryName!, "Properties", "launchSettings.json"); var launchSettings = Path.Combine(projectFile.DirectoryName, "Properties", "launchSettings.json");
if (File.Exists(launchSettings) || ContainsOutputTypeExe(projectFile)) if (File.Exists(launchSettings) || ContainsOutputTypeExe(projectFile))
{ {
var service = new ConfigService() var service = new ConfigService()

Просмотреть файл

@ -21,7 +21,7 @@ namespace Microsoft.Tye.ConfigModel
return Path.GetFileNameWithoutExtension(fileInfo.Name).ToLowerInvariant(); return Path.GetFileNameWithoutExtension(fileInfo.Name).ToLowerInvariant();
} }
return fileInfo.Directory?.Parent?.Name.ToLowerInvariant(); return fileInfo.Directory.Parent.Name.ToLowerInvariant();
} }
} }
} }

Просмотреть файл

@ -36,7 +36,7 @@ namespace Microsoft.Tye
var dockerFileInfo = new FileInfo(containerService.DockerFile); var dockerFileInfo = new FileInfo(containerService.DockerFile);
var contextDirectory = containerService.DockerFileContext ?? dockerFileInfo.DirectoryName; var contextDirectory = containerService.DockerFileContext ?? dockerFileInfo.DirectoryName;
var dockerFilePath = Path.Combine(dockerFileInfo.DirectoryName!, "Dockerfile"); var dockerFilePath = Path.Combine(dockerFileInfo.DirectoryName, "Dockerfile");
output.WriteDebugLine($"Using existing Dockerfile '{dockerFilePath}'."); output.WriteDebugLine($"Using existing Dockerfile '{dockerFilePath}'.");
@ -83,7 +83,7 @@ namespace Microsoft.Tye
} }
string contextDirectory; string contextDirectory;
var dockerFilePath = Path.Combine(project.ProjectFile.DirectoryName!, "Dockerfile"); var dockerFilePath = Path.Combine(project.ProjectFile.DirectoryName, "Dockerfile");
TempFile? tempFile = null; TempFile? tempFile = null;
TempDirectory? tempDirectory = null; TempDirectory? tempDirectory = null;

Просмотреть файл

@ -101,7 +101,7 @@ namespace Microsoft.Tye
container.BaseImageName = "mcr.microsoft.com/dotnet/core/runtime"; container.BaseImageName = "mcr.microsoft.com/dotnet/core/runtime";
} }
if (string.IsNullOrEmpty(container.BaseImageTag) && (project.TargetFrameworkName == "netcoreapp" || project.TargetFrameworkName == "net")) if (string.IsNullOrEmpty(container.BaseImageTag) && project.TargetFrameworkName == "netcoreapp")
{ {
container.BaseImageTag = project.TargetFrameworkVersion; container.BaseImageTag = project.TargetFrameworkVersion;
} }
@ -112,7 +112,7 @@ namespace Microsoft.Tye
} }
container.BuildImageName ??= "mcr.microsoft.com/dotnet/core/sdk"; container.BuildImageName ??= "mcr.microsoft.com/dotnet/core/sdk";
container.BuildImageTag ??= project.TargetFrameworkVersion; container.BuildImageTag ??= "3.1";
if (container.ImageName == null && application.Registry?.Hostname == null) if (container.ImageName == null && application.Registry?.Hostname == null)
{ {

Просмотреть файл

@ -16,7 +16,7 @@ namespace Microsoft.Tye
public override async Task ExecuteAsync(OutputContext output, ApplicationBuilder application) public override async Task ExecuteAsync(OutputContext output, ApplicationBuilder application)
{ {
var outputFilePath = Path.GetFullPath(Path.Combine(application.Source.DirectoryName!, $"{application.Name}-generate-{Environment}.yaml")); var outputFilePath = Path.GetFullPath(Path.Combine(application.Source.DirectoryName, $"{application.Name}-generate-{Environment}.yaml"));
output.WriteInfoLine($"Writing output to '{outputFilePath}'."); output.WriteInfoLine($"Writing output to '{outputFilePath}'.");
{ {
File.Delete(outputFilePath); File.Delete(outputFilePath);

Просмотреть файл

@ -32,7 +32,7 @@ namespace Microsoft.Tye
container.UseMultiphaseDockerfile ??= true; container.UseMultiphaseDockerfile ??= true;
var dockerFilePath = Path.Combine(project.ProjectFile.DirectoryName!, "Dockerfile"); var dockerFilePath = Path.Combine(project.ProjectFile.DirectoryName, "Dockerfile");
if (File.Exists(dockerFilePath) && !Force) if (File.Exists(dockerFilePath) && !Force)
{ {
throw new CommandException("'Dockerfile' already exists for project. use '--force' to overwrite."); throw new CommandException("'Dockerfile' already exists for project. use '--force' to overwrite.");

Просмотреть файл

@ -25,7 +25,7 @@ namespace Microsoft.Tye
return Task.CompletedTask; return Task.CompletedTask;
} }
var chartDirectory = Path.Combine(project.ProjectFile.DirectoryName!, "charts"); var chartDirectory = Path.Combine(project.ProjectFile.DirectoryName, "charts");
if (Directory.Exists(chartDirectory) && !Force) if (Directory.Exists(chartDirectory) && !Force)
{ {
throw new CommandException("'charts' directory already exists for project. use '--force' to overwrite."); throw new CommandException("'charts' directory already exists for project. use '--force' to overwrite.");

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Tye</RootNamespace> <RootNamespace>Tye</RootNamespace>
<AssemblyName>Microsoft.Tye.Core</AssemblyName> <AssemblyName>Microsoft.Tye.Core</AssemblyName>
<PackageId>Microsoft.Tye.Core</PackageId> <PackageId>Microsoft.Tye.Core</PackageId>
@ -13,7 +13,7 @@
The Microsoft.Build.Locator package takes care of dynamically loading these assemblies The Microsoft.Build.Locator package takes care of dynamically loading these assemblies
at runtime. We don't need/want to ship them, just to have them as references. at runtime. We don't need/want to ship them, just to have them as references.
--> -->
<PackageReference Include="Microsoft.Build" Version="16.6.0" ExcludeAssets="runtime" /> <PackageReference Include="Microsoft.Build" Version="16.3.0" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.2.6" /> <PackageReference Include="Microsoft.Build.Locator" Version="1.2.6" />
<!-- Hoisted to avoid a conflict with Microsoft.Build --> <!-- Hoisted to avoid a conflict with Microsoft.Build -->
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" /> <PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />

Просмотреть файл

@ -158,7 +158,7 @@ namespace Microsoft.Tye
if (allowEmpty || !string.IsNullOrEmpty(line)) if (allowEmpty || !string.IsNullOrEmpty(line))
{ {
return line!.Trim(); return line.Trim();
} }
} }
} }

Просмотреть файл

@ -109,13 +109,13 @@ namespace Microsoft.Tye
var process = System.Diagnostics.Process.Start(startInfo); var process = System.Diagnostics.Process.Start(startInfo);
stdout = null; stdout = null;
if (process?.WaitForExit((int)timeout.TotalMilliseconds) == true) if (process.WaitForExit((int)timeout.TotalMilliseconds))
{ {
stdout = process?.StandardOutput.ReadToEnd(); stdout = process.StandardOutput.ReadToEnd();
} }
else else
{ {
process?.Kill(); process.Kill();
} }
} }
} }

Просмотреть файл

@ -52,7 +52,7 @@ namespace Microsoft.Tye
{ {
foreach (var kvp in environmentVariables) foreach (var kvp in environmentVariables)
{ {
process.StartInfo.Environment.Add(kvp!); process.StartInfo.Environment.Add(kvp);
} }
} }

Просмотреть файл

@ -254,9 +254,9 @@ namespace Microsoft.Tye
output.WriteDebugLine($"IntermediateOutputPath={project.IntermediateOutputPath}"); output.WriteDebugLine($"IntermediateOutputPath={project.IntermediateOutputPath}");
// Normalize directories to their absolute paths // Normalize directories to their absolute paths
project.IntermediateOutputPath = Path.Combine(project.ProjectFile.DirectoryName!, NormalizePath(project.IntermediateOutputPath)); project.IntermediateOutputPath = Path.Combine(project.ProjectFile.DirectoryName, NormalizePath(project.IntermediateOutputPath));
project.TargetPath = Path.Combine(project.ProjectFile.DirectoryName!, NormalizePath(project.TargetPath)); project.TargetPath = Path.Combine(project.ProjectFile.DirectoryName, NormalizePath(project.TargetPath));
project.PublishDir = Path.Combine(project.ProjectFile.DirectoryName!, NormalizePath(project.PublishDir)); project.PublishDir = Path.Combine(project.ProjectFile.DirectoryName, NormalizePath(project.PublishDir));
var targetFramework = projectInstance.GetPropertyValue("TargetFramework"); var targetFramework = projectInstance.GetPropertyValue("TargetFramework");
project.TargetFramework = targetFramework; project.TargetFramework = targetFramework;

Просмотреть файл

@ -182,7 +182,7 @@ namespace Microsoft.Tye
{ {
if (TryFindProjectFile(token, out var filePath, out var errorMessage)) if (TryFindProjectFile(token, out var filePath, out var errorMessage))
{ {
return new FileInfo(filePath!); return new FileInfo(filePath);
} }
else else
{ {

Просмотреть файл

@ -55,7 +55,7 @@ namespace Microsoft.Tye.Extensions.Dapr
// we'll assume the filename and config name are the same. // we'll assume the filename and config name are the same.
if (config.Data.TryGetValue("config", out var obj) && obj?.ToString() is string daprConfig) if (config.Data.TryGetValue("config", out var obj) && obj?.ToString() is string daprConfig)
{ {
var configFile = Path.Combine(context.Application.Source.DirectoryName!, "components", $"{daprConfig}.yaml"); var configFile = Path.Combine(context.Application.Source.DirectoryName, "components", $"{daprConfig}.yaml");
if (File.Exists(configFile)) if (File.Exists(configFile))
{ {
proxy.Args += $" -config \"{configFile}\""; proxy.Args += $" -config \"{configFile}\"";

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

Просмотреть файл

@ -29,18 +29,18 @@ namespace Microsoft.Tye.Hosting.Diagnostics.Logging
info.AddValue("RemoteStackTraceString", StackTrace, typeof(string)); // Do not rename (binary serialization) info.AddValue("RemoteStackTraceString", StackTrace, typeof(string)); // Do not rename (binary serialization)
info.AddValue("RemoteStackIndex", 0, typeof(int)); // Do not rename (binary serialization) info.AddValue("RemoteStackIndex", 0, typeof(int)); // Do not rename (binary serialization)
info.AddValue("ExceptionMethod", null, typeof(string)); // Do not rename (binary serialization) info.AddValue("ExceptionMethod", null, typeof(string)); // Do not rename (binary serialization)
info.AddValue("HResult", int.Parse(_exceptionMessage.GetProperty("HResult").GetString()!)); // Do not rename (binary serialization) info.AddValue("HResult", int.Parse(_exceptionMessage.GetProperty("HResult").GetString())); // Do not rename (binary serialization)
info.AddValue("Source", Source, typeof(string)); // Do not rename (binary serialization info.AddValue("Source", Source, typeof(string)); // Do not rename (binary serialization
info.AddValue("WatsonBuckets", null, typeof(byte[])); // Do not rename (binary serialization) info.AddValue("WatsonBuckets", null, typeof(byte[])); // Do not rename (binary serialization)
} }
public override string Message => _exceptionMessage.GetProperty("Message").GetString()!; public override string Message => _exceptionMessage.GetProperty("Message").GetString();
public override string StackTrace => _exceptionMessage.GetProperty("VerboseMessage").GetString()!; public override string StackTrace => _exceptionMessage.GetProperty("VerboseMessage").GetString();
public override string ToString() public override string ToString()
{ {
return _exceptionMessage.GetProperty("VerboseMessage").GetString()!; return _exceptionMessage.GetProperty("VerboseMessage").GetString();
} }
} }
} }

Просмотреть файл

@ -112,7 +112,7 @@ namespace Microsoft.Tye.Hosting.Diagnostics
if (message.TryGetProperty("{OriginalFormat}", out var formatElement)) if (message.TryGetProperty("{OriginalFormat}", out var formatElement))
{ {
var formatString = formatElement.GetString(); var formatString = formatElement.GetString();
var formatter = new LogValuesFormatter(formatString!); var formatter = new LogValuesFormatter(formatString);
var args = new object[formatter.ValueNames.Count]; var args = new object[formatter.ValueNames.Count];
for (var i = 0; i < args.Length; i++) for (var i = 0; i < args.Length; i++)
{ {
@ -126,7 +126,7 @@ namespace Microsoft.Tye.Hosting.Diagnostics
break; break;
} }
args[i] = argValue.GetString()!; args[i] = argValue.GetString();
} }
logger.Log(logLevel, new EventId(eventId, eventName), exception, formatString, args); logger.Log(logLevel, new EventId(eventId, eventName), exception, formatString, args);

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<Description>Diagnostics collector and exporter for .NET Core applications.</Description> <Description>Diagnostics collector and exporter for .NET Core applications.</Description>
<AssemblyName>Microsoft.Tye.Hosting.Diagnostics</AssemblyName> <AssemblyName>Microsoft.Tye.Hosting.Diagnostics</AssemblyName>
<PackageId>Microsoft.Tye.Hosting.Diagnostics</PackageId> <PackageId>Microsoft.Tye.Hosting.Diagnostics</PackageId>

Просмотреть файл

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<Description>Orchestration host APIs.</Description> <Description>Orchestration host APIs.</Description>
<AssemblyName>Microsoft.Tye.Hosting</AssemblyName> <AssemblyName>Microsoft.Tye.Hosting</AssemblyName>
<PackageId>Microsoft.Tye.Hosting</PackageId> <PackageId>Microsoft.Tye.Hosting</PackageId>

Просмотреть файл

@ -15,7 +15,7 @@ namespace Microsoft.Tye.Hosting.Model
public Application(FileInfo source, Dictionary<string, Service> services) public Application(FileInfo source, Dictionary<string, Service> services)
{ {
Source = source.FullName; Source = source.FullName;
ContextDirectory = source.DirectoryName!; ContextDirectory = source.DirectoryName;
Services = services; Services = services;
} }

Просмотреть файл

@ -39,7 +39,7 @@ namespace Microsoft.Tye.Hosting
// reuse being enabled by default by the OS. // reuse being enabled by default by the OS.
using var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); using var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Bind(new IPEndPoint(IPAddress.Loopback, 0)); socket.Bind(new IPEndPoint(IPAddress.Loopback, 0));
return ((IPEndPoint)socket.LocalEndPoint!).Port; return ((IPEndPoint)socket.LocalEndPoint).Port;
} }
foreach (var binding in service.Description.Bindings) foreach (var binding in service.Description.Bindings)

Просмотреть файл

@ -61,7 +61,7 @@ namespace Microsoft.Tye.Hosting
if (serviceDescription.RunInfo is ProjectRunInfo project) if (serviceDescription.RunInfo is ProjectRunInfo project)
{ {
path = project.RunCommand; path = project.RunCommand;
workingDirectory = project.ProjectFile.Directory!.FullName; workingDirectory = project.ProjectFile.Directory.FullName;
args = project.Args == null ? project.RunArguments : project.RunArguments + " " + project.Args; args = project.Args == null ? project.RunArguments : project.RunArguments + " " + project.Args;
buildProperties = project.BuildProperties.Aggregate(string.Empty, (current, property) => current + $";{property.Key}={property.Value}").TrimStart(';'); buildProperties = project.BuildProperties.Aggregate(string.Empty, (current, property) => current + $";{property.Key}={property.Value}").TrimStart(';');
@ -210,7 +210,7 @@ namespace Microsoft.Tye.Hosting
application.PopulateEnvironment(service, (k, v) => environment[k] = v); application.PopulateEnvironment(service, (k, v) => environment[k] = v);
if (_options.DebugMode && (_options.DebugAllServices || _options.ServicesToDebug!.Contains(serviceName, StringComparer.OrdinalIgnoreCase))) if (_options.DebugMode && (_options.DebugAllServices || _options.ServicesToDebug.Contains(serviceName, StringComparer.OrdinalIgnoreCase)))
{ {
environment["DOTNET_STARTUP_HOOKS"] = typeof(Hosting.Runtime.HostingRuntimeHelpers).Assembly.Location; environment["DOTNET_STARTUP_HOOKS"] = typeof(Hosting.Runtime.HostingRuntimeHelpers).Assembly.Location;
} }
@ -526,7 +526,7 @@ namespace Microsoft.Tye.Hosting
private static string GetEntryPointFilePath() private static string GetEntryPointFilePath()
{ {
using var process = Process.GetCurrentProcess(); using var process = Process.GetCurrentProcess();
return process.MainModule!.FileName!; return process.MainModule.FileName;
} }
private class ProcessInfo private class ProcessInfo

Просмотреть файл

@ -87,7 +87,7 @@ namespace Microsoft.Tye.Hosting
return events.Where(e => !string.IsNullOrEmpty(e.Trim())) return events.Where(e => !string.IsNullOrEmpty(e.Trim()))
.Select(e => JsonSerializer.Deserialize<IDictionary<string, string>>(e)) .Select(e => JsonSerializer.Deserialize<IDictionary<string, string>>(e))
.ToList()!; .ToList();
} }
private object GetLockForStore(string storeName) private object GetLockForStore(string storeName)

Просмотреть файл

@ -79,12 +79,12 @@ namespace Microsoft.Tye.Hosting
} }
else if (keys.Length == 3 && keys[0] == "service") else if (keys.Length == 3 && keys[0] == "service")
{ {
binding = bindings.FirstOrDefault(b => b.Service == keys[1] && b.Name == null)!; binding = bindings.FirstOrDefault(b => b.Service == keys[1] && b.Name == null);
return GetValueFromBinding(binding, keys[2]); return GetValueFromBinding(binding, keys[2]);
} }
else if (keys.Length == 4 && keys[0] == "service") else if (keys.Length == 4 && keys[0] == "service")
{ {
binding = bindings.FirstOrDefault(b => b.Service == keys[1] && b.Name == keys[2])!; binding = bindings.FirstOrDefault(b => b.Service == keys[1] && b.Name == keys[2]);
return GetValueFromBinding(binding, keys[3]); return GetValueFromBinding(binding, keys[3]);
} }

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Worker"> <Project Sdk="Microsoft.NET.Sdk.Worker">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Microsoft.Tye</RootNamespace> <RootNamespace>Microsoft.Tye</RootNamespace>
</PropertyGroup> </PropertyGroup>

Просмотреть файл

@ -64,7 +64,7 @@ namespace Microsoft.Tye
} }
else else
{ {
dockerRunInfo.DockerFileContext = new FileInfo(dockerRunInfo.DockerFile.DirectoryName!); dockerRunInfo.DockerFileContext = new FileInfo(dockerRunInfo.DockerFile.DirectoryName);
} }
} }

Просмотреть файл

@ -60,7 +60,7 @@ namespace Microsoft.Tye
{ {
if (ConfigFileFinder.TryFindSupportedFile(token, out var filePath, out var errorMessage)) if (ConfigFileFinder.TryFindSupportedFile(token, out var filePath, out var errorMessage))
{ {
return new FileInfo(filePath!); return new FileInfo(filePath);
} }
else if (required) else if (required)
{ {

Просмотреть файл

@ -72,11 +72,11 @@ services:
service.Bindings = null!; service.Bindings = null!;
service.Configuration = null!; service.Configuration = null!;
service.Volumes = null!; service.Volumes = null!;
service.Project = service.Project!.Substring(directory!.FullName.Length).TrimStart('/'); service.Project = service.Project!.Substring(directory.FullName.Length).TrimStart('/');
} }
// If the input file is a sln/project then place the config next to it // If the input file is a sln/project then place the config next to it
outputFilePath = Path.Combine(directory!.FullName, "tye.yaml"); outputFilePath = Path.Combine(directory.FullName, "tye.yaml");
} }
else else
{ {
@ -99,7 +99,7 @@ services:
private static void ThrowIfTyeFilePresent(FileInfo? path, string yml) private static void ThrowIfTyeFilePresent(FileInfo? path, string yml)
{ {
var tyeYaml = Path.Combine(path!.DirectoryName!, yml); var tyeYaml = Path.Combine(path!.DirectoryName, yml);
if (File.Exists(tyeYaml)) if (File.Exists(tyeYaml))
{ {
throw new CommandException($"File '{tyeYaml}' already exists. Use --force to override the {yml} file if desired."); throw new CommandException($"File '{tyeYaml}' already exists. Use --force to override the {yml} file if desired.");

Просмотреть файл

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Microsoft.Tye</RootNamespace> <RootNamespace>Microsoft.Tye</RootNamespace>
<AssemblyName>tye</AssemblyName> <AssemblyName>tye</AssemblyName>
<PackageId>Microsoft.Tye</PackageId> <PackageId>Microsoft.Tye</PackageId>

Просмотреть файл

@ -254,7 +254,7 @@ namespace E2ETest
// we assume that proxy will continue sending http request to the same replica // we assume that proxy will continue sending http request to the same replica
var randomReplicaPortRes1 = await _client.GetAsync($"http://localhost:{host.Application.Services["health-proxy"].Description.Bindings.First().Port}/ports"); var randomReplicaPortRes1 = await _client.GetAsync($"http://localhost:{host.Application.Services["health-proxy"].Description.Bindings.First().Port}/ports");
var randomReplicaPort1 = JsonSerializer.Deserialize<int[]>(await randomReplicaPortRes1.Content.ReadAsStringAsync())![0]; var randomReplicaPort1 = JsonSerializer.Deserialize<int[]>(await randomReplicaPortRes1.Content.ReadAsStringAsync())[0];
var randomReplica1 = replicasToBecomeReady.First(r => r.Bindings.Any(b => b.Port == randomReplicaPort1)); var randomReplica1 = replicasToBecomeReady.First(r => r.Bindings.Any(b => b.Port == randomReplicaPort1));
await DoOperationAndWaitForReplicasToChangeState(host, ReplicaState.Healthy, 1, new[] { randomReplica1.Name }.ToHashSet(), null, TimeSpan.Zero, async _ => await DoOperationAndWaitForReplicasToChangeState(host, ReplicaState.Healthy, 1, new[] { randomReplica1.Name }.ToHashSet(), null, TimeSpan.Zero, async _ =>
@ -263,7 +263,7 @@ namespace E2ETest
}); });
var randomReplicaPortRes2 = await _client.GetAsync($"http://localhost:{host.Application.Services["health-proxy"].Description.Bindings.First().Port}/ports"); var randomReplicaPortRes2 = await _client.GetAsync($"http://localhost:{host.Application.Services["health-proxy"].Description.Bindings.First().Port}/ports");
var randomReplicaPort2 = JsonSerializer.Deserialize<int[]>(await randomReplicaPortRes2.Content.ReadAsStringAsync())![0]; var randomReplicaPort2 = JsonSerializer.Deserialize<int[]>(await randomReplicaPortRes2.Content.ReadAsStringAsync())[0];
var randomReplica2 = replicasToBecomeReady.First(r => r.Bindings.Any(b => b.Port == randomReplicaPort2)); var randomReplica2 = replicasToBecomeReady.First(r => r.Bindings.Any(b => b.Port == randomReplicaPort2));
Assert.NotEqual(randomReplicaPort1, randomReplicaPort2); Assert.NotEqual(randomReplicaPort1, randomReplicaPort2);
@ -288,7 +288,7 @@ namespace E2ETest
}); });
var randomReplicaPortRes3 = await _client.GetAsync($"http://localhost:{host.Application.Services["health-proxy"].Description.Bindings.First().Port}/ports"); var randomReplicaPortRes3 = await _client.GetAsync($"http://localhost:{host.Application.Services["health-proxy"].Description.Bindings.First().Port}/ports");
var randomReplicaPort3 = JsonSerializer.Deserialize<int[]>(await randomReplicaPortRes3.Content.ReadAsStringAsync())![0]; var randomReplicaPort3 = JsonSerializer.Deserialize<int[]>(await randomReplicaPortRes3.Content.ReadAsStringAsync())[0];
Assert.Equal(randomReplicaPort3, randomReplicaPort2); Assert.Equal(randomReplicaPort3, randomReplicaPort2);
} }
@ -369,14 +369,14 @@ namespace E2ETest
Assert.True(res.IsSuccessStatusCode); Assert.True(res.IsSuccessStatusCode);
var headers = JsonSerializer.Deserialize<Dictionary<string, string>>(await res.Content.ReadAsStringAsync()); var headers = JsonSerializer.Deserialize<Dictionary<string, string>>(await res.Content.ReadAsStringAsync());
Assert.Equal("value1", headers!["name1"]); Assert.Equal("value1", headers["name1"]);
Assert.Equal("value2", headers["name2"]); Assert.Equal("value2", headers["name2"]);
res = await _client.GetAsync($"http://localhost:{host.Application.Services["health-all"].Description.Bindings.First().Port}/readinessHeaders"); res = await _client.GetAsync($"http://localhost:{host.Application.Services["health-all"].Description.Bindings.First().Port}/readinessHeaders");
Assert.True(res.IsSuccessStatusCode); Assert.True(res.IsSuccessStatusCode);
headers = JsonSerializer.Deserialize<Dictionary<string, string>>(await res.Content.ReadAsStringAsync()); headers = JsonSerializer.Deserialize<Dictionary<string, string>>(await res.Content.ReadAsStringAsync());
Assert.Equal("value3", headers!["name3"]); Assert.Equal("value3", headers["name3"]);
Assert.Equal("value4", headers["name4"]); Assert.Equal("value4", headers["name4"]);
} }
@ -404,7 +404,7 @@ namespace E2ETest
query.Add("readyDelay=" + readyDelay.Value); query.Add("readyDelay=" + readyDelay.Value);
} }
await _client.GetAsync($"http://localhost:{replica.Ports!.First()}/set?" + string.Join("&", query)); await _client.GetAsync($"http://localhost:{replica.Ports.First()}/set?" + string.Join("&", query));
} }
private async Task<int> ProbeNumberOfUniqueReplicas(string url) private async Task<int> ProbeNumberOfUniqueReplicas(string url)

Просмотреть файл

@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>Microsoft.Tye.E2ETest</AssemblyName> <AssemblyName>Microsoft.Tye.E2ETest</AssemblyName>
<IsTestProject>true</IsTestProject> <IsTestProject>true</IsTestProject>
<IsUnitTestProject>true</IsUnitTestProject> <IsUnitTestProject>true</IsUnitTestProject>
@ -14,8 +14,8 @@
The Microsoft.Build.Locator package takes care of dynamically loading these assemblies The Microsoft.Build.Locator package takes care of dynamically loading these assemblies
at runtime. We don't need/want to ship them, just to have them as references. at runtime. We don't need/want to ship them, just to have them as references.
--> -->
<PackageReference Include="Microsoft.Build" Version="16.6.0" ExcludeAssets="runtime" /> <PackageReference Include="Microsoft.Build" Version="16.3.0" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.6.0" ExcludeAssets="runtime" /> <PackageReference Include="Microsoft.Build.Framework" Version="16.3.0" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.2.6" /> <PackageReference Include="Microsoft.Build.Locator" Version="1.2.6" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -468,7 +468,7 @@ services:
Assert.NotNull(service); Assert.NotNull(service);
Assert.Equal(dockerNetwork, service!.Replicas!.FirstOrDefault().Value.DockerNetwork); Assert.Equal(dockerNetwork, service.Replicas.FirstOrDefault().Value.DockerNetwork);
} }
}); });
} }
@ -519,7 +519,7 @@ services:
Assert.NotNull(service); Assert.NotNull(service);
Assert.NotEqual(dockerNetwork, service!.Replicas!.FirstOrDefault().Value.DockerNetwork); Assert.NotEqual(dockerNetwork, service.Replicas.FirstOrDefault().Value.DockerNetwork);
} }
}); });
} }
@ -643,7 +643,7 @@ services:
var responseContent = var responseContent =
JsonSerializer.Deserialize<Dictionary<string, string>>(await response.Content.ReadAsStringAsync()); JsonSerializer.Deserialize<Dictionary<string, string>>(await response.Content.ReadAsStringAsync());
Assert.Equal("some content", responseContent!["content"]); Assert.Equal("some content", responseContent["content"]);
Assert.Equal("?key1=value1&key2=value2", responseContent["query"]); Assert.Equal("?key1=value1&key2=value2", responseContent["query"]);
}); });
} }
@ -904,7 +904,7 @@ services:
{ {
var serviceResult = await client.GetStringAsync($"{uri}api/v1/services/{serviceName}"); var serviceResult = await client.GetStringAsync($"{uri}api/v1/services/{serviceName}");
var service = JsonSerializer.Deserialize<V1Service>(serviceResult, _options); var service = JsonSerializer.Deserialize<V1Service>(serviceResult, _options);
var binding = service!.Description!.Bindings!.Where(b => b.Protocol == "http").Single(); var binding = service.Description!.Bindings.Where(b => b.Protocol == "http").Single();
return $"{binding.Protocol ?? "http"}://localhost:{binding.Port}"; return $"{binding.Protocol ?? "http"}://localhost:{binding.Port}";
} }

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<IsTestProject>true</IsTestProject> <IsTestProject>true</IsTestProject>
</PropertyGroup> </PropertyGroup>

Просмотреть файл

@ -1,19 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<TestRunnerName>XUnit</TestRunnerName> <TestRunnerName>XUnit</TestRunnerName>
<Nullable>disable</Nullable> <Nullable>disable</Nullable>
<IsTestProject>false</IsTestProject>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.Tye.Hosting\Microsoft.Tye.Hosting.csproj" /> <ProjectReference Include="..\..\src\Microsoft.Tye.Hosting\Microsoft.Tye.Hosting.csproj" />
<ProjectReference Include="..\..\src\Microsoft.Tye.Core\Microsoft.Tye.Core.csproj" /> <ProjectReference Include="..\..\src\Microsoft.Tye.Core\Microsoft.Tye.Core.csproj" />
<ProjectReference Include="..\..\src\tye\tye.csproj" /> <ProjectReference Include="..\..\src\tye\tye.csproj" />
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>Microsoft.Tye.UnitTests</AssemblyName> <AssemblyName>Microsoft.Tye.UnitTests</AssemblyName>
<IsTestProject>true</IsTestProject> <IsTestProject>true</IsTestProject>
<IsUnitTestProject>true</IsUnitTestProject> <IsUnitTestProject>true</IsUnitTestProject>