From 801122692fc2953759f41330f5d42e9144a034ea Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 14:35:38 +0000 Subject: [PATCH] [main] Update dependencies from dotnet/arcade (#6505) [main] Update dependencies from dotnet/arcade - Update to 4.5.0 and remove some legacy some build logic - Fix code style violations - Fix violation - Bump up code analysis version used by tests - Update tests --- azure-pipelines-microbuild.yml | 13 -- eng/Version.Details.xml | 16 +- eng/Versions.props | 8 +- eng/common/cross/arm/sources.list.xenial | 2 +- eng/common/cross/arm64/sources.list.xenial | 2 +- eng/common/cross/build-rootfs.sh | 182 ++++++++++++------ eng/common/cross/toolchain.cmake | 9 +- eng/common/cross/x64/sources.list.xenial | 11 ++ eng/common/templates/job/job.yml | 2 +- .../templates/job/source-index-stage1.yml | 2 +- eng/common/tools.ps1 | 14 +- global.json | 6 +- .../SymbolIsBannedInAnalyzersTests.cs | 2 +- .../AvoidDeadConditionalCode.cs | 2 +- .../DoNotPassLiteralsAsLocalizedParameters.cs | 2 +- ...nsInsteadUseTheCollectionDirectly.Fixer.cs | 2 +- .../TestForEmptyStringsUsingStringLength.cs | 2 +- .../CodeMetricsComputationTests.cs | 2 +- .../Runtime/SealInternalTypesTests.cs | 2 +- .../BasicPreferDictionaryTryGetValueFixer.vb | 6 +- .../TypeConversionAllocationAnalyzer.cs | 3 +- .../ReferenceAssemblies/ResourceLoader.cs | 8 +- .../CodeMetrics/CodeAnalysisMetricData.cs | 2 +- .../Extensions/IOperationExtensions.cs | 6 +- .../Compiler/Extensions/ISymbolExtensions.cs | 8 +- ...alysis.PointsToDataFlowOperationVisitor.cs | 2 +- .../DataFlow/PredicatedAnalysisData.cs | 2 +- .../AbstractRefactoringHelpers`3.cs | 8 +- 28 files changed, 194 insertions(+), 132 deletions(-) create mode 100644 eng/common/cross/x64/sources.list.xenial diff --git a/azure-pipelines-microbuild.yml b/azure-pipelines-microbuild.yml index 6c7b3e3f95..36c4d38262 100644 --- a/azure-pipelines-microbuild.yml +++ b/azure-pipelines-microbuild.yml @@ -15,12 +15,7 @@ trigger: variables: - name: _TeamName value: Roslyn - - name: _DotNetArtifactsCategory - value: .NETCore - - name: _DotNetValidationArtifactsCategory - value: .NETCoreValidation - group: DotNet-Roslyn-SDLValidation-Params - - group: DotNet-Blob-Feed - group: DotNet-Symbol-Server-Pats - group: DotNet-Versions-Publish - group: ManagedLanguageSecrets @@ -50,7 +45,6 @@ stages: name: NetCore1ESPool-Internal demands: ImageOverride -equals windows.vs2022preview.amd64 variables: - - group: DotNet-Blob-Feed - group: Publish-Build-Assets - name: _BuildConfig value: Release @@ -63,13 +57,6 @@ stages: -configuration $(_BuildConfig) /p:OfficialBuildId=$(BUILD.BUILDNUMBER) /p:DotNetSignType=$(_SignType) - /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) - /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) - /p:PublishToSymbolServer=true - /p:DotNetPublishToBlobFeed=true - /p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1) - /p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json - /p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory) /p:DotnetPublishUsingPipelines=true displayName: Build and Test diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c29d0a1736..b2218b549a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,22 +7,22 @@ - + https://github.com/dotnet/arcade - c4a85adbff520f62bfade7a6132f471506c3d35a + fb14cae30eacbe844468ac297b3d4c61e0bb9dc0 - + https://github.com/dotnet/roslyn - 1ce8866c9de4c2d67351ef6863699dee03b0804a + 6a5a63bbc9f4449d9bd1e95a8f9624939c3ccdc3 - + https://github.com/dotnet/roslyn - 1ce8866c9de4c2d67351ef6863699dee03b0804a + 6a5a63bbc9f4449d9bd1e95a8f9624939c3ccdc3 - + https://github.com/dotnet/roslyn - 1ce8866c9de4c2d67351ef6863699dee03b0804a + 6a5a63bbc9f4449d9bd1e95a8f9624939c3ccdc3 diff --git a/eng/Versions.props b/eng/Versions.props index d05e7ed37f..010b35c31b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -39,13 +39,13 @@ true - 4.4.0 - 4.4.0 - 4.4.0 + 4.5.0 + 4.5.0 + 4.5.0 3.3.1 3.7.0 - 4.4.0-2.22416.9 + 4.6.0-1.final 3.3.4 8.0.0-preview1.22621.6 $(DogfoodAnalyzersVersion) diff --git a/eng/common/cross/arm/sources.list.xenial b/eng/common/cross/arm/sources.list.xenial index eacd86b7df..56fbb36a59 100644 --- a/eng/common/cross/arm/sources.list.xenial +++ b/eng/common/cross/arm/sources.list.xenial @@ -8,4 +8,4 @@ deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse \ No newline at end of file +deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.xenial b/eng/common/cross/arm64/sources.list.xenial index eacd86b7df..56fbb36a59 100644 --- a/eng/common/cross/arm64/sources.list.xenial +++ b/eng/common/cross/arm64/sources.list.xenial @@ -8,4 +8,4 @@ deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse \ No newline at end of file +deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index ffaa88eb0f..1deadcc676 100644 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -14,6 +14,7 @@ usage() 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 "llvmx[.y] - optional, LLVM version for LLVM related packages." echo "--skipunmount - optional, will skip the unmount of rootfs folder." + echo "--skipsigcheck - optional, will skip package signature checks (allowing untrusted packages)." echo "--use-mirror - optional, use mirror URL to fetch resources, when available." echo "--jobs N - optional, restrict to N jobs." exit 1 @@ -55,7 +56,7 @@ __AlpinePackages+=" gettext-dev" __AlpinePackages+=" icu-dev" __AlpinePackages+=" libunwind-dev" __AlpinePackages+=" lttng-ust-dev" -__AlpinePackages+=" compiler-rt-static" +__AlpinePackages+=" compiler-rt" __AlpinePackages+=" numactl-dev" # runtime libraries' dependencies @@ -99,7 +100,27 @@ __HaikuPackages+=" mpfr_devel" __UbuntuPackages+=" libomp5" __UbuntuPackages+=" libomp-dev" +# Taken from https://github.com/alpinelinux/alpine-chroot-install/blob/6d08f12a8a70dd9b9dc7d997c88aa7789cc03c42/alpine-chroot-install#L85-L133 +__AlpineKeys=' +4a6a0840:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1yHJxQgsHQREclQu4Ohe\nqxTxd1tHcNnvnQTu/UrTky8wWvgXT+jpveroeWWnzmsYlDI93eLI2ORakxb3gA2O\nQ0Ry4ws8vhaxLQGC74uQR5+/yYrLuTKydFzuPaS1dK19qJPXB8GMdmFOijnXX4SA\njixuHLe1WW7kZVtjL7nufvpXkWBGjsfrvskdNA/5MfxAeBbqPgaq0QMEfxMAn6/R\nL5kNepi/Vr4S39Xvf2DzWkTLEK8pcnjNkt9/aafhWqFVW7m3HCAII6h/qlQNQKSo\nGuH34Q8GsFG30izUENV9avY7hSLq7nggsvknlNBZtFUcmGoQrtx3FmyYsIC8/R+B\nywIDAQAB +5243ef4b:MIIBIjANBgkqhkiG9w0BAQEFAA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VAorkpEAXdsfN8KSVv\nLSMazVlLp9GYq5SUpqYX3KnxdWBgN7BJoZ4sltsTpHQ/34SXWfu3UmyUveWj7wp0\nx9hwsPirVI00EEea9AbP7NM2rAyu6ukcm4m6ATd2DZJIViq2es6m60AE6SMCmrQF\nwmk4H/kdQgeAELVfGOm2VyJ3z69fQuywz7xu27S6zTKi05Qlnohxol4wVb6OB7qG\nLPRtK9ObgzRo/OPumyXqlzAi/Yvyd1ZQk8labZps3e16bQp8+pVPiumWioMFJDWV\nGZjCmyMSU8V6MB6njbgLHoyg2LCukCAeSjbPGGGYhnKLm1AKSoJh3IpZuqcKCk5C\n8CM1S15HxV78s9dFntEqIokCAwEAAQ== +' __Keyring= +__SkipSigCheck=0 __UseMirror=0 __UnprocessedBuildArgs= @@ -150,7 +171,6 @@ while :; do __BuildArch=riscv64 __AlpineArch=riscv64 __AlpinePackages="${__AlpinePackages// lldb-dev/}" - __AlpinePackages="${__AlpinePackages// compiler-rt-static/}" __QEMUArch=riscv64 __UbuntuArch=riscv64 __UbuntuRepo="http://deb.debian.org/debian-ports" @@ -160,10 +180,6 @@ while :; do if [[ -e "/usr/share/keyrings/debian-ports-archive-keyring.gpg" ]]; then __Keyring="--keyring /usr/share/keyrings/debian-ports-archive-keyring.gpg --include=debian-ports-archive-keyring" fi - - if [[ "$version" != "edge" && ( -z "$__AlpineVersion" || -z "$__AlpineMajorVersion" )]]; then - __AlpineVersion=edge # minimum version with APKINDEX.tar.gz (packages archive) - fi ;; ppc64le) __BuildArch=ppc64le @@ -175,10 +191,6 @@ while :; do __UbuntuPackages="${__UbuntuPackages// libomp-dev/}" __UbuntuPackages="${__UbuntuPackages// libomp5/}" unset __LLDB_Package - - if [[ "$version" != "edge" && ( -z "$__AlpineVersion" || -z "$__AlpineMajorVersion" )]]; then - __AlpineVersion=3.15 # minimum version that supports compiler-rt - fi ;; s390x) __BuildArch=s390x @@ -190,22 +202,20 @@ while :; do __UbuntuPackages="${__UbuntuPackages// libomp-dev/}" __UbuntuPackages="${__UbuntuPackages// libomp5/}" unset __LLDB_Package - - if [[ "$version" != "edge" && ( -z "$__AlpineVersion" || -z "$__AlpineMajorVersion" )]]; then - __AlpineVersion=3.15 # minimum version that supports compiler-rt - fi ;; x64) __BuildArch=x64 + __AlpineArch=x86_64 __UbuntuArch=amd64 __FreeBSDArch=amd64 __FreeBSDMachineArch=amd64 __illumosArch=x86_64 - __UbuntuRepo= + __UbuntuRepo="http://archive.ubuntu.com/ubuntu/" ;; x86) __BuildArch=x86 __UbuntuArch=i386 + __AlpineArch=x86 __UbuntuRepo="http://archive.ubuntu.com/ubuntu/" ;; lldb*) @@ -260,25 +270,40 @@ while :; do ;; jessie) # Debian 8 __CodeName=jessie - __UbuntuRepo="http://ftp.debian.org/debian/" + + if [[ -z "$__UbuntuRepo" ]]; then + __UbuntuRepo="http://ftp.debian.org/debian/" + fi ;; stretch) # Debian 9 __CodeName=stretch - __UbuntuRepo="http://ftp.debian.org/debian/" __LLDB_Package="liblldb-6.0-dev" + + if [[ -z "$__UbuntuRepo" ]]; then + __UbuntuRepo="http://ftp.debian.org/debian/" + fi ;; buster) # Debian 10 __CodeName=buster - __UbuntuRepo="http://ftp.debian.org/debian/" __LLDB_Package="liblldb-6.0-dev" + + if [[ -z "$__UbuntuRepo" ]]; then + __UbuntuRepo="http://ftp.debian.org/debian/" + fi ;; bullseye) # Debian 11 __CodeName=bullseye - __UbuntuRepo="http://ftp.debian.org/debian/" + + if [[ -z "$__UbuntuRepo" ]]; then + __UbuntuRepo="http://ftp.debian.org/debian/" + fi ;; sid) # Debian sid __CodeName=sid - __UbuntuRepo="http://ftp.debian.org/debian/" + + if [[ -z "$__UbuntuRepo" ]]; then + __UbuntuRepo="http://ftp.debian.org/debian/" + fi ;; tizen) __CodeName= @@ -296,29 +321,8 @@ while :; do parts=(${version//./ }) __AlpineMajorVersion="${parts[0]}" __AlpineMinoVersion="${parts[1]}" - - if [[ -z "$__AlpineVersion" ]]; then - __AlpineVersion="$__AlpineMajorVersion.$__AlpineMinoVersion" - fi + __AlpineVersion="$__AlpineMajorVersion.$__AlpineMinoVersion" fi - - case "$__AlpineVersion" in - 3.14) __AlpinePackages+=" llvm11-libs" ;; - 3.15) __AlpinePackages+=" llvm12-libs" ;; - 3.16) __AlpinePackages+=" llvm13-libs" ;; - 3.17) __AlpinePackages+=" llvm15-libs" ;; - edge) __AlpineLlvmLibsLookup=1 ;; - *) - if [[ "$__AlpineArch" =~ "s390x|ppc64le" ]]; then - __AlpineVersion=3.15 # minimum version that supports compiler-rt - __AlpinePackages+=" llvm12-libs" - elif [[ "$__AlpineArch" == "riscv64" ]]; then - __AlpineLlvmLibsLookup=1 - __AlpineVersion=edge # minimum version with APKINDEX.tar.gz (packages archive) - else - __AlpineVersion=3.13 # 3.13 to maximize compatibility - fi - esac ;; freebsd12) __CodeName=freebsd @@ -342,6 +346,9 @@ while :; do --skipunmount) __SkipUnmount=1 ;; + --skipsigcheck) + __SkipSigCheck=1 + ;; --rootfsdir|-rootfsdir) shift __RootfsDir="$1" @@ -361,10 +368,45 @@ while :; do shift done +case "$__AlpineVersion" in + 3.14) __AlpinePackages+=" llvm11-libs" ;; + 3.15) __AlpinePackages+=" llvm12-libs" ;; + 3.16) __AlpinePackages+=" llvm13-libs" ;; + 3.17) __AlpinePackages+=" llvm15-libs" ;; + edge) __AlpineLlvmLibsLookup=1 ;; + *) + if [[ "$__AlpineArch" =~ s390x|ppc64le ]]; then + __AlpineVersion=3.15 # minimum version that supports lldb-dev + __AlpinePackages+=" llvm12-libs" + elif [[ "$__AlpineArch" == "x86" ]]; then + __AlpineVersion=3.17 # minimum version that supports lldb-dev + __AlpinePackages+=" llvm15-libs" + elif [[ "$__AlpineArch" == "riscv64" ]]; then + __AlpineLlvmLibsLookup=1 + __AlpineVersion=edge # minimum version with APKINDEX.tar.gz (packages archive) + else + __AlpineVersion=3.13 # 3.13 to maximize compatibility + __AlpinePackages+=" llvm10-libs" + + if [[ "$__AlpineArch" == "armv7" ]]; then + __AlpinePackages="${__AlpinePackages//numactl-dev/}" + fi + fi +esac + +if [[ "$__AlpineVersion" =~ 3\.1[345] ]]; then + # compiler-rt--static was merged in compiler-rt package in alpine 3.16 + # for older versions, we need compiler-rt--static, so replace the name + __AlpinePackages="${__AlpinePackages/compiler-rt/compiler-rt-static}" +fi + if [[ "$__BuildArch" == "armel" ]]; then __LLDB_Package="lldb-3.5-dev" -elif [[ "$__BuildArch" == "arm" && "$__AlpineVersion" == "3.13" ]]; then - __AlpinePackages="${__AlpinePackages//numactl-dev/}" +fi + +if [[ "$__CodeName" == "xenial" && "$__UbuntuArch" == "armhf" ]]; then + # libnuma-dev is not available on armhf for xenial + __UbuntuPackages="${__UbuntuPackages//libnuma-dev/}" fi __UbuntuPackages+=" ${__LLDB_Package:-}" @@ -393,13 +435,18 @@ __RootfsDir="$( cd "$__RootfsDir" && pwd )" if [[ "$__CodeName" == "alpine" ]]; then __ApkToolsVersion=2.12.11 + __ApkToolsSHA512SUM=53e57b49230da07ef44ee0765b9592580308c407a8d4da7125550957bb72cb59638e04f8892a18b584451c8d841d1c7cb0f0ab680cc323a3015776affaa3be33 __ApkToolsDir="$(mktemp -d)" + __ApkKeysDir="$(mktemp -d)" wget "https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic//v$__ApkToolsVersion/x86_64/apk.static" -P "$__ApkToolsDir" + echo "$__ApkToolsSHA512SUM $__ApkToolsDir/apk.static" | sha512sum -c chmod +x "$__ApkToolsDir/apk.static" - mkdir -p "$__RootfsDir"/usr/bin - cp -v "/usr/bin/qemu-$__QEMUArch-static" "$__RootfsDir/usr/bin" + if [[ -f "/usr/bin/qemu-$__QEMUArch-static" ]]; then + mkdir -p "$__RootfsDir"/usr/bin + cp -v "/usr/bin/qemu-$__QEMUArch-static" "$__RootfsDir/usr/bin" + fi if [[ "$__AlpineVersion" == "edge" ]]; then version=edge @@ -407,26 +454,40 @@ if [[ "$__CodeName" == "alpine" ]]; then version="v$__AlpineVersion" fi + for line in $__AlpineKeys; do + id="${line%%:*}" + content="${line#*:}" + + echo -e "-----BEGIN PUBLIC KEY-----\n$content\n-----END PUBLIC KEY-----" > "$__ApkKeysDir/alpine-devel@lists.alpinelinux.org-$id.rsa.pub" + done + + if [[ "$__SkipSigCheck" == "1" ]]; then + __ApkSignatureArg="--allow-untrusted" + else + __ApkSignatureArg="--keys-dir $__ApkKeysDir" + fi + + # initialize DB "$__ApkToolsDir/apk.static" \ -X "http://dl-cdn.alpinelinux.org/alpine/$version/main" \ -X "http://dl-cdn.alpinelinux.org/alpine/$version/community" \ - -U --allow-untrusted --root "$__RootfsDir" --arch "$__AlpineArch" --initdb \ - add $__AlpinePackages + -U $__ApkSignatureArg --root "$__RootfsDir" --arch "$__AlpineArch" --initdb add if [[ "$__AlpineLlvmLibsLookup" == 1 ]]; then - "$__ApkToolsDir/apk.static" \ + __AlpinePackages+=" $("$__ApkToolsDir/apk.static" \ -X "http://dl-cdn.alpinelinux.org/alpine/$version/main" \ -X "http://dl-cdn.alpinelinux.org/alpine/$version/community" \ - -U --allow-untrusted --root "$__RootfsDir" --arch "$__AlpineArch" \ - search 'llvm*-libs' | sort | tail -1 | while IFS=- read name rest; do - "$__ApkToolsDir/apk.static" \ - -X "http://dl-cdn.alpinelinux.org/alpine/$version/main" \ - -X "http://dl-cdn.alpinelinux.org/alpine/$version/community" \ - -U --allow-untrusted --root "$__RootfsDir" --arch "$__AlpineArch" \ - add "$name-libs" - done + -U $__ApkSignatureArg --root "$__RootfsDir" --arch "$__AlpineArch" \ + search 'llvm*-libs' | sort | tail -1 | sed 's/-[^-]*//2g')" fi + # install all packages in one go + "$__ApkToolsDir/apk.static" \ + -X "http://dl-cdn.alpinelinux.org/alpine/$version/main" \ + -X "http://dl-cdn.alpinelinux.org/alpine/$version/community" \ + -U $__ApkSignatureArg --root "$__RootfsDir" --arch "$__AlpineArch" \ + add $__AlpinePackages + rm -r "$__ApkToolsDir" elif [[ "$__CodeName" == "freebsd" ]]; then mkdir -p "$__RootfsDir"/usr/local/etc @@ -560,7 +621,12 @@ elif [[ "$__CodeName" == "haiku" ]]; then fi done elif [[ -n "$__CodeName" ]]; then - qemu-debootstrap $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" + + if [[ "$__SkipSigCheck" == "0" ]]; then + __Keyring="$__Keyring --force-check-gpg" + fi + + debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" cp "$__CrossDir/$__BuildArch/sources.list.$__CodeName" "$__RootfsDir/etc/apt/sources.list" chroot "$__RootfsDir" apt-get update chroot "$__RootfsDir" apt-get -f -y install diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index ccfb9951a5..1c9d212d13 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -76,7 +76,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "s390x") set(TOOLCHAIN "s390x-linux-gnu") elseif(TARGET_ARCH_NAME STREQUAL "x64") set(CMAKE_SYSTEM_PROCESSOR x86_64) - if(LINUX) + if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/x86_64-alpine-linux-musl) + set(TOOLCHAIN "x86_64-alpine-linux-musl") + elseif(LINUX) set(TOOLCHAIN "x86_64-linux-gnu") if(TIZEN) set(TIZEN_TOOLCHAIN "x86_64-tizen-linux-gnu/9.2.0") @@ -279,7 +281,7 @@ endif() # Specify compile options -if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU) +if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x|x64|x86)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) @@ -298,6 +300,9 @@ if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$") add_definitions (-DCLR_ARM_FPU_CAPABILITY=${CLR_ARM_FPU_CAPABILITY}) + # persist variables across multiple try_compile passes + list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CLR_ARM_FPU_TYPE CLR_ARM_FPU_CAPABILITY) + if(TARGET_ARCH_NAME STREQUAL "armel") add_compile_options(-mfloat-abi=softfp) endif() diff --git a/eng/common/cross/x64/sources.list.xenial b/eng/common/cross/x64/sources.list.xenial new file mode 100644 index 0000000000..ad9c5a0144 --- /dev/null +++ b/eng/common/cross/x64/sources.list.xenial @@ -0,0 +1,11 @@ +deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted +deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted + +deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index 61914a1fbc..b214a31db2 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -101,7 +101,7 @@ jobs: # handle key-value variable syntax. # example: # - [key]: [value] - - ${{ if and(eq(variable.name, ''), eq(variable.group, '')) }}: + - ${{ if and(eq(variable.name, ''), eq(variable.group, ''), eq(variable.template, '')) }}: - ${{ each pair in variable }}: - name: ${{ pair.key }} value: ${{ pair.value }} diff --git a/eng/common/templates/job/source-index-stage1.yml b/eng/common/templates/job/source-index-stage1.yml index 71b66aeb8a..b98202aa02 100644 --- a/eng/common/templates/job/source-index-stage1.yml +++ b/eng/common/templates/job/source-index-stage1.yml @@ -1,6 +1,6 @@ parameters: runAsPublic: false - sourceIndexPackageVersion: 1.0.1-20221220.2 + sourceIndexPackageVersion: 1.0.1-20230228.2 sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json sourceIndexBuildCommand: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "eng/common/build.ps1 -restore -build -binarylog -ci" preSteps: [] diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 7caacc6de2..8ad03be3ec 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -913,11 +913,13 @@ if (!$disableConfigureToolsetImport) { function Enable-Nuget-EnhancedRetry() { if ($ci) { Write-Host "Setting NUGET enhanced retry environment variables" - $env:NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY = 'true' - $env:NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT = 6 - $env:NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS = 1000 - Write-PipelineSetVariable -Name 'NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY' -Value 'true' - Write-PipelineSetVariable -Name 'NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT' -Value '6' - Write-PipelineSetVariable -Name 'NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS' -Value '1000' + $env:NUGET_ENABLE_ENHANCED_HTTP_RETRY = 'true' + $env:NUGET_ENHANCED_MAX_NETWORK_TRY_COUNT = 6 + $env:NUGET_ENHANCED_NETWORK_RETRY_DELAY_MILLISECONDS = 1000 + $env:NUGET_RETRY_HTTP_429 = 'true' + Write-PipelineSetVariable -Name 'NUGET_ENABLE_ENHANCED_HTTP_RETRY' -Value 'true' + Write-PipelineSetVariable -Name 'NUGET_ENHANCED_MAX_NETWORK_TRY_COUNT' -Value '6' + Write-PipelineSetVariable -Name 'NUGET_ENHANCED_NETWORK_RETRY_DELAY_MILLISECONDS' -Value '1000' + Write-PipelineSetVariable -Name 'NUGET_RETRY_HTTP_429' -Value 'true' } } diff --git a/global.json b/global.json index 5b64ffb54b..04bf53c0a1 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "8.0.100-alpha.1.23061.8", + "dotnet": "8.0.100-preview.3.23178.7", "runtimes": { "dotnet": [ "3.1.7", @@ -13,11 +13,11 @@ "xcopy-msbuild": "16.10.0-preview2" }, "sdk": { - "version": "8.0.100-alpha.1.23061.8", + "version": "8.0.100-preview.3.23178.7", "allowPrerelease": true, "rollForward": "patch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23120.1" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23213.1" } } diff --git a/src/Microsoft.CodeAnalysis.Analyzers/UnitTests/MetaAnalyzers/SymbolIsBannedInAnalyzersTests.cs b/src/Microsoft.CodeAnalysis.Analyzers/UnitTests/MetaAnalyzers/SymbolIsBannedInAnalyzersTests.cs index 75fff3e2e4..29ec5f76f3 100644 --- a/src/Microsoft.CodeAnalysis.Analyzers/UnitTests/MetaAnalyzers/SymbolIsBannedInAnalyzersTests.cs +++ b/src/Microsoft.CodeAnalysis.Analyzers/UnitTests/MetaAnalyzers/SymbolIsBannedInAnalyzersTests.cs @@ -267,7 +267,7 @@ public async Task UseBannedApi_ISourceGenerator() { await new VerifyCS.Test { - ReferenceAssemblies = AdditionalMetadataReferences.Default.WithPackages(ImmutableArray.Create(new PackageIdentity("Microsoft.CodeAnalysis.Common", "4.4.0"))), + ReferenceAssemblies = AdditionalMetadataReferences.Default.WithPackages(ImmutableArray.Create(new PackageIdentity("Microsoft.CodeAnalysis.Common", "4.5.0"))), TestCode = """ using Microsoft.CodeAnalysis; diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/Maintainability/AvoidDeadConditionalCode.cs b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/Maintainability/AvoidDeadConditionalCode.cs index 9c4fffe4e8..f8bf10dfab 100644 --- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/Maintainability/AvoidDeadConditionalCode.cs +++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/Maintainability/AvoidDeadConditionalCode.cs @@ -74,7 +74,7 @@ public override void Initialize(AnalysisContext context) { static bool ShouldAnalyze(IOperation op) => (op as IBinaryOperation)?.IsComparisonOperator() == true || - (op as IInvocationOperation)?.TargetMethod.ReturnType.SpecialType == SpecialType.System_Boolean || + op is IInvocationOperation { TargetMethod.ReturnType.SpecialType: SpecialType.System_Boolean } || op.Kind == OperationKind.Coalesce || op.Kind == OperationKind.ConditionalAccess || op.Kind == OperationKind.IsNull || diff --git a/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/DoNotPassLiteralsAsLocalizedParameters.cs b/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/DoNotPassLiteralsAsLocalizedParameters.cs index 91392dbe88..64e84fc51e 100644 --- a/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/DoNotPassLiteralsAsLocalizedParameters.cs +++ b/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/DoNotPassLiteralsAsLocalizedParameters.cs @@ -302,7 +302,7 @@ private static LocalizableAttributeState GetLocalizableAttributeState(ISymbol sy return localizedState; } - ISymbol containingSymbol = (symbol as IMethodSymbol)?.AssociatedSymbol is IPropertySymbol propertySymbol ? propertySymbol : symbol.ContainingSymbol; + ISymbol containingSymbol = symbol is IMethodSymbol { AssociatedSymbol: IPropertySymbol propertySymbol } ? propertySymbol : symbol.ContainingSymbol; return GetLocalizableAttributeState(containingSymbol, localizableAttributeTypeSymbol); } diff --git a/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/DoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectly.Fixer.cs b/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/DoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectly.Fixer.cs index 29c1bbe942..df7f2d16f6 100644 --- a/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/DoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectly.Fixer.cs +++ b/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/DoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectly.Fixer.cs @@ -127,7 +127,7 @@ private Task UseCollectionDirectlyAsync(Document document, SyntaxNode return null; } - [return: NotNullIfNotNull("syntaxNode")] + [return: NotNullIfNotNull(nameof(syntaxNode))] private protected abstract SyntaxNode? AdjustSyntaxNode(SyntaxNode? syntaxNode); } } diff --git a/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/TestForEmptyStringsUsingStringLength.cs b/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/TestForEmptyStringsUsingStringLength.cs index eef192380e..f21092d2de 100644 --- a/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/TestForEmptyStringsUsingStringLength.cs +++ b/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/TestForEmptyStringsUsingStringLength.cs @@ -145,7 +145,7 @@ private static bool IsEmptyString(IOperation expression) Optional constantValueOpt = expression.ConstantValue; if (constantValueOpt.HasValue) { - return (constantValueOpt.Value as string)?.Length == 0; + return constantValueOpt.Value is string { Length: 0 }; } if (expression.Kind == OperationKind.FieldReference) diff --git a/src/NetAnalyzers/UnitTests/Microsoft.CodeQuality.Analyzers/Maintainability/CodeMetricsComputationTests.cs b/src/NetAnalyzers/UnitTests/Microsoft.CodeQuality.Analyzers/Maintainability/CodeMetricsComputationTests.cs index 6c9599d4e6..e42342e193 100644 --- a/src/NetAnalyzers/UnitTests/Microsoft.CodeQuality.Analyzers/Maintainability/CodeMetricsComputationTests.cs +++ b/src/NetAnalyzers/UnitTests/Microsoft.CodeQuality.Analyzers/Maintainability/CodeMetricsComputationTests.cs @@ -823,7 +823,7 @@ class C4 C4: (Lines: 4, ExecutableLines: 1, MntIndex: 90, CycCxty: 1, DepthInherit: 1) C4.MyConst: (Lines: 1, ExecutableLines: 1, MntIndex: 90, CycCxty: 0) CAttr: (Lines: 1, ExecutableLines: 0, MntIndex: 100, CycCxty: 1, CoupledTypes: {System.Attribute}, DepthInherit: 2) - CAttr.CAttr(string): (Lines: 1, ExecutableLines: 0, MntIndex: 100, CycCxty: 1) + CAttr.CAttr(string): (Lines: 1, ExecutableLines: 0, MntIndex: 100, CycCxty: 1, CoupledTypes: {System.Attribute}) "; VerifyCSharp(source, expectedMetricsText); diff --git a/src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Runtime/SealInternalTypesTests.cs b/src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Runtime/SealInternalTypesTests.cs index 547235c5ee..671b773c5d 100644 --- a/src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Runtime/SealInternalTypesTests.cs +++ b/src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Runtime/SealInternalTypesTests.cs @@ -108,7 +108,7 @@ End Class [InlineData("public", "private")] [InlineData("public", "private protected")] [InlineData("internal", "public")] - [InlineData("internal", "internal protected")] + [InlineData("internal", "protected internal")] public Task NestedOneDeep_NotExternallyVisible_Diagnostic_CS(string outerModifiers, string innerModifiers) { string source = $@" diff --git a/src/NetAnalyzers/VisualBasic/Microsoft.NetCore.Analyzers/Runtime/BasicPreferDictionaryTryGetValueFixer.vb b/src/NetAnalyzers/VisualBasic/Microsoft.NetCore.Analyzers/Runtime/BasicPreferDictionaryTryGetValueFixer.vb index 86f6ea02f2..c19dd419ee 100644 --- a/src/NetAnalyzers/VisualBasic/Microsoft.NetCore.Analyzers/Runtime/BasicPreferDictionaryTryGetValueFixer.vb +++ b/src/NetAnalyzers/VisualBasic/Microsoft.NetCore.Analyzers/Runtime/BasicPreferDictionaryTryGetValueFixer.vb @@ -44,12 +44,14 @@ Namespace Microsoft.NetCore.VisualBasic.Analyzers.Runtime Dim valueAssignment = generator.LocalDeclarationStatement(dictionaryValueType, Value).WithLeadingTrivia(SyntaxFactory.CarriageReturn).WithoutTrailingTrivia() Dim tryGetValueInvocation = generator.InvocationExpression(tryGetValueAccess, keyArgument, generator.Argument(generator.IdentifierName(Value))) +#Disable Warning IDE0270 ' Use coalesce expression - suppressed for readability Dim ifStatement As SyntaxNode = containsKeyAccess.AncestorsAndSelf().OfType(Of MultiLineIfBlockSyntax).FirstOrDefault() - If ifStatement Is Nothing + If ifStatement Is Nothing Then ifStatement = containsKeyAccess.AncestorsAndSelf().OfType(Of SingleLineIfStatementSyntax).FirstOrDefault() End If +#Enable Warning IDE0270 ' Use coalesce expression - If ifStatement Is Nothing + If ifStatement Is Nothing Then ' For ternary expressions, we need to add the value assignment before the parent of the expression, since the ternary expression is not an alone-standing expression. ifStatement = containsKeyAccess.AncestorsAndSelf().OfType(Of TernaryConditionalExpressionSyntax).FirstOrDefault()?.Parent End If diff --git a/src/PerformanceSensitiveAnalyzers/CSharp/Analyzers/TypeConversionAllocationAnalyzer.cs b/src/PerformanceSensitiveAnalyzers/CSharp/Analyzers/TypeConversionAllocationAnalyzer.cs index cadad3007d..d26aa50934 100644 --- a/src/PerformanceSensitiveAnalyzers/CSharp/Analyzers/TypeConversionAllocationAnalyzer.cs +++ b/src/PerformanceSensitiveAnalyzers/CSharp/Analyzers/TypeConversionAllocationAnalyzer.cs @@ -78,8 +78,7 @@ protected override void AnalyzeNode(SyntaxNodeAnalysisContext context, in Perfor var cancellationToken = context.CancellationToken; Action reportDiagnostic = context.ReportDiagnostic; bool assignedToReadonlyFieldOrProperty = - (context.ContainingSymbol as IFieldSymbol)?.IsReadOnly == true || - (context.ContainingSymbol as IPropertySymbol)?.IsReadOnly == true; + context.ContainingSymbol is IFieldSymbol { IsReadOnly: true } or IPropertySymbol { IsReadOnly: true }; // this.fooObjCall(10); // new myobject(10); diff --git a/src/PerformanceTests/Utilities/ReferenceAssemblies/ResourceLoader.cs b/src/PerformanceTests/Utilities/ReferenceAssemblies/ResourceLoader.cs index 9499bda0a6..a815b3bab1 100644 --- a/src/PerformanceTests/Utilities/ReferenceAssemblies/ResourceLoader.cs +++ b/src/PerformanceTests/Utilities/ReferenceAssemblies/ResourceLoader.cs @@ -12,13 +12,7 @@ internal static class ResourceLoader private static Stream GetResourceStream(string name) { var assembly = typeof(ResourceLoader).GetTypeInfo().Assembly; - - var stream = assembly.GetManifestResourceStream(name); - if (stream == null) - { - throw new InvalidOperationException($"Resource '{name}' not found in {assembly.FullName}."); - } - + var stream = assembly.GetManifestResourceStream(name) ?? throw new InvalidOperationException($"Resource '{name}' not found in {assembly.FullName}."); return stream; } diff --git a/src/Utilities/Compiler/CodeMetrics/CodeAnalysisMetricData.cs b/src/Utilities/Compiler/CodeMetrics/CodeAnalysisMetricData.cs index e6c2ca1592..d31a5742ee 100644 --- a/src/Utilities/Compiler/CodeMetrics/CodeAnalysisMetricData.cs +++ b/src/Utilities/Compiler/CodeMetrics/CodeAnalysisMetricData.cs @@ -269,7 +269,7 @@ internal static async Task> ComputeAsync( => (await Task.WhenAll( from child in children #if !LEGACY_CODE_METRICS_MODE // Skip implicitly declared symbols, such as default constructor, for non-legacy mode. - where !child.IsImplicitlyDeclared || (child as INamespaceSymbol)?.IsGlobalNamespace == true + where !child.IsImplicitlyDeclared || child is INamespaceSymbol { IsGlobalNamespace: true } #endif select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray(); } diff --git a/src/Utilities/Compiler/Extensions/IOperationExtensions.cs b/src/Utilities/Compiler/Extensions/IOperationExtensions.cs index 4cc6f5ba77..4e3a51ff40 100644 --- a/src/Utilities/Compiler/Extensions/IOperationExtensions.cs +++ b/src/Utilities/Compiler/Extensions/IOperationExtensions.cs @@ -684,7 +684,7 @@ public static IOperation WalkDownParentheses(this IOperation operation) return operation; } - [return: NotNullIfNotNull("operation")] + [return: NotNullIfNotNull(nameof(operation))] public static IOperation? WalkUpParentheses(this IOperation? operation) { if (operation is null) @@ -730,7 +730,7 @@ public static IOperation WalkDownConversion(this IOperation operation, Func GetParameters(this ISymbol? symbol) diff --git a/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/PointsToAnalysis/PointsToAnalysis.PointsToDataFlowOperationVisitor.cs b/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/PointsToAnalysis/PointsToAnalysis.PointsToDataFlowOperationVisitor.cs index 595adef853..b946cc988e 100644 --- a/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/PointsToAnalysis/PointsToAnalysis.PointsToDataFlowOperationVisitor.cs +++ b/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/PointsToAnalysis/PointsToAnalysis.PointsToDataFlowOperationVisitor.cs @@ -182,7 +182,7 @@ protected override void SetAbstractValue(AnalysisEntity analysisEntity, PointsTo Debug.Assert(value == _defaultPointsToValueGenerator.GetOrCreateDefaultValue(analysisEntity)); Debug.Assert(!CurrentAnalysisData.TryGetValue(analysisEntity, out var currentValue) || currentValue.Kind == PointsToAbstractValueKind.Unknown && - (analysisEntity.Symbol as IParameterSymbol)?.RefKind == RefKind.Out); + analysisEntity.Symbol is IParameterSymbol { RefKind: RefKind.Out }); return; } diff --git a/src/Utilities/FlowAnalysis/FlowAnalysis/Framework/DataFlow/PredicatedAnalysisData.cs b/src/Utilities/FlowAnalysis/FlowAnalysis/Framework/DataFlow/PredicatedAnalysisData.cs index 342e4e1d54..dd7fddf894 100644 --- a/src/Utilities/FlowAnalysis/FlowAnalysis/Framework/DataFlow/PredicatedAnalysisData.cs +++ b/src/Utilities/FlowAnalysis/FlowAnalysis/Framework/DataFlow/PredicatedAnalysisData.cs @@ -193,7 +193,7 @@ protected virtual void RemoveEntryInPredicatedData(TKey key, DictionaryAnalysisD predicatedData.Remove(key); } - [return: NotNullIfNotNull(parameterName: "fromData")] + [return: NotNullIfNotNull(parameterName: nameof(fromData))] private static DictionaryAnalysisData? Clone(DictionaryAnalysisData? fromData) { if (fromData == null) diff --git a/src/Utilities/Refactoring/AbstractRefactoringHelpers`3.cs b/src/Utilities/Refactoring/AbstractRefactoringHelpers`3.cs index a84f097264..b15407708f 100644 --- a/src/Utilities/Refactoring/AbstractRefactoringHelpers`3.cs +++ b/src/Utilities/Refactoring/AbstractRefactoringHelpers`3.cs @@ -479,12 +479,8 @@ protected virtual async Task AddNodesDeepInAsync( { // If we're deep inside we don't have to deal with being on edges (that gets dealt by TryGetSelectedNodeAsync) // -> can simply FindToken -> proceed testing its ancestors - var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); - if (root is null) - { - throw new NotSupportedException("Document does not support syntax trees"); - } - + var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false) + ?? throw new NotSupportedException("Document does not support syntax trees"); var token = root.FindTokenOnRightOfPosition(position, true); // traverse upwards and add all parents if of correct type