From 553aabc38bd9aae621a83895a8dd7c60d5fc80ef Mon Sep 17 00:00:00 2001 From: vseanreesermsft <78103370+vseanreesermsft@users.noreply.github.com> Date: Wed, 2 Apr 2025 12:33:44 -0700 Subject: [PATCH 01/76] Update branding to 8.0.16 (#61283) --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index de7ba7844e19..d29c89887dff 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -8,7 +8,7 @@ 8 0 - 15 + 16 false From fb83be6610888b613e57334bfb32d46d069cbc12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 12:36:59 -0700 Subject: [PATCH 02/76] [release/8.0] (deps): Bump src/submodules/googletest (#61260) Bumps [src/submodules/googletest](https://github.com/google/googletest) from `24a9e94` to `52204f7`. - [Release notes](https://github.com/google/googletest/releases) - [Commits](https://github.com/google/googletest/compare/24a9e940d481f992ba852599c78bb2217362847b...52204f78f94d7512df1f0f3bea1d47437a2c3a58) --- updated-dependencies: - dependency-name: src/submodules/googletest dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/submodules/googletest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/submodules/googletest b/src/submodules/googletest index 24a9e940d481..52204f78f94d 160000 --- a/src/submodules/googletest +++ b/src/submodules/googletest @@ -1 +1 @@ -Subproject commit 24a9e940d481f992ba852599c78bb2217362847b +Subproject commit 52204f78f94d7512df1f0f3bea1d47437a2c3a58 From 0c9649ea194730c80fd00dfd6c8e4ace4a38a082 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 12:37:30 -0700 Subject: [PATCH 03/76] Update dependencies from https://github.com/dotnet/source-build-externals build 20250402.2 (#61281) Microsoft.SourceBuild.Intermediate.source-build-externals From Version 8.0.0-alpha.1.25104.1 -> To Version 8.0.0-alpha.1.25202.2 Co-authored-by: dotnet-maestro[bot] --- NuGet.config | 4 ---- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/NuGet.config b/NuGet.config index d263ff7579a8..1c2f27eb90ce 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,10 +6,8 @@ - - @@ -30,10 +28,8 @@ - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3744a021b8c8..7ea1744816b7 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -189,9 +189,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 1584e493603cfc4e9b36b77d6d4afe97de6363f9 - + https://github.com/dotnet/source-build-externals - dc30cd1ec22f198d658e011c14525d4d65873991 + 16bcad1c13be082bd52ce178896d1119a73081a9 diff --git a/eng/Versions.props b/eng/Versions.props index d29c89887dff..a1d737fca785 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -166,7 +166,7 @@ 8.0.0-beta.25111.4 8.0.0-beta.25111.4 - 8.0.0-alpha.1.25104.1 + 8.0.0-alpha.1.25202.2 8.0.0-alpha.1.25081.5 From 56ea44d67401fcaa770ba69f517a9eb58c82600f Mon Sep 17 00:00:00 2001 From: William Godbe Date: Wed, 2 Apr 2025 17:10:11 -0700 Subject: [PATCH 04/76] Upgrade to Ubuntu 22 (#61216) --- .azure/pipelines/jobs/default-build.yml | 6 +++--- eng/scripts/install-nginx-linux.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index fbe60b3e7964..eee89df3733a 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -109,10 +109,10 @@ jobs: vmImage: macOS-13 ${{ if eq(parameters.agentOs, 'Linux') }}: ${{ if eq(parameters.useHostedUbuntu, true) }}: - vmImage: ubuntu-20.04 + vmImage: ubuntu-22.04 ${{ if eq(parameters.useHostedUbuntu, false) }}: name: $(DncEngPublicBuildPool) - demands: ImageOverride -equals Build.Ubuntu.2004.Amd64.Open + demands: ImageOverride -equals Build.Ubuntu.2204.Amd64.Open ${{ if eq(parameters.agentOs, 'Windows') }}: name: $(DncEngPublicBuildPool) demands: ImageOverride -equals windows.vs2022preview.amd64.open @@ -324,7 +324,7 @@ jobs: os: macOS ${{ if eq(parameters.agentOs, 'Linux') }}: name: $(DncEngInternalBuildPool) - image: 1es-ubuntu-2004 + image: 1es-ubuntu-2204 os: linux ${{ if eq(parameters.agentOs, 'Windows') }}: name: $(DncEngInternalBuildPool) diff --git a/eng/scripts/install-nginx-linux.sh b/eng/scripts/install-nginx-linux.sh index bbfb79c48203..f075a899d1cf 100755 --- a/eng/scripts/install-nginx-linux.sh +++ b/eng/scripts/install-nginx-linux.sh @@ -6,7 +6,7 @@ scriptroot="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" reporoot="$(dirname "$(dirname "$scriptroot")")" nginxinstall="$reporoot/.tools/nginx" -curl -sSL http://nginx.org/download/nginx-1.14.2.tar.gz --retry 5 | tar zxfv - -C /tmp && cd /tmp/nginx-1.14.2/ +curl -sSL http://nginx.org/download/nginx-1.26.3.tar.gz --retry 5 | tar zxfv - -C /tmp && cd /tmp/nginx-1.26.3/ ./configure --prefix=$nginxinstall --with-http_ssl_module --without-http_rewrite_module make make install From 078c802a03948ca53032ab72a352a2d7ac92bd23 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 18:11:43 -0700 Subject: [PATCH 05/76] Update dependencies from https://github.com/dotnet/arcade build 20250220.1 (#60901) Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor From Version 8.0.0-beta.25111.4 -> To Version 8.0.0-beta.25120.1 Co-authored-by: dotnet-maestro[bot] Co-authored-by: William Godbe --- eng/Version.Details.xml | 20 +++++++++---------- eng/Versions.props | 6 +++--- eng/common/cross/toolchain.cmake | 4 ++++ .../steps/send-to-helix.yml | 7 ++++--- eng/common/templates/steps/send-to-helix.yml | 7 ++++--- global.json | 4 ++-- 6 files changed, 27 insertions(+), 21 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7ea1744816b7..37abaf2115e0 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -376,26 +376,26 @@ https://github.com/dotnet/winforms abda8e3bfa78319363526b5a5f86863ec979940e - + https://github.com/dotnet/arcade - a319ada170a54ee87c7a81e3309948e3d3ea7aca + 4ff4ce248e95ae74b0040de6a6c5939aa63120dc - + https://github.com/dotnet/arcade - a319ada170a54ee87c7a81e3309948e3d3ea7aca + 4ff4ce248e95ae74b0040de6a6c5939aa63120dc - + https://github.com/dotnet/arcade - a319ada170a54ee87c7a81e3309948e3d3ea7aca + 4ff4ce248e95ae74b0040de6a6c5939aa63120dc - + https://github.com/dotnet/arcade - a319ada170a54ee87c7a81e3309948e3d3ea7aca + 4ff4ce248e95ae74b0040de6a6c5939aa63120dc - + https://github.com/dotnet/arcade - a319ada170a54ee87c7a81e3309948e3d3ea7aca + 4ff4ce248e95ae74b0040de6a6c5939aa63120dc https://github.com/dotnet/extensions diff --git a/eng/Versions.props b/eng/Versions.props index a1d737fca785..26f595851bec 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -162,9 +162,9 @@ 6.2.4 6.2.4 - 8.0.0-beta.25111.4 - 8.0.0-beta.25111.4 - 8.0.0-beta.25111.4 + 8.0.0-beta.25120.1 + 8.0.0-beta.25120.1 + 8.0.0-beta.25120.1 8.0.0-alpha.1.25202.2 diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index dafabdcaef00..f93dc440df0e 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -280,6 +280,8 @@ elseif(TARGET_ARCH_NAME MATCHES "^(arm64|x64)$") add_toolchain_linker_flag("-Wl,--rpath-link=${CROSS_ROOTFS}/usr/lib64") add_toolchain_linker_flag("-Wl,--rpath-link=${TIZEN_TOOLCHAIN_PATH}") endif() +elseif(TARGET_ARCH_NAME STREQUAL "s390x") + add_toolchain_linker_flag("--target=${TOOLCHAIN}") elseif(TARGET_ARCH_NAME STREQUAL "x86") if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/i586-alpine-linux-musl) add_toolchain_linker_flag("--target=${TOOLCHAIN}") @@ -327,6 +329,8 @@ if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$") if(TARGET_ARCH_NAME STREQUAL "armel") add_compile_options(-mfloat-abi=softfp) endif() +elseif(TARGET_ARCH_NAME STREQUAL "s390x") + add_compile_options("--target=${TOOLCHAIN}") elseif(TARGET_ARCH_NAME STREQUAL "x86") if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/i586-alpine-linux-musl) add_compile_options(--target=${TOOLCHAIN}) diff --git a/eng/common/templates-official/steps/send-to-helix.yml b/eng/common/templates-official/steps/send-to-helix.yml index 3eb7e2d5f840..22f2501307d4 100644 --- a/eng/common/templates-official/steps/send-to-helix.yml +++ b/eng/common/templates-official/steps/send-to-helix.yml @@ -8,6 +8,7 @@ parameters: HelixConfiguration: '' # optional -- additional property attached to a job HelixPreCommands: '' # optional -- commands to run before Helix work item execution HelixPostCommands: '' # optional -- commands to run after Helix work item execution + HelixProjectArguments: '' # optional -- arguments passed to the build command for helixpublish.proj WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects WorkItemCommand: '' # optional -- a command to execute on the payload; requires WorkItemDirectory; incompatible with XUnitProjects WorkItemTimeout: '' # optional -- a timeout in TimeSpan.Parse-ready value (e.g. 00:02:00) for the work item command; requires WorkItemDirectory; incompatible with XUnitProjects @@ -24,12 +25,12 @@ parameters: IsExternal: false # [DEPRECATED] -- doesn't do anything, jobs are external if HelixAccessToken is empty and Creator is set HelixBaseUri: 'https://helix.dot.net/' # optional -- sets the Helix API base URI (allows targeting https://helix.int-dot.net ) Creator: '' # optional -- if the build is external, use this to specify who is sending the job - DisplayNamePrefix: 'Run Tests' # optional -- rename the beginning of the displayName of the steps in AzDO + DisplayNamePrefix: 'Run Tests' # optional -- rename the beginning of the displayName of the steps in AzDO condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false steps: - - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj /restore /p:TreatWarningsAsErrors=false /t:Test /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' + - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj ${{ parameters.HelixProjectArguments }} /restore /p:TreatWarningsAsErrors=false /t:Test /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' displayName: ${{ parameters.DisplayNamePrefix }} (Windows) env: BuildConfig: $(_BuildConfig) @@ -59,7 +60,7 @@ steps: SYSTEM_ACCESSTOKEN: $(System.AccessToken) condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) continueOnError: ${{ parameters.continueOnError }} - - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/helixpublish.proj /restore /p:TreatWarningsAsErrors=false /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog + - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/helixpublish.proj ${{ parameters.HelixProjectArguments }} /restore /p:TreatWarningsAsErrors=false /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog displayName: ${{ parameters.DisplayNamePrefix }} (Unix) env: BuildConfig: $(_BuildConfig) diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml index 3eb7e2d5f840..22f2501307d4 100644 --- a/eng/common/templates/steps/send-to-helix.yml +++ b/eng/common/templates/steps/send-to-helix.yml @@ -8,6 +8,7 @@ parameters: HelixConfiguration: '' # optional -- additional property attached to a job HelixPreCommands: '' # optional -- commands to run before Helix work item execution HelixPostCommands: '' # optional -- commands to run after Helix work item execution + HelixProjectArguments: '' # optional -- arguments passed to the build command for helixpublish.proj WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects WorkItemCommand: '' # optional -- a command to execute on the payload; requires WorkItemDirectory; incompatible with XUnitProjects WorkItemTimeout: '' # optional -- a timeout in TimeSpan.Parse-ready value (e.g. 00:02:00) for the work item command; requires WorkItemDirectory; incompatible with XUnitProjects @@ -24,12 +25,12 @@ parameters: IsExternal: false # [DEPRECATED] -- doesn't do anything, jobs are external if HelixAccessToken is empty and Creator is set HelixBaseUri: 'https://helix.dot.net/' # optional -- sets the Helix API base URI (allows targeting https://helix.int-dot.net ) Creator: '' # optional -- if the build is external, use this to specify who is sending the job - DisplayNamePrefix: 'Run Tests' # optional -- rename the beginning of the displayName of the steps in AzDO + DisplayNamePrefix: 'Run Tests' # optional -- rename the beginning of the displayName of the steps in AzDO condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false steps: - - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj /restore /p:TreatWarningsAsErrors=false /t:Test /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' + - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj ${{ parameters.HelixProjectArguments }} /restore /p:TreatWarningsAsErrors=false /t:Test /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' displayName: ${{ parameters.DisplayNamePrefix }} (Windows) env: BuildConfig: $(_BuildConfig) @@ -59,7 +60,7 @@ steps: SYSTEM_ACCESSTOKEN: $(System.AccessToken) condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) continueOnError: ${{ parameters.continueOnError }} - - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/helixpublish.proj /restore /p:TreatWarningsAsErrors=false /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog + - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/helixpublish.proj ${{ parameters.HelixProjectArguments }} /restore /p:TreatWarningsAsErrors=false /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog displayName: ${{ parameters.DisplayNamePrefix }} (Unix) env: BuildConfig: $(_BuildConfig) diff --git a/global.json b/global.json index 9d3930333424..1ea9bd10bd84 100644 --- a/global.json +++ b/global.json @@ -25,8 +25,8 @@ }, "msbuild-sdks": { "Yarn.MSBuild": "1.22.19", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25111.4", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25111.4" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25120.1", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25120.1" }, "native-tools": { "jdk": "latest" From 3595ffcfd8364668f5966de9eb5f7d1677f60eea Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 18:11:56 -0700 Subject: [PATCH 06/76] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250313.2 (#60926) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 8.0.0-alpha.1.25081.5 -> To Version 8.0.0-alpha.1.25163.2 Co-authored-by: dotnet-maestro[bot] Co-authored-by: William Godbe --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 37abaf2115e0..f67573e8e603 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -338,9 +338,9 @@ 9a1c3e1b7f0c8763d4c96e593961a61a72679a7b - + https://github.com/dotnet/source-build-reference-packages - d73fc552386797322e84fa9b2ef5eaa5369de83c + b09e26d761555d806f31af68d6fe5dfdeebf6e38 diff --git a/eng/Versions.props b/eng/Versions.props index 26f595851bec..400fb877670e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -168,7 +168,7 @@ 8.0.0-alpha.1.25202.2 - 8.0.0-alpha.1.25081.5 + 8.0.0-alpha.1.25163.2 2.0.0-beta-23228-03 From 2509a7ad0c18db14a759fa641de6151762c3cd77 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 8 Apr 2025 12:16:59 -0700 Subject: [PATCH 07/76] Update baseline, SDK --- eng/Baseline.Designer.props | 428 ++++++++++++++++++------------------ eng/Baseline.xml | 212 +++++++++--------- eng/Versions.props | 2 +- global.json | 4 +- 4 files changed, 323 insertions(+), 323 deletions(-) diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props index af5cc98a0d47..f1b0e807fea1 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -2,117 +2,117 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - + - + - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 @@ -120,138 +120,138 @@ - 8.0.13 + 8.0.15 - + - + - + - 8.0.13 + 8.0.15 - + - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - + - 8.0.13 + 8.0.15 - - + + - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - - + + - 8.0.13 + 8.0.15 - + - 8.0.13 + 8.0.15 - + - 8.0.13 + 8.0.15 - + - 8.0.13 + 8.0.15 - - + + - 8.0.13 + 8.0.15 - - - + + + - 8.0.13 + 8.0.15 - - + + - 8.0.13 + 8.0.15 - - + + - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - - + + @@ -259,7 +259,7 @@ - 8.0.13 + 8.0.15 @@ -268,51 +268,51 @@ - 8.0.13 + 8.0.15 - + - + - + - + - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - + - + - + - 8.0.13 + 8.0.15 - - + + @@ -322,8 +322,8 @@ - - + + @@ -331,8 +331,8 @@ - - + + @@ -343,58 +343,58 @@ - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - - + + - 8.0.13 + 8.0.15 - + - + - + - 8.0.13 + 8.0.15 - + - + - + - 8.0.13 + 8.0.15 - + - 8.0.13 + 8.0.15 @@ -403,7 +403,7 @@ - 8.0.13 + 8.0.15 @@ -411,71 +411,71 @@ - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - + - + - + - + - 8.0.13 + 8.0.15 - + - + - + - 8.0.13 + 8.0.15 - - + + - 8.0.13 + 8.0.15 - - + + - 8.0.13 + 8.0.15 @@ -491,27 +491,27 @@ - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - + - 8.0.13 + 8.0.15 @@ -520,23 +520,23 @@ - 8.0.13 + 8.0.15 - + - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 @@ -545,54 +545,54 @@ - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - - + + - - + + - - + + - 8.0.13 + 8.0.15 - - + + - - + + - - + + - - + + @@ -600,83 +600,83 @@ - 8.0.13 + 8.0.15 - + - + - + - 8.0.13 + 8.0.15 - + - + - + - 8.0.13 + 8.0.15 - + - + - + - 8.0.13 + 8.0.15 - + - + - + - 8.0.13 + 8.0.15 - - - - + + + + - 8.0.13 + 8.0.15 @@ -685,64 +685,64 @@ - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - + - 8.0.13 + 8.0.15 - + - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 @@ -764,7 +764,7 @@ - 8.0.13 + 8.0.15 @@ -786,7 +786,7 @@ - 8.0.13 + 8.0.15 @@ -802,23 +802,23 @@ - 8.0.13 + 8.0.15 - + - + - + @@ -826,24 +826,24 @@ - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - - - + + + - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 @@ -853,7 +853,7 @@ - 8.0.13 + 8.0.15 @@ -862,73 +862,73 @@ - 8.0.13 + 8.0.15 - + - + - + - 8.0.13 + 8.0.15 - + - + - + - 8.0.13 + 8.0.15 - + - + - + - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 @@ -957,11 +957,11 @@ - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 @@ -979,18 +979,18 @@ - 8.0.13 + 8.0.15 - 8.0.13 + 8.0.15 - + - 8.0.13 + 8.0.15 diff --git a/eng/Baseline.xml b/eng/Baseline.xml index 9efbb290ef60..9746528d4365 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -4,110 +4,110 @@ This file contains a list of all the packages and their versions which were rele Update this list when preparing for a new patch. --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eng/Versions.props b/eng/Versions.props index b6dc8f64e9fe..5f7b7b1220b7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -11,7 +11,7 @@ 16 - false + true 7.1.2 7.* - 8.0.0-beta.25120.1 - 8.0.0-beta.25120.1 - 8.0.0-beta.25120.1 + 8.0.0-beta.25208.3 + 8.0.0-beta.25208.3 + 8.0.0-beta.25208.3 8.0.0-alpha.1.25202.2 diff --git a/eng/common/generate-sbom-prep.ps1 b/eng/common/generate-sbom-prep.ps1 index 3e5c1c74a1c5..a0c7d792a76f 100644 --- a/eng/common/generate-sbom-prep.ps1 +++ b/eng/common/generate-sbom-prep.ps1 @@ -4,18 +4,26 @@ Param( . $PSScriptRoot\pipeline-logging-functions.ps1 +# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly +# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. +$ArtifactName = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" +$SafeArtifactName = $ArtifactName -replace '["/:<>\\|?@*"() ]', '_' +$SbomGenerationDir = Join-Path $ManifestDirPath $SafeArtifactName + +Write-Host "Artifact name before : $ArtifactName" +Write-Host "Artifact name after : $SafeArtifactName" + Write-Host "Creating dir $ManifestDirPath" + # create directory for sbom manifest to be placed -if (!(Test-Path -path $ManifestDirPath)) +if (!(Test-Path -path $SbomGenerationDir)) { - New-Item -ItemType Directory -path $ManifestDirPath - Write-Host "Successfully created directory $ManifestDirPath" + New-Item -ItemType Directory -path $SbomGenerationDir + Write-Host "Successfully created directory $SbomGenerationDir" } else{ Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." } Write-Host "Updating artifact name" -$artifact_name = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" -replace '["/:<>\\|?@*"() ]', '_' -Write-Host "Artifact name $artifact_name" -Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$artifact_name" +Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$SafeArtifactName" diff --git a/eng/common/generate-sbom-prep.sh b/eng/common/generate-sbom-prep.sh index d5c76dc827b4..bbb4922151e6 100644 --- a/eng/common/generate-sbom-prep.sh +++ b/eng/common/generate-sbom-prep.sh @@ -14,19 +14,24 @@ done scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" . $scriptroot/pipeline-logging-functions.sh +# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts. +artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM" +safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}" + manifest_dir=$1 -if [ ! -d "$manifest_dir" ] ; then - mkdir -p "$manifest_dir" - echo "Sbom directory created." $manifest_dir +# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly +# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. +sbom_generation_dir="$manifest_dir/$safe_artifact_name" + +if [ ! -d "$sbom_generation_dir" ] ; then + mkdir -p "$sbom_generation_dir" + echo "Sbom directory created." $sbom_generation_dir else Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." fi -artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM" echo "Artifact name before : "$artifact_name -# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts. -safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}" echo "Artifact name after : "$safe_artifact_name export ARTIFACT_NAME=$safe_artifact_name echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name" diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml index 1f035fee73f4..98ccbd7a9c16 100644 --- a/eng/common/templates-official/job/job.yml +++ b/eng/common/templates-official/job/job.yml @@ -38,6 +38,7 @@ parameters: enableSbom: true PackageVersion: 7.0.0 BuildDropPath: '$(Build.SourcesDirectory)/artifacts' + ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom jobs: - job: ${{ parameters.name }} @@ -261,4 +262,4 @@ jobs: targetPath: '$(Build.SourcesDirectory)\eng\common\BuildConfiguration' artifactName: 'BuildConfiguration' displayName: 'Publish build retry configuration' - continueOnError: true \ No newline at end of file + continueOnError: true diff --git a/eng/common/templates-official/steps/generate-sbom.yml b/eng/common/templates-official/steps/generate-sbom.yml index 1bf43bf807af..daf0957b68d7 100644 --- a/eng/common/templates-official/steps/generate-sbom.yml +++ b/eng/common/templates-official/steps/generate-sbom.yml @@ -35,7 +35,7 @@ steps: PackageName: ${{ parameters.packageName }} BuildDropPath: ${{ parameters.buildDropPath }} PackageVersion: ${{ parameters.packageVersion }} - ManifestDirPath: ${{ parameters.manifestDirPath }} + ManifestDirPath: ${{ parameters.manifestDirPath }}/$(ARTIFACT_NAME) ${{ if ne(parameters.IgnoreDirectories, '') }}: AdditionalComponentDetectorArgs: '--IgnoreDirectories ${{ parameters.IgnoreDirectories }}' diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index a00577ed17aa..82b2798ba307 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -42,7 +42,7 @@ [bool]$useInstalledDotNetCli = if (Test-Path variable:useInstalledDotNetCli) { $useInstalledDotNetCli } else { $true } # Enable repos to use a particular version of the on-line dotnet-install scripts. -# default URL: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1 +# default URL: https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.ps1 [string]$dotnetInstallScriptVersion = if (Test-Path variable:dotnetInstallScriptVersion) { $dotnetInstallScriptVersion } else { 'v1' } # True to use global NuGet cache instead of restoring packages to repository-local directory. @@ -263,7 +263,7 @@ function GetDotNetInstallScript([string] $dotnetRoot) { if (!(Test-Path $installScript)) { Create-Directory $dotnetRoot $ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit - $uri = "https://dotnet.microsoft.com/download/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1" + $uri = "https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1" Retry({ Write-Host "GET $uri" diff --git a/eng/common/tools.sh b/eng/common/tools.sh index b9b329ce37ff..68db15430230 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -54,7 +54,7 @@ warn_as_error=${warn_as_error:-true} use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} # Enable repos to use a particular version of the on-line dotnet-install scripts. -# default URL: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh +# default URL: https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'} # True to use global NuGet cache instead of restoring packages to repository-local directory. @@ -297,7 +297,7 @@ function with_retries { function GetDotNetInstallScript { local root=$1 local install_script="$root/dotnet-install.sh" - local install_script_url="https://dotnet.microsoft.com/download/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh" + local install_script_url="https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh" if [[ ! -a "$install_script" ]]; then mkdir -p "$root" diff --git a/global.json b/global.json index 1ea9bd10bd84..9beb77ca9d41 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "sdk": { - "version": "8.0.113" + "version": "8.0.114" }, "tools": { - "dotnet": "8.0.113", + "dotnet": "8.0.114", "runtimes": { "dotnet/x86": [ "$(MicrosoftNETCoreBrowserDebugHostTransportVersion)" @@ -25,8 +25,8 @@ }, "msbuild-sdks": { "Yarn.MSBuild": "1.22.19", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25120.1", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25120.1" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25208.3", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25208.3" }, "native-tools": { "jdk": "latest" From aa2ec5355e548d35a79df99a36c9c4a13063a68f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 11:41:58 -0700 Subject: [PATCH 09/76] Update dependencies from https://github.com/dotnet/arcade build 20250408.7 (#61411) Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor From Version 8.0.0-beta.25208.3 -> To Version 8.0.0-beta.25208.7 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 6 +++--- global.json | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 928450c253c8..3a3c34f5bfe1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -376,26 +376,26 @@ https://github.com/dotnet/winforms abda8e3bfa78319363526b5a5f86863ec979940e - + https://github.com/dotnet/arcade - 913a1b7b347a2443586f3ae5e0638b9fd204276e + c7a36e53f91e41943746f97a8c183549364c5092 - + https://github.com/dotnet/arcade - 913a1b7b347a2443586f3ae5e0638b9fd204276e + c7a36e53f91e41943746f97a8c183549364c5092 - + https://github.com/dotnet/arcade - 913a1b7b347a2443586f3ae5e0638b9fd204276e + c7a36e53f91e41943746f97a8c183549364c5092 - + https://github.com/dotnet/arcade - 913a1b7b347a2443586f3ae5e0638b9fd204276e + c7a36e53f91e41943746f97a8c183549364c5092 - + https://github.com/dotnet/arcade - 913a1b7b347a2443586f3ae5e0638b9fd204276e + c7a36e53f91e41943746f97a8c183549364c5092 https://github.com/dotnet/extensions diff --git a/eng/Versions.props b/eng/Versions.props index c3f80ab9f037..ef53f695cf9b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -162,9 +162,9 @@ 6.2.4 6.2.4 - 8.0.0-beta.25208.3 - 8.0.0-beta.25208.3 - 8.0.0-beta.25208.3 + 8.0.0-beta.25208.7 + 8.0.0-beta.25208.7 + 8.0.0-beta.25208.7 8.0.0-alpha.1.25202.2 diff --git a/global.json b/global.json index 9beb77ca9d41..a7cd171707cd 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "sdk": { - "version": "8.0.114" + "version": "8.0.115" }, "tools": { - "dotnet": "8.0.114", + "dotnet": "8.0.115", "runtimes": { "dotnet/x86": [ "$(MicrosoftNETCoreBrowserDebugHostTransportVersion)" @@ -25,8 +25,8 @@ }, "msbuild-sdks": { "Yarn.MSBuild": "1.22.19", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25208.3", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25208.3" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25208.7", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25208.7" }, "native-tools": { "jdk": "latest" From e291efbc4d2a7a951f79049e017b99e9f08b5be3 Mon Sep 17 00:00:00 2001 From: William Godbe Date: Wed, 9 Apr 2025 11:42:31 -0700 Subject: [PATCH 10/76] Revert "Revert "[release/8.0] Update remnants of azureedge.net" (#60324)" (#60352) This reverts commit 75d548fd5076393b1a351c8f2415da183d68ea4d. --- .azure/pipelines/ci.yml | 4 ++-- eng/common/templates-official/steps/source-build.yml | 2 +- eng/helix/helix.proj | 6 +++--- .../App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj | 2 +- src/Installers/Windows/WindowsHostingBundle/Product.targets | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 107fcdef9ff3..5e4e2e533b16 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -102,14 +102,14 @@ variables: - name: WindowsArm64InstallersLogArgs value: /bl:artifacts/log/Release/Build.Installers.Arm64.binlog - name: _InternalRuntimeDownloadArgs - value: -RuntimeSourceFeed https://dotnetbuilds.blob.core.windows.net/internal + value: -RuntimeSourceFeed https://ci.dot.net/internal -RuntimeSourceFeedKey $(dotnetbuilds-internal-container-read-token-base64) /p:DotNetAssetRootAccessTokenSuffix='$(dotnetbuilds-internal-container-read-token-base64)' # The code signing doesn't use the aspnet build scripts, so the msbuild parameters have to be passed directly. This # is awkward but necessary because the eng/common/ build scripts don't add the msbuild properties automatically. - name: _InternalRuntimeDownloadCodeSignArgs value: $(_InternalRuntimeDownloadArgs) - /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal + /p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) - group: DotNet-HelixApi-Access - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: diff --git a/eng/common/templates-official/steps/source-build.yml b/eng/common/templates-official/steps/source-build.yml index 829f17c34d11..503164fa7f22 100644 --- a/eng/common/templates-official/steps/source-build.yml +++ b/eng/common/templates-official/steps/source-build.yml @@ -44,7 +44,7 @@ steps: # in the default public locations. internalRuntimeDownloadArgs= if [ '$(dotnetbuilds-internal-container-read-token-base64)' != '$''(dotnetbuilds-internal-container-read-token-base64)' ]; then - internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) --runtimesourcefeed https://dotnetbuilds.blob.core.windows.net/internal --runtimesourcefeedkey $(dotnetbuilds-internal-container-read-token-base64)' + internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) --runtimesourcefeed https://ci.dot.net/internal --runtimesourcefeedkey $(dotnetbuilds-internal-container-read-token-base64)' fi buildConfig=Release diff --git a/eng/helix/helix.proj b/eng/helix/helix.proj index 99254551279f..9535e87a6042 100644 --- a/eng/helix/helix.proj +++ b/eng/helix/helix.proj @@ -57,13 +57,13 @@ runtime - - $([System.Environment]::GetEnvironmentVariable('DotNetBuildsInternalReadSasToken')) - $([System.Environment]::GetEnvironmentVariable('DotNetBuildsInternalReadSasToken')) diff --git a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj index fadf9de6547c..1f8527329959 100644 --- a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj +++ b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj @@ -560,7 +560,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant - + diff --git a/src/Installers/Windows/WindowsHostingBundle/Product.targets b/src/Installers/Windows/WindowsHostingBundle/Product.targets index 3e805f35bb3a..c1dc097445d4 100644 --- a/src/Installers/Windows/WindowsHostingBundle/Product.targets +++ b/src/Installers/Windows/WindowsHostingBundle/Product.targets @@ -83,7 +83,7 @@ --> - + From 960aa0716f077e36536948f3a2ecdcc2d717fdac Mon Sep 17 00:00:00 2001 From: Brennan Date: Wed, 9 Apr 2025 12:21:53 -0700 Subject: [PATCH 11/76] Fix preserving messages for stateful reconnect with backplane (#60900) (#61375) --- src/SignalR/common/Shared/MessageBuffer.cs | 9 +- .../server/Core/src/SerializedHubMessage.cs | 3 + .../test/Internal/MessageBufferTests.cs | 57 ++++++ .../StackExchangeRedis/test/RedisEndToEnd.cs | 171 +++++++++++++++++- .../server/StackExchangeRedis/test/Startup.cs | 1 + .../StackExchangeRedis/test/StatefulHub.cs | 12 ++ 6 files changed, 244 insertions(+), 9 deletions(-) create mode 100644 src/SignalR/server/StackExchangeRedis/test/StatefulHub.cs diff --git a/src/SignalR/common/Shared/MessageBuffer.cs b/src/SignalR/common/Shared/MessageBuffer.cs index 17b9ae170fe0..f08fff86aa40 100644 --- a/src/SignalR/common/Shared/MessageBuffer.cs +++ b/src/SignalR/common/Shared/MessageBuffer.cs @@ -121,15 +121,16 @@ private async Task RunTimer() public ValueTask WriteAsync(SerializedHubMessage hubMessage, CancellationToken cancellationToken) { - return WriteAsyncCore(hubMessage.Message!, hubMessage.GetSerializedMessage(_protocol), cancellationToken); + // Default to HubInvocationMessage as that's the only type we use SerializedHubMessage for currently when Message is null. Should harden this in the future. + return WriteAsyncCore(hubMessage.Message?.GetType() ?? typeof(HubInvocationMessage), hubMessage.GetSerializedMessage(_protocol), cancellationToken); } public ValueTask WriteAsync(HubMessage hubMessage, CancellationToken cancellationToken) { - return WriteAsyncCore(hubMessage, _protocol.GetMessageBytes(hubMessage), cancellationToken); + return WriteAsyncCore(hubMessage.GetType(), _protocol.GetMessageBytes(hubMessage), cancellationToken); } - private async ValueTask WriteAsyncCore(HubMessage hubMessage, ReadOnlyMemory messageBytes, CancellationToken cancellationToken) + private async ValueTask WriteAsyncCore(Type hubMessageType, ReadOnlyMemory messageBytes, CancellationToken cancellationToken) { // TODO: Add backpressure based on message count if (_bufferedByteCount > _bufferLimit) @@ -158,7 +159,7 @@ private async ValueTask WriteAsyncCore(HubMessage hubMessage, ReadO await _writeLock.WaitAsync(cancellationToken: default).ConfigureAwait(false); try { - if (hubMessage is HubInvocationMessage invocationMessage) + if (typeof(HubInvocationMessage).IsAssignableFrom(hubMessageType)) { _totalMessageCount++; _bufferedByteCount += messageBytes.Length; diff --git a/src/SignalR/server/Core/src/SerializedHubMessage.cs b/src/SignalR/server/Core/src/SerializedHubMessage.cs index e355b0329128..9f4327a4cc58 100644 --- a/src/SignalR/server/Core/src/SerializedHubMessage.cs +++ b/src/SignalR/server/Core/src/SerializedHubMessage.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics; using Microsoft.AspNetCore.SignalR.Protocol; namespace Microsoft.AspNetCore.SignalR; @@ -40,6 +41,8 @@ public SerializedHubMessage(IReadOnlyList messages) /// The hub message for the cache. This will be serialized with an in to get the message's serialized representation. public SerializedHubMessage(HubMessage message) { + // Type currently only used for invocation messages, we should probably refactor it to be explicit about that e.g. new property for message type? + Debug.Assert(message.GetType().IsAssignableTo(typeof(HubInvocationMessage))); Message = message; } diff --git a/src/SignalR/server/SignalR/test/Internal/MessageBufferTests.cs b/src/SignalR/server/SignalR/test/Internal/MessageBufferTests.cs index e6f6248a733b..ac2a7888e942 100644 --- a/src/SignalR/server/SignalR/test/Internal/MessageBufferTests.cs +++ b/src/SignalR/server/SignalR/test/Internal/MessageBufferTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.IO.Pipelines; +using System.Text.Json; using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.SignalR.Internal; @@ -169,6 +170,62 @@ public async Task UnAckedMessageResentOnReconnect() Assert.False(messageBuffer.ShouldProcessMessage(CompletionMessage.WithResult("1", null))); } + // Regression test for https://github.com/dotnet/aspnetcore/issues/55575 + [Fact] + public async Task UnAckedSerializedMessageResentOnReconnect() + { + var protocol = new JsonHubProtocol(); + var connection = new TestConnectionContext(); + var pipes = DuplexPipe.CreateConnectionPair(new PipeOptions(), new PipeOptions()); + connection.Transport = pipes.Transport; + using var messageBuffer = new MessageBuffer(connection, protocol, bufferLimit: 1000, NullLogger.Instance); + + var invocationMessage = new SerializedHubMessage([new SerializedMessage(protocol.Name, + protocol.GetMessageBytes(new InvocationMessage("method1", [1])))]); + await messageBuffer.WriteAsync(invocationMessage, default); + + var res = await pipes.Application.Input.ReadAsync(); + + var buffer = res.Buffer; + Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message)); + var parsedMessage = Assert.IsType(message); + Assert.Equal("method1", parsedMessage.Target); + Assert.Equal(1, ((JsonElement)Assert.Single(parsedMessage.Arguments)).GetInt32()); + + pipes.Application.Input.AdvanceTo(buffer.Start); + + DuplexPipe.UpdateConnectionPair(ref pipes, connection); + await messageBuffer.ResendAsync(pipes.Transport.Output); + + Assert.True(messageBuffer.ShouldProcessMessage(PingMessage.Instance)); + Assert.True(messageBuffer.ShouldProcessMessage(CompletionMessage.WithResult("1", null))); + Assert.True(messageBuffer.ShouldProcessMessage(new SequenceMessage(1))); + + res = await pipes.Application.Input.ReadAsync(); + + buffer = res.Buffer; + Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out message)); + var seqMessage = Assert.IsType(message); + Assert.Equal(1, seqMessage.SequenceId); + + pipes.Application.Input.AdvanceTo(buffer.Start); + + res = await pipes.Application.Input.ReadAsync(); + + buffer = res.Buffer; + Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out message)); + parsedMessage = Assert.IsType(message); + Assert.Equal("method1", parsedMessage.Target); + Assert.Equal(1, ((JsonElement)Assert.Single(parsedMessage.Arguments)).GetInt32()); + + pipes.Application.Input.AdvanceTo(buffer.Start); + + messageBuffer.ShouldProcessMessage(new SequenceMessage(1)); + + Assert.True(messageBuffer.ShouldProcessMessage(PingMessage.Instance)); + Assert.False(messageBuffer.ShouldProcessMessage(CompletionMessage.WithResult("1", null))); + } + [Fact] public async Task AckedMessageNotResentOnReconnect() { diff --git a/src/SignalR/server/StackExchangeRedis/test/RedisEndToEnd.cs b/src/SignalR/server/StackExchangeRedis/test/RedisEndToEnd.cs index 74cf30df19a9..0beb6e2233e5 100644 --- a/src/SignalR/server/StackExchangeRedis/test/RedisEndToEnd.cs +++ b/src/SignalR/server/StackExchangeRedis/test/RedisEndToEnd.cs @@ -1,17 +1,15 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Collections.Generic; -using System.Threading.Tasks; +using System.Net.WebSockets; using Microsoft.AspNetCore.Http.Connections; +using Microsoft.AspNetCore.Http.Connections.Client; using Microsoft.AspNetCore.SignalR.Client; using Microsoft.AspNetCore.SignalR.Protocol; using Microsoft.AspNetCore.SignalR.Tests; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Xunit; namespace Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests; @@ -211,7 +209,105 @@ public async Task CanSendAndReceiveUserMessagesUserNameWithPatternIsTreatedAsLit } } - private static HubConnection CreateConnection(string url, HttpTransportType transportType, IHubProtocol protocol, ILoggerFactory loggerFactory, string userName = null) + [ConditionalTheory] + [SkipIfDockerNotPresent] + [InlineData("messagepack")] + [InlineData("json")] + public async Task StatefulReconnectPreservesMessageFromOtherServer(string protocolName) + { + using (StartVerifiableLog()) + { + var protocol = HubProtocolHelpers.GetHubProtocol(protocolName); + + ClientWebSocket innerWs = null; + WebSocketWrapper ws = null; + TaskCompletionSource reconnectTcs = null; + TaskCompletionSource startedReconnectTcs = null; + + var connection = CreateConnection(_serverFixture.FirstServer.Url + "/stateful", HttpTransportType.WebSockets, protocol, LoggerFactory, + customizeConnection: builder => + { + builder.WithStatefulReconnect(); + builder.Services.Configure(o => + { + // Replace the websocket creation for the first connection so we can make the client think there was an ungraceful closure + // Which will trigger the stateful reconnect flow + o.WebSocketFactory = async (context, token) => + { + if (reconnectTcs is null) + { + reconnectTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + startedReconnectTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + } + else + { + startedReconnectTcs.SetResult(); + // We only want to wait on the reconnect, not the initial connection attempt + await reconnectTcs.Task.DefaultTimeout(); + } + + innerWs = new ClientWebSocket(); + ws = new WebSocketWrapper(innerWs); + await innerWs.ConnectAsync(context.Uri, token); + + _ = Task.Run(async () => + { + try + { + while (innerWs.State == WebSocketState.Open) + { + var buffer = new byte[1024]; + var res = await innerWs.ReceiveAsync(buffer, default); + ws.SetReceiveResult((res, buffer.AsMemory(0, res.Count))); + } + } + // Log but ignore receive errors, that likely just means the connection closed + catch (Exception ex) + { + Logger.LogInformation(ex, "Error while reading from inner websocket"); + } + }); + + return ws; + }; + }); + }); + var secondConnection = CreateConnection(_serverFixture.SecondServer.Url + "/stateful", HttpTransportType.WebSockets, protocol, LoggerFactory); + + var tcs = new TaskCompletionSource(); + connection.On("SendToAll", message => tcs.TrySetResult(message)); + + var tcs2 = new TaskCompletionSource(); + secondConnection.On("SendToAll", message => tcs2.TrySetResult(message)); + + await connection.StartAsync().DefaultTimeout(); + await secondConnection.StartAsync().DefaultTimeout(); + + // Close first connection before the second connection sends a message to all clients + await ws.CloseOutputAsync(WebSocketCloseStatus.InternalServerError, statusDescription: null, default); + await startedReconnectTcs.Task.DefaultTimeout(); + + // Send to all clients, since both clients are on different servers this means the backplane will be used + // And we want to test that messages are still preserved for stateful reconnect purposes when a client disconnects + // But is on a different server from the original message sender. + await secondConnection.SendAsync("SendToAll", "test message").DefaultTimeout(); + + // Check that second connection still receives the message + Assert.Equal("test message", await tcs2.Task.DefaultTimeout()); + Assert.False(tcs.Task.IsCompleted); + + // allow first connection to reconnect + reconnectTcs.SetResult(); + + // Check that first connection received the message once it reconnected + Assert.Equal("test message", await tcs.Task.DefaultTimeout()); + + await connection.DisposeAsync().DefaultTimeout(); + } + } + + private static HubConnection CreateConnection(string url, HttpTransportType transportType, IHubProtocol protocol, ILoggerFactory loggerFactory, string userName = null, + Action customizeConnection = null) { var hubConnectionBuilder = new HubConnectionBuilder() .WithLoggerFactory(loggerFactory) @@ -225,6 +321,8 @@ private static HubConnection CreateConnection(string url, HttpTransportType tran hubConnectionBuilder.Services.AddSingleton(protocol); + customizeConnection?.Invoke(hubConnectionBuilder); + return hubConnectionBuilder.Build(); } @@ -253,4 +351,67 @@ public static IEnumerable TransportTypesAndProtocolTypes } } } + + internal sealed class WebSocketWrapper : WebSocket + { + private readonly WebSocket _inner; + private TaskCompletionSource<(WebSocketReceiveResult, ReadOnlyMemory)> _receiveTcs = new(TaskCreationOptions.RunContinuationsAsynchronously); + + public WebSocketWrapper(WebSocket inner) + { + _inner = inner; + } + + public override WebSocketCloseStatus? CloseStatus => _inner.CloseStatus; + + public override string CloseStatusDescription => _inner.CloseStatusDescription; + + public override WebSocketState State => _inner.State; + + public override string SubProtocol => _inner.SubProtocol; + + public override void Abort() + { + _inner.Abort(); + } + + public override Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) + { + return _inner.CloseAsync(closeStatus, statusDescription, cancellationToken); + } + + public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) + { + _receiveTcs.TrySetException(new IOException("force reconnect")); + return Task.CompletedTask; + } + + public override void Dispose() + { + _inner.Dispose(); + } + + public void SetReceiveResult((WebSocketReceiveResult, ReadOnlyMemory) result) + { + _receiveTcs.SetResult(result); + } + + public override async Task ReceiveAsync(ArraySegment buffer, CancellationToken cancellationToken) + { + var res = await _receiveTcs.Task; + // Handle zero-byte reads + if (buffer.Count == 0) + { + return res.Item1; + } + _receiveTcs = new(TaskCreationOptions.RunContinuationsAsynchronously); + res.Item2.CopyTo(buffer); + return res.Item1; + } + + public override Task SendAsync(ArraySegment buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) + { + return _inner.SendAsync(buffer, messageType, endOfMessage, cancellationToken); + } + } } diff --git a/src/SignalR/server/StackExchangeRedis/test/Startup.cs b/src/SignalR/server/StackExchangeRedis/test/Startup.cs index 3fd461aed98e..1b55bd1cff53 100644 --- a/src/SignalR/server/StackExchangeRedis/test/Startup.cs +++ b/src/SignalR/server/StackExchangeRedis/test/Startup.cs @@ -33,6 +33,7 @@ public void Configure(IApplicationBuilder app) app.UseEndpoints(endpoints => { endpoints.MapHub("/echo"); + endpoints.MapHub("/stateful", o => o.AllowStatefulReconnects = true); }); } diff --git a/src/SignalR/server/StackExchangeRedis/test/StatefulHub.cs b/src/SignalR/server/StackExchangeRedis/test/StatefulHub.cs new file mode 100644 index 000000000000..1efa1d84fcd0 --- /dev/null +++ b/src/SignalR/server/StackExchangeRedis/test/StatefulHub.cs @@ -0,0 +1,12 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests; + +public class StatefulHub : Hub +{ + public Task SendToAll(string message) + { + return Clients.All.SendAsync("SendToAll", message); + } +} From f2880bb8511ff800d11797d0aa9e4cd400184742 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 13:08:06 -0700 Subject: [PATCH 12/76] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250410.2 (#61442) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 8.0.0-alpha.1.25163.2 -> To Version 8.0.0-alpha.1.25210.2 Co-authored-by: dotnet-maestro[bot] --- NuGet.config | 8 ++++++++ eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/NuGet.config b/NuGet.config index a972af091630..e2087a016db2 100644 --- a/NuGet.config +++ b/NuGet.config @@ -7,9 +7,13 @@ + + + + @@ -30,9 +34,13 @@ + + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3a3c34f5bfe1..ee11ee5e72e9 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -338,9 +338,9 @@ 9a1c3e1b7f0c8763d4c96e593961a61a72679a7b - + https://github.com/dotnet/source-build-reference-packages - b09e26d761555d806f31af68d6fe5dfdeebf6e38 + 6ae07097c0f03eb59c8a581faaedcc3f2e4cc42c diff --git a/eng/Versions.props b/eng/Versions.props index ef53f695cf9b..dbfe6df117bd 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -168,7 +168,7 @@ 8.0.0-alpha.1.25202.2 - 8.0.0-alpha.1.25163.2 + 8.0.0-alpha.1.25210.2 2.0.0-beta-23228-03 From 5a4f24c984a425c5fad2abd81d38023a03c6d5bd Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Tue, 15 Apr 2025 19:07:57 +0000 Subject: [PATCH 13/76] Merged PR 49096: [internal/release/8.0] Add empty string check for recovery code # Add empty string check for recovery code If an empty string gets passed as the recovery code to `UserStoreBase.RedeemCodeAsync(TUser user, string code, CancellationToken ct)`, the method returns `true`, incorrectly indicating a valid recovery code. This PR resolves the issue by validating that the `code` argument is not an empty string. ## Description The `RedeemCodeAsync()` method already validates that `code` is non-null. This PR: * Extends the logic in this method to handle the empty string (`""`) case * Adds tests validating that an exception gets thrown when `code` is `null` or `""` ---- #### AI description (iteration 1) #### PR Classification Bug fix #### PR Summary This pull request adds a check for empty strings in recovery codes to prevent null or empty values from being processed. - `src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs`: Added `ThrowIfNullOrEmpty` method to validate strings as non-null and non-empty. - `src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreTest.cs`: Added tests to ensure `RedeemCodeAsync` throws exceptions for null or empty codes. - `src/Identity/Extensions.Stores/src/UserStoreBase.cs`: Updated `ThrowIfNull` to `ThrowIfNullOrEmpty` for code validation in `RedeemCodeAsync`. ---- #### AI description (iteration 1) #### PR Classification Bug fix #### PR Summary This pull request adds a check for empty strings in recovery codes to prevent potential issues. - `src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs`: Added `ThrowIfNullOrEmpty` method to throw an exception if a string is null or empty. - `src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreTest.cs`: Added tests to validate the new empty string check for recovery codes. - `src/Identity/Extensions.Stores/src/UserStoreBase.cs`: Updated `RedeemCodeAsync` method to use `ThrowIfNullOrEmpty` for the `code` parameter. --- .../test/EF.Test/UserStoreTest.cs | 3 +++ .../Extensions.Stores/src/UserStoreBase.cs | 2 +- .../ThrowHelpers/ArgumentNullThrowHelper.cs | 23 +++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreTest.cs b/src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreTest.cs index 22ab9e8be5f9..4f0e347ae937 100644 --- a/src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreTest.cs +++ b/src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreTest.cs @@ -144,6 +144,9 @@ await Assert.ThrowsAsync("user", await Assert.ThrowsAsync("user", async () => await store.GetTwoFactorEnabledAsync(null)); await Assert.ThrowsAsync("user", async () => await store.SetTwoFactorEnabledAsync(null, true)); + await Assert.ThrowsAsync("user", async () => await store.RedeemCodeAsync(user: null, code: "fake", default)); + await Assert.ThrowsAsync("code", async () => await store.RedeemCodeAsync(new IdentityUser("fake"), code: null, default)); + await Assert.ThrowsAsync("code", async () => await store.RedeemCodeAsync(new IdentityUser("fake"), code: "", default)); await Assert.ThrowsAsync("user", async () => await store.GetAccessFailedCountAsync(null)); await Assert.ThrowsAsync("user", async () => await store.GetLockoutEnabledAsync(null)); await Assert.ThrowsAsync("user", async () => await store.SetLockoutEnabledAsync(null, false)); diff --git a/src/Identity/Extensions.Stores/src/UserStoreBase.cs b/src/Identity/Extensions.Stores/src/UserStoreBase.cs index c45dd197e4a2..804ebcbad7dc 100644 --- a/src/Identity/Extensions.Stores/src/UserStoreBase.cs +++ b/src/Identity/Extensions.Stores/src/UserStoreBase.cs @@ -969,7 +969,7 @@ public virtual async Task RedeemCodeAsync(TUser user, string code, Cancell ThrowIfDisposed(); ArgumentNullThrowHelper.ThrowIfNull(user); - ArgumentNullThrowHelper.ThrowIfNull(code); + ArgumentNullThrowHelper.ThrowIfNullOrEmpty(code); var mergedCodes = await GetTokenAsync(user, InternalLoginProvider, RecoveryCodeTokenName, cancellationToken).ConfigureAwait(false) ?? ""; var splitCodes = mergedCodes.Split(';'); diff --git a/src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs b/src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs index fc1d5c847d74..e83e87423745 100644 --- a/src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs +++ b/src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs @@ -30,6 +30,29 @@ public static void ThrowIfNull( #endif } + /// Throws an if is null or empty. + /// The argument to validate as non-null and non-empty. + /// The name of the parameter with which corresponds. + public static void ThrowIfNullOrEmpty( +#if INTERNAL_NULLABLE_ATTRIBUTES || NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER + [NotNull] +#endif + string? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null) + { +#if !NET7_0_OR_GREATER || NETSTANDARD || NETFRAMEWORK + if (argument is null) + { + Throw(paramName); + } + else if (argument.Length == 0) + { + throw new ArgumentException("Must not be null or empty", paramName); + } +#else + ArgumentException.ThrowIfNullOrEmpty(argument, paramName); +#endif + } + #if !NET7_0_OR_GREATER || NETSTANDARD || NETFRAMEWORK #if INTERNAL_NULLABLE_ATTRIBUTES || NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER [DoesNotReturn] From ae651c893a93e9c46fc79167a40c22ce20eb0441 Mon Sep 17 00:00:00 2001 From: Brennan Date: Tue, 15 Apr 2025 15:43:20 -0700 Subject: [PATCH 14/76] fetch TLS client hello message from HTTP.SYS (#61494) * setup for tls clinet hello exposure * correctly retry access * last minute changes * fix warnings * hook up tls client hello callback * fix warnings & publish API * minimal * only go via callback if options has callback set; remove unused * PR review * address PR comments x1 * TTL & evict approach * address comments 1 * periodic timer * address comments x3 * TryAdd * make a static field (just in case) * Cache updates * test * whitespace * clear array * appcontext * fb * bp changes * Update src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs Co-authored-by: Aditya Mandaleeka --------- Co-authored-by: Dmitrii Korolev Co-authored-by: Aditya Mandaleeka --- AspNetCore.sln | 19 +++ src/Servers/HttpSys/HttpSysServer.slnf | 3 +- .../HttpSys/HttpSysConfigurator.cs | 123 +++++++++++++++ .../TlsFeaturesObserve/HttpSys/Native.cs | 97 ++++++++++++ .../samples/TlsFeaturesObserve/Program.cs | 69 +++++++++ .../Properties/launchSettings.json | 10 ++ .../samples/TlsFeaturesObserve/Startup.cs | 28 ++++ .../TlsFeaturesObserve.csproj | 14 ++ src/Servers/HttpSys/src/HttpSysListener.cs | 28 ++-- src/Servers/HttpSys/src/HttpSysOptions.cs | 15 +- src/Servers/HttpSys/src/LoggerEventIds.cs | 1 + .../HttpSys/src/NativeInterop/HttpApi.cs | 32 +++- .../HttpSys/src/RequestProcessing/Request.cs | 5 + .../RequestProcessing/RequestContext.Log.cs | 3 + .../src/RequestProcessing/RequestContext.cs | 119 +++++++++++++-- .../RequestProcessing/RequestContextOfT.cs | 6 + .../src/RequestProcessing/TlsListener.Log.cs | 15 ++ .../src/RequestProcessing/TlsListener.cs | 144 ++++++++++++++++++ ...Core.Server.HttpSys.FunctionalTests.csproj | 1 + .../test/FunctionalTests/TlsListenerTests.cs | 141 +++++++++++++++++ .../NativeInterop/UnsafeNativeMethods.cs | 1 + .../RequestProcessing/NativeRequestContext.cs | 10 +- 22 files changed, 845 insertions(+), 39 deletions(-) create mode 100644 src/Servers/HttpSys/samples/TlsFeaturesObserve/HttpSys/HttpSysConfigurator.cs create mode 100644 src/Servers/HttpSys/samples/TlsFeaturesObserve/HttpSys/Native.cs create mode 100644 src/Servers/HttpSys/samples/TlsFeaturesObserve/Program.cs create mode 100644 src/Servers/HttpSys/samples/TlsFeaturesObserve/Properties/launchSettings.json create mode 100644 src/Servers/HttpSys/samples/TlsFeaturesObserve/Startup.cs create mode 100644 src/Servers/HttpSys/samples/TlsFeaturesObserve/TlsFeaturesObserve.csproj create mode 100644 src/Servers/HttpSys/src/RequestProcessing/TlsListener.Log.cs create mode 100644 src/Servers/HttpSys/src/RequestProcessing/TlsListener.cs create mode 100644 src/Servers/HttpSys/test/FunctionalTests/TlsListenerTests.cs diff --git a/AspNetCore.sln b/AspNetCore.sln index 367d27911f8e..a16a5c63a6e9 100644 --- a/AspNetCore.sln +++ b/AspNetCore.sln @@ -1784,6 +1784,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NotReferencedInWasmCodePack EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Components.WasmRemoteAuthentication", "src\Components\test\testassets\Components.WasmRemoteAuthentication\Components.WasmRemoteAuthentication.csproj", "{8A021D6D-7935-4AB3-BB47-38D4FF9B0D13}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TlsFeaturesObserve", "src\Servers\HttpSys\samples\TlsFeaturesObserve\TlsFeaturesObserve.csproj", "{98C71EC8-1303-F55D-4032-E6728971770E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -10753,6 +10755,22 @@ Global {8A021D6D-7935-4AB3-BB47-38D4FF9B0D13}.Release|x64.Build.0 = Release|Any CPU {8A021D6D-7935-4AB3-BB47-38D4FF9B0D13}.Release|x86.ActiveCfg = Release|Any CPU {8A021D6D-7935-4AB3-BB47-38D4FF9B0D13}.Release|x86.Build.0 = Release|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Debug|arm64.ActiveCfg = Debug|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Debug|arm64.Build.0 = Debug|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Debug|x64.ActiveCfg = Debug|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Debug|x64.Build.0 = Debug|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Debug|x86.ActiveCfg = Debug|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Debug|x86.Build.0 = Debug|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Release|Any CPU.Build.0 = Release|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Release|arm64.ActiveCfg = Release|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Release|arm64.Build.0 = Release|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Release|x64.ActiveCfg = Release|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Release|x64.Build.0 = Release|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Release|x86.ActiveCfg = Release|Any CPU + {98C71EC8-1303-F55D-4032-E6728971770E}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -11634,6 +11652,7 @@ Global {F232B503-D412-45EE-8B31-EFD46B9FA302} = {AA5ABFBC-177C-421E-B743-005E0FD1248B} {433F91E4-E39D-4EB0-B798-2998B3969A2C} = {6126DCE4-9692-4EE2-B240-C65743572995} {8A021D6D-7935-4AB3-BB47-38D4FF9B0D13} = {6126DCE4-9692-4EE2-B240-C65743572995} + {98C71EC8-1303-F55D-4032-E6728971770E} = {49016328-4D32-46E4-A4D2-94686ED38EA2} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3E8720B3-DBDD-498C-B383-2CC32A054E8F} diff --git a/src/Servers/HttpSys/HttpSysServer.slnf b/src/Servers/HttpSys/HttpSysServer.slnf index 4e0193ae8f4d..2b9ed68e48f0 100644 --- a/src/Servers/HttpSys/HttpSysServer.slnf +++ b/src/Servers/HttpSys/HttpSysServer.slnf @@ -37,6 +37,7 @@ "src\\Servers\\HttpSys\\samples\\QueueSharing\\QueueSharing.csproj", "src\\Servers\\HttpSys\\samples\\SelfHostServer\\SelfHostServer.csproj", "src\\Servers\\HttpSys\\samples\\TestClient\\TestClient.csproj", + "src\\Servers\\HttpSys\\samples\\TlsFeaturesObserve\\TlsFeaturesObserve.csproj", "src\\Servers\\HttpSys\\src\\Microsoft.AspNetCore.Server.HttpSys.csproj", "src\\Servers\\HttpSys\\test\\FunctionalTests\\Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj", "src\\Servers\\HttpSys\\test\\NonHelixTests\\Microsoft.AspNetCore.Server.HttpSys.NonHelixTests.csproj", @@ -53,4 +54,4 @@ "src\\WebEncoders\\src\\Microsoft.Extensions.WebEncoders.csproj" ] } -} \ No newline at end of file +} diff --git a/src/Servers/HttpSys/samples/TlsFeaturesObserve/HttpSys/HttpSysConfigurator.cs b/src/Servers/HttpSys/samples/TlsFeaturesObserve/HttpSys/HttpSysConfigurator.cs new file mode 100644 index 000000000000..3865ecd59451 --- /dev/null +++ b/src/Servers/HttpSys/samples/TlsFeaturesObserve/HttpSys/HttpSysConfigurator.cs @@ -0,0 +1,123 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Net; +using System.Runtime.InteropServices; + +namespace TlsFeaturesObserve.HttpSys; + +internal static class HttpSysConfigurator +{ + const uint HTTP_INITIALIZE_CONFIG = 0x00000002; + const uint ERROR_ALREADY_EXISTS = 183; + + static readonly HTTPAPI_VERSION HttpApiVersion = new HTTPAPI_VERSION(1, 0); + + internal static void ConfigureCacheTlsClientHello() + { + // Arbitrarily chosen port, but must match the port used in the web server. Via UrlPrefixes or launchsettings. + var ipPort = new IPEndPoint(new IPAddress([0, 0, 0, 0]), 6000); + var certThumbprint = "" /* your cert thumbprint here */; + var appId = Guid.NewGuid(); + var sslCertStoreName = "My"; + + CallHttpApi(() => SetConfiguration(ipPort, certThumbprint, appId, sslCertStoreName)); + } + + static void SetConfiguration(IPEndPoint ipPort, string certThumbprint, Guid appId, string sslCertStoreName) + { + var sockAddrHandle = CreateSockaddrStructure(ipPort); + var pIpPort = sockAddrHandle.AddrOfPinnedObject(); + var httpServiceConfigSslKey = new HTTP_SERVICE_CONFIG_SSL_KEY(pIpPort); + + var hash = GetHash(certThumbprint); + var handleHash = GCHandle.Alloc(hash, GCHandleType.Pinned); + var configSslParam = new HTTP_SERVICE_CONFIG_SSL_PARAM + { + AppId = appId, + DefaultFlags = 0x00008000 /* HTTP_SERVICE_CONFIG_SSL_FLAG_ENABLE_CACHE_CLIENT_HELLO */, + DefaultRevocationFreshnessTime = 0, + DefaultRevocationUrlRetrievalTimeout = 15, + pSslCertStoreName = sslCertStoreName, + pSslHash = handleHash.AddrOfPinnedObject(), + SslHashLength = hash.Length, + pDefaultSslCtlIdentifier = null, + pDefaultSslCtlStoreName = sslCertStoreName + }; + + var configSslSet = new HTTP_SERVICE_CONFIG_SSL_SET + { + ParamDesc = configSslParam, + KeyDesc = httpServiceConfigSslKey + }; + + var pInputConfigInfo = Marshal.AllocCoTaskMem( + Marshal.SizeOf(typeof(HTTP_SERVICE_CONFIG_SSL_SET))); + Marshal.StructureToPtr(configSslSet, pInputConfigInfo, false); + + var status = HttpSetServiceConfiguration(nint.Zero, + HTTP_SERVICE_CONFIG_ID.HttpServiceConfigSSLCertInfo, + pInputConfigInfo, + Marshal.SizeOf(configSslSet), + nint.Zero); + + if (status == ERROR_ALREADY_EXISTS || status == 0) // already present or success + { + Console.WriteLine($"HttpServiceConfiguration is correct"); + } + else + { + Console.WriteLine("Failed to HttpSetServiceConfiguration: " + status); + } + } + + static byte[] GetHash(string thumbprint) + { + var length = thumbprint.Length; + var bytes = new byte[length / 2]; + for (var i = 0; i < length; i += 2) + { + bytes[i / 2] = Convert.ToByte(thumbprint.Substring(i, 2), 16); + } + + return bytes; + } + + static GCHandle CreateSockaddrStructure(IPEndPoint ipEndPoint) + { + var socketAddress = ipEndPoint.Serialize(); + + // use an array of bytes instead of the sockaddr structure + var sockAddrStructureBytes = new byte[socketAddress.Size]; + var sockAddrHandle = GCHandle.Alloc(sockAddrStructureBytes, GCHandleType.Pinned); + for (var i = 0; i < socketAddress.Size; ++i) + { + sockAddrStructureBytes[i] = socketAddress[i]; + } + return sockAddrHandle; + } + + static void CallHttpApi(Action body) + { + const uint flags = HTTP_INITIALIZE_CONFIG; + var retVal = HttpInitialize(HttpApiVersion, flags, IntPtr.Zero); + body(); + } + +// disabled warning since it is just a sample +#pragma warning disable SYSLIB1054 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + [DllImport("httpapi.dll", SetLastError = true)] + private static extern uint HttpInitialize( + HTTPAPI_VERSION version, + uint flags, + IntPtr pReserved); + + [DllImport("httpapi.dll", SetLastError = true)] + public static extern uint HttpSetServiceConfiguration( + nint serviceIntPtr, + HTTP_SERVICE_CONFIG_ID configId, + nint pConfigInformation, + int configInformationLength, + nint pOverlapped); +#pragma warning restore SYSLIB1054 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time +} diff --git a/src/Servers/HttpSys/samples/TlsFeaturesObserve/HttpSys/Native.cs b/src/Servers/HttpSys/samples/TlsFeaturesObserve/HttpSys/Native.cs new file mode 100644 index 000000000000..b939163d2252 --- /dev/null +++ b/src/Servers/HttpSys/samples/TlsFeaturesObserve/HttpSys/Native.cs @@ -0,0 +1,97 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace TlsFeaturesObserve.HttpSys; + +// Http.Sys types from https://learn.microsoft.com/windows/win32/api/http/ + +[StructLayout(LayoutKind.Sequential, Pack = 2)] +public struct HTTPAPI_VERSION +{ + public ushort HttpApiMajorVersion; + public ushort HttpApiMinorVersion; + + public HTTPAPI_VERSION(ushort majorVersion, ushort minorVersion) + { + HttpApiMajorVersion = majorVersion; + HttpApiMinorVersion = minorVersion; + } +} + +public enum HTTP_SERVICE_CONFIG_ID +{ + HttpServiceConfigIPListenList = 0, + HttpServiceConfigSSLCertInfo, + HttpServiceConfigUrlAclInfo, + HttpServiceConfigMax +} + +[StructLayout(LayoutKind.Sequential)] +public struct HTTP_SERVICE_CONFIG_SSL_SET +{ + public HTTP_SERVICE_CONFIG_SSL_KEY KeyDesc; + public HTTP_SERVICE_CONFIG_SSL_PARAM ParamDesc; +} + +[StructLayout(LayoutKind.Sequential)] +public struct HTTP_SERVICE_CONFIG_SSL_KEY +{ + public IntPtr pIpPort; + + public HTTP_SERVICE_CONFIG_SSL_KEY(IntPtr pIpPort) + { + this.pIpPort = pIpPort; + } +} + +[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] +public struct HTTP_SERVICE_CONFIG_SSL_PARAM +{ + public int SslHashLength; + public IntPtr pSslHash; + public Guid AppId; + [MarshalAs(UnmanagedType.LPWStr)] + public string pSslCertStoreName; + public CertCheckModes DefaultCertCheckMode; + public int DefaultRevocationFreshnessTime; + public int DefaultRevocationUrlRetrievalTimeout; + [MarshalAs(UnmanagedType.LPWStr)] + public string pDefaultSslCtlIdentifier; + [MarshalAs(UnmanagedType.LPWStr)] + public string pDefaultSslCtlStoreName; + public uint DefaultFlags; // HTTP_SERVICE_CONFIG_SSL_FLAG +} + +[Flags] +public enum CertCheckModes : uint +{ + /// + /// Enables the client certificate revocation check. + /// + None = 0, + + /// + /// Client certificate is not to be verified for revocation. + /// + DoNotVerifyCertificateRevocation = 1, + + /// + /// Only cached certificate is to be used the revocation check. + /// + VerifyRevocationWithCachedCertificateOnly = 2, + + /// + /// The RevocationFreshnessTime setting is enabled. + /// + EnableRevocationFreshnessTime = 4, + + /// + /// No usage check is to be performed. + /// + NoUsageCheck = 0x10000 +} diff --git a/src/Servers/HttpSys/samples/TlsFeaturesObserve/Program.cs b/src/Servers/HttpSys/samples/TlsFeaturesObserve/Program.cs new file mode 100644 index 000000000000..9551965ac398 --- /dev/null +++ b/src/Servers/HttpSys/samples/TlsFeaturesObserve/Program.cs @@ -0,0 +1,69 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; +using System.Runtime.InteropServices; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Server.HttpSys; +using Microsoft.Extensions.Hosting; +using TlsFeatureObserve; +using TlsFeaturesObserve.HttpSys; + +HttpSysConfigurator.ConfigureCacheTlsClientHello(); +CreateHostBuilder(args).Build().Run(); + +static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHost(webBuilder => + { + webBuilder.UseStartup() + .UseHttpSys(options => + { + // If you want to use https locally: https://stackoverflow.com/a/51841893 + options.UrlPrefixes.Add("https://*:6000"); // HTTPS + + options.Authentication.Schemes = AuthenticationSchemes.None; + options.Authentication.AllowAnonymous = true; + + var property = typeof(HttpSysOptions).GetProperty("TlsClientHelloBytesCallback", BindingFlags.NonPublic | BindingFlags.Instance); + var delegateType = property.PropertyType; // Get the exact delegate type + + // Create a delegate of the correct type + var callbackDelegate = Delegate.CreateDelegate(delegateType, typeof(Holder).GetMethod(nameof(Holder.ProcessTlsClientHello), BindingFlags.Static | BindingFlags.Public)); + + property?.SetValue(options, callbackDelegate); + }); + }); + +public static class Holder +{ + public static void ProcessTlsClientHello(IFeatureCollection features, ReadOnlySpan tlsClientHelloBytes) + { + var httpConnectionFeature = features.Get(); + + var myTlsFeature = new MyTlsFeature( + connectionId: httpConnectionFeature.ConnectionId, + tlsClientHelloLength: tlsClientHelloBytes.Length); + + features.Set(myTlsFeature); + } +} + +public interface IMyTlsFeature +{ + string ConnectionId { get; } + int TlsClientHelloLength { get; } +} + +public class MyTlsFeature : IMyTlsFeature +{ + public string ConnectionId { get; } + public int TlsClientHelloLength { get; } + + public MyTlsFeature(string connectionId, int tlsClientHelloLength) + { + ConnectionId = connectionId; + TlsClientHelloLength = tlsClientHelloLength; + } +} diff --git a/src/Servers/HttpSys/samples/TlsFeaturesObserve/Properties/launchSettings.json b/src/Servers/HttpSys/samples/TlsFeaturesObserve/Properties/launchSettings.json new file mode 100644 index 000000000000..c9d6b5efcb3c --- /dev/null +++ b/src/Servers/HttpSys/samples/TlsFeaturesObserve/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "TlsFeaturesObserve": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "http://localhost:5000", + "nativeDebugging": true + } + } +} \ No newline at end of file diff --git a/src/Servers/HttpSys/samples/TlsFeaturesObserve/Startup.cs b/src/Servers/HttpSys/samples/TlsFeaturesObserve/Startup.cs new file mode 100644 index 000000000000..8ba6d27aef98 --- /dev/null +++ b/src/Servers/HttpSys/samples/TlsFeaturesObserve/Startup.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Connections.Features; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Server.HttpSys; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace TlsFeatureObserve; + +public class Startup +{ + public void Configure(IApplicationBuilder app) + { + app.Run(async (HttpContext context) => + { + context.Response.ContentType = "text/plain"; + + var tlsFeature = context.Features.Get(); + await context.Response.WriteAsync("TlsClientHello data: " + $"connectionId={tlsFeature?.ConnectionId}; length={tlsFeature?.TlsClientHelloLength}"); + }); + } +} diff --git a/src/Servers/HttpSys/samples/TlsFeaturesObserve/TlsFeaturesObserve.csproj b/src/Servers/HttpSys/samples/TlsFeaturesObserve/TlsFeaturesObserve.csproj new file mode 100644 index 000000000000..f65f8a98a72a --- /dev/null +++ b/src/Servers/HttpSys/samples/TlsFeaturesObserve/TlsFeaturesObserve.csproj @@ -0,0 +1,14 @@ + + + + $(DefaultNetCoreTargetFramework) + Exe + true + + + + + + + + diff --git a/src/Servers/HttpSys/src/HttpSysListener.cs b/src/Servers/HttpSys/src/HttpSysListener.cs index 2b7924491d32..7fecff3c848d 100644 --- a/src/Servers/HttpSys/src/HttpSysListener.cs +++ b/src/Servers/HttpSys/src/HttpSysListener.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.HttpSys.Internal; +using Microsoft.AspNetCore.Server.HttpSys.RequestProcessing; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.Server.HttpSys; @@ -37,6 +38,7 @@ internal sealed partial class HttpSysListener : IDisposable private readonly UrlGroup _urlGroup; private readonly RequestQueue _requestQueue; private readonly DisconnectListener _disconnectListener; + private readonly TlsListener? _tlsListener; private readonly object _internalLock; @@ -69,12 +71,14 @@ public HttpSysListener(HttpSysOptions options, ILoggerFactory loggerFactory) try { _serverSession = new ServerSession(); - _requestQueue = new RequestQueue(options.RequestQueueName, options.RequestQueueMode, Logger); - _urlGroup = new UrlGroup(_serverSession, _requestQueue, Logger); _disconnectListener = new DisconnectListener(_requestQueue, Logger); + if (options.TlsClientHelloBytesCallback is not null) + { + _tlsListener = new TlsListener(Logger, options.TlsClientHelloBytesCallback); + } } catch (Exception exception) { @@ -82,6 +86,7 @@ public HttpSysListener(HttpSysOptions options, ILoggerFactory loggerFactory) _requestQueue?.Dispose(); _urlGroup?.Dispose(); _serverSession?.Dispose(); + _tlsListener?.Dispose(); Log.HttpSysListenerCtorError(Logger, exception); throw; } @@ -96,20 +101,10 @@ internal enum State internal ILogger Logger { get; private set; } - internal UrlGroup UrlGroup - { - get { return _urlGroup; } - } - - internal RequestQueue RequestQueue - { - get { return _requestQueue; } - } - - internal DisconnectListener DisconnectListener - { - get { return _disconnectListener; } - } + internal UrlGroup UrlGroup => _urlGroup; + internal RequestQueue RequestQueue => _requestQueue; + internal TlsListener? TlsListener => _tlsListener; + internal DisconnectListener DisconnectListener => _disconnectListener; public HttpSysOptions Options { get; } @@ -262,6 +257,7 @@ private void DisposeInternal() Debug.Assert(!_serverSession.Id.IsInvalid, "ServerSessionHandle is invalid in CloseV2Config"); _serverSession.Dispose(); + _tlsListener?.Dispose(); } /// diff --git a/src/Servers/HttpSys/src/HttpSysOptions.cs b/src/Servers/HttpSys/src/HttpSysOptions.cs index 87fb1ba6d176..dfed2d7beced 100644 --- a/src/Servers/HttpSys/src/HttpSysOptions.cs +++ b/src/Servers/HttpSys/src/HttpSysOptions.cs @@ -242,10 +242,23 @@ public Http503VerbosityLevel Http503Verbosity /// Configures request headers to use encoding. /// /// - /// Defaults to `false`, in which case will be used. />. + /// Defaults to false, in which case will be used. />. /// public bool UseLatin1RequestHeaders { get; set; } + /// + /// A callback to be invoked to get the TLS client hello bytes. + /// Null by default. + /// + /// + /// Works only if HTTP_SERVICE_CONFIG_SSL_FLAG_ENABLE_CACHE_CLIENT_HELLO flag is set on http.sys service configuration. + /// See + /// and + /// + internal TlsClientHelloCallback? TlsClientHelloBytesCallback { get; set; } + + internal delegate void TlsClientHelloCallback(IFeatureCollection features, ReadOnlySpan clientHelloBytes); + // Not called when attaching to an existing queue. internal void Apply(UrlGroup urlGroup, RequestQueue? requestQueue) { diff --git a/src/Servers/HttpSys/src/LoggerEventIds.cs b/src/Servers/HttpSys/src/LoggerEventIds.cs index 5bc0b6b65ed6..e6d745f506be 100644 --- a/src/Servers/HttpSys/src/LoggerEventIds.cs +++ b/src/Servers/HttpSys/src/LoggerEventIds.cs @@ -59,4 +59,5 @@ internal static class LoggerEventIds public const int AcceptCancelExpectationMismatch = 52; public const int AcceptObserveExpectationMismatch = 53; public const int RequestParsingError = 54; + public const int TlsListenerError = 55; } diff --git a/src/Servers/HttpSys/src/NativeInterop/HttpApi.cs b/src/Servers/HttpSys/src/NativeInterop/HttpApi.cs index 575ebc259d25..efb42c87c5b5 100644 --- a/src/Servers/HttpSys/src/NativeInterop/HttpApi.cs +++ b/src/Servers/HttpSys/src/NativeInterop/HttpApi.cs @@ -122,13 +122,30 @@ internal static HTTP_API_VERSION ApiVersion } internal static SafeLibraryHandle? HttpApiModule { get; private set; } - internal static HttpGetRequestPropertyInvoker? HttpGetRequestProperty { get; private set; } - internal static HttpSetRequestPropertyInvoker? HttpSetRequestProperty { get; private set; } - [MemberNotNullWhen(true, nameof(HttpSetRequestProperty))] + private static HttpGetRequestPropertyInvoker? HttpGetRequestInvoker { get; set; } + private static HttpSetRequestPropertyInvoker? HttpSetRequestInvoker { get; set; } + + internal static bool HttpGetRequestPropertySupported => HttpGetRequestInvoker is not null; + internal static bool HttpSetRequestPropertySupported => HttpSetRequestInvoker is not null; + + internal static unsafe uint HttpGetRequestProperty(SafeHandle requestQueueHandle, ulong requestId, HTTP_REQUEST_PROPERTY propertyId, + void* qualifier, uint qualifierSize, void* output, uint outputSize, uint* bytesReturned, IntPtr overlapped) + { + return HttpGetRequestInvoker!(requestQueueHandle, requestId, propertyId, qualifier, qualifierSize, output, outputSize, bytesReturned, overlapped); + } + + internal static unsafe uint HttpSetRequestProperty(SafeHandle requestQueueHandle, ulong requestId, HTTP_REQUEST_PROPERTY propertyId, + void* input, uint inputSize, IntPtr overlapped) + { + return HttpSetRequestInvoker!(requestQueueHandle, requestId, propertyId, input, inputSize, overlapped); + } + + [MemberNotNullWhen(true, nameof(HttpSetRequestInvoker))] internal static bool SupportsTrailers { get; private set; } - [MemberNotNullWhen(true, nameof(HttpSetRequestProperty))] + [MemberNotNullWhen(true, nameof(HttpSetRequestInvoker))] internal static bool SupportsReset { get; private set; } internal static bool SupportsDelegation { get; private set; } + internal static bool SupportsClientHello { get; private set; } static HttpApi() { @@ -147,11 +164,12 @@ private static void InitHttpApi(ushort majorVersion, ushort minorVersion) if (supported) { HttpApiModule = SafeLibraryHandle.Open(HTTPAPI); - HttpGetRequestProperty = HttpApiModule.GetProcAddress("HttpQueryRequestProperty", throwIfNotFound: false); - HttpSetRequestProperty = HttpApiModule.GetProcAddress("HttpSetRequestProperty", throwIfNotFound: false); - SupportsReset = HttpSetRequestProperty != null; + HttpGetRequestInvoker = HttpApiModule.GetProcAddress("HttpQueryRequestProperty", throwIfNotFound: false); + HttpSetRequestInvoker = HttpApiModule.GetProcAddress("HttpSetRequestProperty", throwIfNotFound: false); + SupportsReset = HttpSetRequestPropertySupported; SupportsTrailers = IsFeatureSupported(HTTP_FEATURE_ID.HttpFeatureResponseTrailers); SupportsDelegation = IsFeatureSupported(HTTP_FEATURE_ID.HttpFeatureDelegateEx); + SupportsClientHello = IsFeatureSupported((HTTP_FEATURE_ID)11 /* HTTP_FEATURE_ID.HttpFeatureCacheTlsClientHello */) && HttpGetRequestPropertySupported; } } diff --git a/src/Servers/HttpSys/src/RequestProcessing/Request.cs b/src/Servers/HttpSys/src/RequestProcessing/Request.cs index 6029f8269f53..9aa93adb508d 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/Request.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/Request.cs @@ -9,10 +9,12 @@ using System.Security.Cryptography.X509Certificates; using System.Security.Principal; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.HttpSys.Internal; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; +using static Microsoft.AspNetCore.Server.HttpSys.HttpSysOptions; namespace Microsoft.AspNetCore.Server.HttpSys; @@ -362,6 +364,9 @@ private void GetTlsHandshakeResults() SniHostName = sni.Hostname; } + internal bool GetAndInvokeTlsClientHelloCallback(IFeatureCollection features, TlsClientHelloCallback tlsClientHelloBytesCallback) + => RequestContext.GetAndInvokeTlsClientHelloMessageBytesCallback(features, tlsClientHelloBytesCallback); + public X509Certificate2? ClientCertificate { get diff --git a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.Log.cs b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.Log.cs index 41b1cf480d5a..d7766698bc41 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.Log.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.Log.cs @@ -20,5 +20,8 @@ private static partial class Log [LoggerMessage(LoggerEventIds.RequestParsingError, LogLevel.Debug, "Failed to parse request.", EventName = "RequestParsingError")] public static partial void RequestParsingError(ILogger logger, Exception exception); + + [LoggerMessage(LoggerEventIds.RequestParsingError, LogLevel.Debug, "Failed to invoke QueryTlsClientHello; RequestId: {RequestId}; Win32 Error code: {Win32Error}", EventName = "TlsClientHelloRetrieveError")] + public static partial void TlsClientHelloRetrieveError(ILogger logger, ulong requestId, uint win32Error); } } diff --git a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs index e9f277b6a990..5c45db813880 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs @@ -1,13 +1,18 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Buffers; using System.Diagnostics; using System.Runtime.InteropServices; using System.Security.Authentication.ExtendedProtection; using System.Security.Principal; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.HttpSys.Internal; using Microsoft.Extensions.Logging; +using static Microsoft.AspNetCore.HttpSys.Internal.HttpApiTypes; +using static Microsoft.AspNetCore.HttpSys.Internal.UnsafeNclNativeMethods; +using static Microsoft.AspNetCore.Server.HttpSys.HttpSysOptions; namespace Microsoft.AspNetCore.Server.HttpSys; @@ -234,30 +239,118 @@ internal void ForceCancelRequest() } } - internal unsafe HttpApiTypes.HTTP_REQUEST_PROPERTY_SNI GetClientSni() + /// + /// Attempts to get the client hello message bytes from HTTP.sys and calls the user provided callback. + /// If not successful, will return false. + /// + internal unsafe bool GetAndInvokeTlsClientHelloMessageBytesCallback(IFeatureCollection features, TlsClientHelloCallback tlsClientHelloBytesCallback) { - if (HttpApi.HttpGetRequestProperty != null) + if (!HttpApi.SupportsClientHello) + { + // not supported, so we just return and don't invoke the callback + return false; + } + + uint bytesReturnedValue = 0; + uint* bytesReturned = &bytesReturnedValue; + uint statusCode; + + var requestId = PinsReleased ? Request.RequestId : RequestId; + + // we will try with some "random" buffer size + var buffer = ArrayPool.Shared.Rent(512); + try { - var buffer = new byte[HttpApiTypes.SniPropertySizeInBytes]; fixed (byte* pBuffer = buffer) { - var statusCode = HttpApi.HttpGetRequestProperty( - Server.RequestQueue.Handle, - RequestId, - HttpApiTypes.HTTP_REQUEST_PROPERTY.HttpRequestPropertySni, + statusCode = HttpApi.HttpGetRequestProperty( + requestQueueHandle: Server.RequestQueue.Handle, + requestId, + propertyId: (HTTP_REQUEST_PROPERTY)11 /* HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsClientHello */, qualifier: null, qualifierSize: 0, - (void*)pBuffer, - (uint)buffer.Length, - bytesReturned: null, - IntPtr.Zero); + output: pBuffer, + outputSize: (uint)buffer.Length, + bytesReturned: bytesReturned, + overlapped: IntPtr.Zero); - if (statusCode == UnsafeNclNativeMethods.ErrorCodes.ERROR_SUCCESS) + if (statusCode is ErrorCodes.ERROR_SUCCESS) { - return Marshal.PtrToStructure((IntPtr)pBuffer); + tlsClientHelloBytesCallback(features, buffer.AsSpan(0, (int)bytesReturnedValue)); + return true; } } } + finally + { + ArrayPool.Shared.Return(buffer, clearArray: true); + } + + // if buffer supplied is too small, `bytesReturned` will have proper size + // so retry should succeed with the properly allocated buffer + if (statusCode is ErrorCodes.ERROR_MORE_DATA or ErrorCodes.ERROR_INSUFFICIENT_BUFFER) + { + try + { + var correctSize = (int)bytesReturnedValue; + buffer = ArrayPool.Shared.Rent(correctSize); + + fixed (byte* pBuffer = buffer) + { + statusCode = HttpApi.HttpGetRequestProperty( + requestQueueHandle: Server.RequestQueue.Handle, + requestId, + propertyId: (HTTP_REQUEST_PROPERTY)11 /* HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsClientHello */, + qualifier: null, + qualifierSize: 0, + output: pBuffer, + outputSize: (uint)buffer.Length, + bytesReturned: bytesReturned, + overlapped: IntPtr.Zero); + + if (statusCode is ErrorCodes.ERROR_SUCCESS) + { + tlsClientHelloBytesCallback(features, buffer.AsSpan(0, correctSize)); + return true; + } + } + } + finally + { + ArrayPool.Shared.Return(buffer, clearArray: true); + } + } + + Log.TlsClientHelloRetrieveError(Logger, requestId, statusCode); + return false; + } + + internal unsafe HTTP_REQUEST_PROPERTY_SNI GetClientSni() + { + if (!HttpApi.HttpGetRequestPropertySupported) + { + return default; + } + + var buffer = new byte[HttpApiTypes.SniPropertySizeInBytes]; + fixed (byte* pBuffer = buffer) + { + var statusCode = HttpApi.HttpGetRequestProperty( + Server.RequestQueue.Handle, + RequestId, + HTTP_REQUEST_PROPERTY.HttpRequestPropertySni, + qualifier: null, + qualifierSize: 0, + pBuffer, + (uint)buffer.Length, + bytesReturned: null, + IntPtr.Zero); + + if (statusCode == ErrorCodes.ERROR_SUCCESS) + { + return Marshal.PtrToStructure((IntPtr)pBuffer); + } + } return default; } diff --git a/src/Servers/HttpSys/src/RequestProcessing/RequestContextOfT.cs b/src/Servers/HttpSys/src/RequestProcessing/RequestContextOfT.cs index 2a1d06a06d26..399f1292d60d 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/RequestContextOfT.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/RequestContextOfT.cs @@ -48,6 +48,12 @@ public override async Task ExecuteAsync() context = application.CreateContext(Features); try { + if (Server.Options.TlsClientHelloBytesCallback is not null && Server.TlsListener is not null + && Request.IsHttps) + { + Server.TlsListener.InvokeTlsClientHelloCallback(Request.RawConnectionId, Features, Request.GetAndInvokeTlsClientHelloCallback); + } + await application.ProcessRequestAsync(context); await CompleteAsync(); } diff --git a/src/Servers/HttpSys/src/RequestProcessing/TlsListener.Log.cs b/src/Servers/HttpSys/src/RequestProcessing/TlsListener.Log.cs new file mode 100644 index 000000000000..20ffe5c74b6f --- /dev/null +++ b/src/Servers/HttpSys/src/RequestProcessing/TlsListener.Log.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.Extensions.Logging; + +namespace Microsoft.AspNetCore.Server.HttpSys.RequestProcessing; + +internal sealed partial class TlsListener : IDisposable +{ + private static partial class Log + { + [LoggerMessage(LoggerEventIds.TlsListenerError, LogLevel.Error, "Error during closed connection cleanup.", EventName = "TlsListenerCleanupClosedConnectionError")] + public static partial void CleanupClosedConnectionError(ILogger logger, Exception exception); + } +} diff --git a/src/Servers/HttpSys/src/RequestProcessing/TlsListener.cs b/src/Servers/HttpSys/src/RequestProcessing/TlsListener.cs new file mode 100644 index 000000000000..731ecea05f6e --- /dev/null +++ b/src/Servers/HttpSys/src/RequestProcessing/TlsListener.cs @@ -0,0 +1,144 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Concurrent; +using System.Collections.ObjectModel; +using Microsoft.AspNetCore.Http.Features; +using Microsoft.Extensions.Logging; +using static Microsoft.AspNetCore.Server.HttpSys.HttpSysOptions; + +namespace Microsoft.AspNetCore.Server.HttpSys.RequestProcessing; + +internal sealed partial class TlsListener : IDisposable +{ + private readonly ConcurrentDictionary _connectionTimestamps = new(); + private readonly TlsClientHelloCallback _tlsClientHelloBytesCallback; + private readonly ILogger _logger; + + private readonly PeriodicTimer _cleanupTimer; + private readonly Task _cleanupTask; + private readonly TimeProvider _timeProvider; + + private readonly TimeSpan ConnectionIdleTime = TimeSpan.FromMinutes(5); + private readonly TimeSpan CleanupDelay = TimeSpan.FromSeconds(10); + internal readonly int CacheSizeLimit = 1_000_000; + + // Internal for testing purposes + internal ReadOnlyDictionary ConnectionTimeStamps => _connectionTimestamps.AsReadOnly(); + + internal TlsListener(ILogger logger, TlsClientHelloCallback tlsClientHelloBytesCallback, TimeProvider? timeProvider = null) + { + if (AppContext.GetData("Microsoft.AspNetCore.Server.HttpSys.TlsListener.CacheSizeLimit") is int limit) + { + CacheSizeLimit = limit; + } + + if (AppContext.GetData("Microsoft.AspNetCore.Server.HttpSys.TlsListener.ConnectionIdleTime") is int idleTime) + { + ConnectionIdleTime = TimeSpan.FromSeconds(idleTime); + } + + if (AppContext.GetData("Microsoft.AspNetCore.Server.HttpSys.TlsListener.CleanupDelay") is int cleanupDelay) + { + CleanupDelay = TimeSpan.FromSeconds(cleanupDelay); + } + + _logger = logger; + _tlsClientHelloBytesCallback = tlsClientHelloBytesCallback; + + _timeProvider = timeProvider ?? TimeProvider.System; + _cleanupTimer = new PeriodicTimer(CleanupDelay, _timeProvider); + _cleanupTask = CleanupLoopAsync(); + } + + // Method looks weird because we want it to be testable by not directly requiring a Request object + internal void InvokeTlsClientHelloCallback(ulong connectionId, IFeatureCollection features, + Func invokeTlsClientHelloCallback) + { + if (!_connectionTimestamps.TryAdd(connectionId, _timeProvider.GetUtcNow())) + { + // update TTL + _connectionTimestamps[connectionId] = _timeProvider.GetUtcNow(); + return; + } + + _ = invokeTlsClientHelloCallback(features, _tlsClientHelloBytesCallback); + } + + internal async Task CleanupLoopAsync() + { + while (await _cleanupTimer.WaitForNextTickAsync()) + { + try + { + var now = _timeProvider.GetUtcNow(); + + // Remove idle connections + foreach (var kvp in _connectionTimestamps) + { + if (now - kvp.Value >= ConnectionIdleTime) + { + _connectionTimestamps.TryRemove(kvp.Key, out _); + } + } + + // Evict oldest items if above CacheSizeLimit + var currentCount = _connectionTimestamps.Count; + if (currentCount > CacheSizeLimit) + { + var excessCount = currentCount - CacheSizeLimit; + + // Find the oldest items in a single pass + var oldestTimestamps = new SortedSet>(TimeComparer.Instance); + + foreach (var kvp in _connectionTimestamps) + { + if (oldestTimestamps.Count < excessCount) + { + oldestTimestamps.Add(new KeyValuePair(kvp.Key, kvp.Value)); + } + else if (kvp.Value < oldestTimestamps.Max.Value) + { + oldestTimestamps.Remove(oldestTimestamps.Max); + oldestTimestamps.Add(new KeyValuePair(kvp.Key, kvp.Value)); + } + } + + // Remove the oldest keys + foreach (var item in oldestTimestamps) + { + _connectionTimestamps.TryRemove(item.Key, out _); + } + } + } + catch (Exception ex) + { + Log.CleanupClosedConnectionError(_logger, ex); + } + } + } + + public void Dispose() + { + _cleanupTimer.Dispose(); + _cleanupTask.Wait(); + } + + private sealed class TimeComparer : IComparer> + { + public static TimeComparer Instance { get; } = new TimeComparer(); + + public int Compare(KeyValuePair x, KeyValuePair y) + { + // Compare timestamps first + int timestampComparison = x.Value.CompareTo(y.Value); + if (timestampComparison != 0) + { + return timestampComparison; + } + + // Use the key as a tiebreaker to ensure uniqueness + return x.Key.CompareTo(y.Key); + } + } +} diff --git a/src/Servers/HttpSys/test/FunctionalTests/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj b/src/Servers/HttpSys/test/FunctionalTests/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj index 08276e6a23fd..56f300b89198 100644 --- a/src/Servers/HttpSys/test/FunctionalTests/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj +++ b/src/Servers/HttpSys/test/FunctionalTests/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj @@ -32,6 +32,7 @@ + diff --git a/src/Servers/HttpSys/test/FunctionalTests/TlsListenerTests.cs b/src/Servers/HttpSys/test/FunctionalTests/TlsListenerTests.cs new file mode 100644 index 000000000000..00c3ac024d32 --- /dev/null +++ b/src/Servers/HttpSys/test/FunctionalTests/TlsListenerTests.cs @@ -0,0 +1,141 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Server.HttpSys.RequestProcessing; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Time.Testing; +using Moq; +using static Microsoft.AspNetCore.Server.HttpSys.HttpSysOptions; + +namespace Microsoft.AspNetCore.Server.HttpSys.FunctionalTests; + +public class TlsListenerTests +{ + [Fact] + public void AddsAndUpdatesConnectionTimestamps() + { + // Arrange + var logger = Mock.Of(); + var timeProvider = new FakeTimeProvider(); + var callbackInvoked = false; + var tlsListener = new TlsListener(logger, (_, __) => { callbackInvoked = true; }, timeProvider); + + var features = Mock.Of(); + + // Act + tlsListener.InvokeTlsClientHelloCallback(connectionId: 1UL, features, + invokeTlsClientHelloCallback: (f, cb) => { cb(f, ReadOnlySpan.Empty); return true; }); + + var originalTime = timeProvider.GetUtcNow(); + + // Assert + Assert.True(callbackInvoked); + Assert.Equal(originalTime, Assert.Single(tlsListener.ConnectionTimeStamps).Value); + + timeProvider.Advance(TimeSpan.FromSeconds(1)); + callbackInvoked = false; + // Update the timestamp + tlsListener.InvokeTlsClientHelloCallback(connectionId: 1UL, features, + invokeTlsClientHelloCallback: (f, cb) => { cb(f, ReadOnlySpan.Empty); return true; }); + + // Callback should not be invoked again and the timestamp should be updated + Assert.False(callbackInvoked); + Assert.Equal(timeProvider.GetUtcNow(), Assert.Single(tlsListener.ConnectionTimeStamps).Value); + Assert.NotEqual(originalTime, timeProvider.GetUtcNow()); + } + + [Fact] + public async Task RemovesIdleConnections() + { + // Arrange + var logger = Mock.Of(); + var timeProvider = new FakeTimeProvider(); + using var tlsListener = new TlsListener(logger, (_, __) => { }, timeProvider); + + var features = Mock.Of(); + + bool InvokeCallback(IFeatureCollection f, TlsClientHelloCallback cb) + { + cb(f, ReadOnlySpan.Empty); + return true; + } + + // Act + tlsListener.InvokeTlsClientHelloCallback(connectionId: 1UL, features, InvokeCallback); + + // 1 less minute than the idle time cleanup + timeProvider.Advance(TimeSpan.FromMinutes(4)); + Assert.Single(tlsListener.ConnectionTimeStamps); + + tlsListener.InvokeTlsClientHelloCallback(connectionId: 2UL, features, InvokeCallback); + Assert.Equal(2, tlsListener.ConnectionTimeStamps.Count); + + // With the previous 4 minutes, this should be 5 minutes and remove the first connection + timeProvider.Advance(TimeSpan.FromMinutes(1)); + + var timeout = TimeSpan.FromSeconds(5); + while (timeout > TimeSpan.Zero) + { + // Wait for the cleanup loop to run + if (tlsListener.ConnectionTimeStamps.Count == 1) + { + break; + } + timeout -= TimeSpan.FromMilliseconds(100); + await Task.Delay(100); + } + + // Assert + Assert.Single(tlsListener.ConnectionTimeStamps); + Assert.Contains(2UL, tlsListener.ConnectionTimeStamps.Keys); + } + + [Fact] + public async Task EvictsOldestConnectionsWhenExceedingCacheSizeLimit() + { + // Arrange + var logger = Mock.Of(); + var timeProvider = new FakeTimeProvider(); + var tlsListener = new TlsListener(logger, (_, __) => { }, timeProvider); + var features = Mock.Of(); + + ulong i = 0; + for (; i < (ulong)tlsListener.CacheSizeLimit; i++) + { + tlsListener.InvokeTlsClientHelloCallback(i, features, (f, cb) => { cb(f, ReadOnlySpan.Empty); return true; }); + } + + timeProvider.Advance(TimeSpan.FromSeconds(5)); + + for (; i < (ulong)tlsListener.CacheSizeLimit + 3; i++) + { + tlsListener.InvokeTlsClientHelloCallback(i, features, (f, cb) => { cb(f, ReadOnlySpan.Empty); return true; }); + } + + // 'touch' first connection to update its timestamp + tlsListener.InvokeTlsClientHelloCallback(0, features, (f, cb) => { cb(f, ReadOnlySpan.Empty); return true; }); + + // Make sure the cleanup loop has run to evict items since we're above the cache size limit + timeProvider.Advance(TimeSpan.FromMinutes(1)); + + var timeout = TimeSpan.FromSeconds(5); + while (timeout > TimeSpan.Zero) + { + // Wait for the cleanup loop to run + if (tlsListener.ConnectionTimeStamps.Count == tlsListener.CacheSizeLimit) + { + break; + } + timeout -= TimeSpan.FromMilliseconds(100); + await Task.Delay(100); + } + + Assert.Equal(tlsListener.CacheSizeLimit, tlsListener.ConnectionTimeStamps.Count); + Assert.Contains(0UL, tlsListener.ConnectionTimeStamps.Keys); + // 3 newest connections should be present + Assert.Contains(i - 1, tlsListener.ConnectionTimeStamps.Keys); + Assert.Contains(i - 2, tlsListener.ConnectionTimeStamps.Keys); + Assert.Contains(i - 3, tlsListener.ConnectionTimeStamps.Keys); + } +} diff --git a/src/Shared/HttpSys/NativeInterop/UnsafeNativeMethods.cs b/src/Shared/HttpSys/NativeInterop/UnsafeNativeMethods.cs index 7fed60b434b1..9fce59c69c36 100644 --- a/src/Shared/HttpSys/NativeInterop/UnsafeNativeMethods.cs +++ b/src/Shared/HttpSys/NativeInterop/UnsafeNativeMethods.cs @@ -28,6 +28,7 @@ internal static class ErrorCodes internal const uint ERROR_HANDLE_EOF = 38; internal const uint ERROR_NOT_SUPPORTED = 50; internal const uint ERROR_INVALID_PARAMETER = 87; + internal const uint ERROR_INSUFFICIENT_BUFFER = 122; internal const uint ERROR_INVALID_NAME = 123; internal const uint ERROR_ALREADY_EXISTS = 183; internal const uint ERROR_MORE_DATA = 234; diff --git a/src/Shared/HttpSys/RequestProcessing/NativeRequestContext.cs b/src/Shared/HttpSys/RequestProcessing/NativeRequestContext.cs index b58bad9e800e..ad4f63eaacd7 100644 --- a/src/Shared/HttpSys/RequestProcessing/NativeRequestContext.cs +++ b/src/Shared/HttpSys/RequestProcessing/NativeRequestContext.cs @@ -31,9 +31,11 @@ internal unsafe class NativeRequestContext : IDisposable private MemoryHandle _memoryHandle; private readonly int _bufferAlignment; private readonly bool _permanentlyPinned; - private bool _disposed; private IReadOnlyDictionary>? _requestInfo; + private bool _disposed; + private bool _pinsReleased; + [MemberNotNullWhen(false, nameof(_backingBuffer))] private bool PermanentlyPinned => _permanentlyPinned; @@ -168,6 +170,11 @@ internal uint Size } } + /// + /// Shows whether was already invoked on this native request context + /// + internal bool PinsReleased => _pinsReleased; + // ReleasePins() should be called exactly once. It must be called before Dispose() is called, which means it must be called // before an object (Request) which closes the RequestContext on demand is returned to the application. internal void ReleasePins() @@ -177,6 +184,7 @@ internal void ReleasePins() _memoryHandle.Dispose(); _memoryHandle = default; _nativeRequest = null; + _pinsReleased = true; } public bool TryGetTimestamp(HttpSysRequestTimingType timestampType, out long timestamp) From ffbf2f17c24a3ea2b23d5583024fc21bd0b60ced Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Thu, 17 Apr 2025 00:12:05 +0000 Subject: [PATCH 15/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-runtime build 20250415.6 Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Net.Http.WinHttpHandler , Microsoft.SourceBuild.Intermediate.runtime.linux-x64 From Version 8.0.15-servicing.25164.13 -> To Version 8.0.16-servicing.25215.6 --- NuGet.config | 14 ++----------- eng/Version.Details.xml | 44 ++++++++++++++++++++--------------------- eng/Versions.props | 22 ++++++++++----------- 3 files changed, 35 insertions(+), 45 deletions(-) diff --git a/NuGet.config b/NuGet.config index e2087a016db2..114f68015117 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,14 +6,9 @@ - - - - - - + @@ -34,14 +29,9 @@ - - - - - - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ee11ee5e72e9..033c3fa436e2 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -121,9 +121,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 50c4cb9fc31c47f03eac865d7bc518af173b74b7 + efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -185,9 +185,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 50c4cb9fc31c47f03eac865d7bc518af173b74b7 + efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 https://github.com/dotnet/source-build-externals @@ -223,9 +223,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 81cabf2857a01351e5ab578947c7403a5b128ad1 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 05e0f2d2c881def48961d3b83fa11ae84df8e534 + efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -275,17 +275,17 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 81cabf2857a01351e5ab578947c7403a5b128ad1 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 50c4cb9fc31c47f03eac865d7bc518af173b74b7 + efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 50c4cb9fc31c47f03eac865d7bc518af173b74b7 + efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 50c4cb9fc31c47f03eac865d7bc518af173b74b7 + efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -316,22 +316,22 @@ Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime. All Runtime.$rid packages should have the same version. --> - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 50c4cb9fc31c47f03eac865d7bc518af173b74b7 + efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 50c4cb9fc31c47f03eac865d7bc518af173b74b7 + efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 50c4cb9fc31c47f03eac865d7bc518af173b74b7 + efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 50c4cb9fc31c47f03eac865d7bc518af173b74b7 + efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 https://github.com/dotnet/xdt @@ -368,9 +368,9 @@ - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 50c4cb9fc31c47f03eac865d7bc518af173b74b7 + efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 https://github.com/dotnet/winforms diff --git a/eng/Versions.props b/eng/Versions.props index dbfe6df117bd..157b084e8cab 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -67,12 +67,12 @@ 8.0.2 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15-servicing.25164.13 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16-servicing.25215.6 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.15-servicing.25164.13 + 8.0.16-servicing.25215.6 8.0.1 8.0.1 8.0.1 @@ -109,7 +109,7 @@ 8.0.0 8.0.2 8.0.0 - 8.0.15-servicing.25164.13 + 8.0.16-servicing.25215.6 8.0.1 8.0.1 8.0.2 @@ -117,7 +117,7 @@ 8.0.0-rtm.23520.14 8.0.0 8.0.1 - 8.0.2 + 8.0.3 8.0.1 8.0.0 8.0.1 @@ -129,9 +129,9 @@ 8.0.0 8.0.0 8.0.0 - 8.0.15-servicing.25164.13 + 8.0.16-servicing.25215.6 - 8.0.15-servicing.25164.13 + 8.0.16-servicing.25215.6 8.0.0 8.0.1 From 040389330d6b058a8029d4829e85ebc63a940370 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Thu, 17 Apr 2025 02:14:36 +0000 Subject: [PATCH 16/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250416.6 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.15 -> To Version 8.0.16 --- NuGet.config | 2 ++ eng/Version.Details.xml | 32 ++++++++++++++++---------------- eng/Versions.props | 16 ++++++++-------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/NuGet.config b/NuGet.config index 114f68015117..aa5c279af136 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,6 +6,7 @@ + @@ -29,6 +30,7 @@ + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 033c3fa436e2..bfa82b7e83bb 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -9,37 +9,37 @@ --> - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0118cb6810a48869bf7494aabd86ef44da5940a3 + c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0118cb6810a48869bf7494aabd86ef44da5940a3 + c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0118cb6810a48869bf7494aabd86ef44da5940a3 + c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0118cb6810a48869bf7494aabd86ef44da5940a3 + c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0118cb6810a48869bf7494aabd86ef44da5940a3 + c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0118cb6810a48869bf7494aabd86ef44da5940a3 + c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0118cb6810a48869bf7494aabd86ef44da5940a3 + c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0118cb6810a48869bf7494aabd86ef44da5940a3 + c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 157b084e8cab..be43c831fee0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -143,14 +143,14 @@ 8.1.0-preview.23604.1 8.1.0-preview.23604.1 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 4.8.0-7.24574.2 4.8.0-7.24574.2 From 54203289265b8ca0e3d35973f439b7361a00b3b1 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Fri, 2 May 2025 00:37:02 +0000 Subject: [PATCH 17/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-runtime build 20250501.5 Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Net.Http.WinHttpHandler , Microsoft.SourceBuild.Intermediate.runtime.linux-x64 From Version 8.0.16-servicing.25215.6 -> To Version 8.0.16-servicing.25251.5 --- NuGet.config | 12 ++++++++++-- eng/Version.Details.xml | 32 ++++++++++++++++---------------- eng/Versions.props | 10 +++++----- 3 files changed, 31 insertions(+), 23 deletions(-) diff --git a/NuGet.config b/NuGet.config index aa5c279af136..fae79338f321 100644 --- a/NuGet.config +++ b/NuGet.config @@ -7,9 +7,13 @@ + + + + - + @@ -30,10 +34,14 @@ + + + + - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index bfa82b7e83bb..8e1af97f6bae 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -121,9 +121,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 + b33d4e34e1cbf993583d78fc1b64ea8400935978 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -185,9 +185,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 + b33d4e34e1cbf993583d78fc1b64ea8400935978 https://github.com/dotnet/source-build-externals @@ -225,7 +225,7 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 + b33d4e34e1cbf993583d78fc1b64ea8400935978 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -277,15 +277,15 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 + b33d4e34e1cbf993583d78fc1b64ea8400935978 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 + b33d4e34e1cbf993583d78fc1b64ea8400935978 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 + b33d4e34e1cbf993583d78fc1b64ea8400935978 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -318,20 +318,20 @@ --> https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 + b33d4e34e1cbf993583d78fc1b64ea8400935978 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 + b33d4e34e1cbf993583d78fc1b64ea8400935978 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 + b33d4e34e1cbf993583d78fc1b64ea8400935978 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 + b33d4e34e1cbf993583d78fc1b64ea8400935978 https://github.com/dotnet/xdt @@ -368,9 +368,9 @@ - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - efd5742bb5dd1677fbbbeb277bcfb5c9025548e5 + b33d4e34e1cbf993583d78fc1b64ea8400935978 https://github.com/dotnet/winforms diff --git a/eng/Versions.props b/eng/Versions.props index be43c831fee0..634e2fe0a46b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -72,7 +72,7 @@ 8.0.16 8.0.16 8.0.16 - 8.0.16-servicing.25215.6 + 8.0.16-servicing.25251.5 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.16-servicing.25215.6 + 8.0.16-servicing.25251.5 8.0.1 8.0.1 8.0.1 @@ -109,7 +109,7 @@ 8.0.0 8.0.2 8.0.0 - 8.0.16-servicing.25215.6 + 8.0.16-servicing.25251.5 8.0.1 8.0.1 8.0.2 @@ -129,9 +129,9 @@ 8.0.0 8.0.0 8.0.0 - 8.0.16-servicing.25215.6 + 8.0.16-servicing.25251.5 - 8.0.16-servicing.25215.6 + 8.0.16-servicing.25251.5 8.0.0 8.0.1 From d4dc352d2c8b2cb84e59f0ea66b5b16eee4010fc Mon Sep 17 00:00:00 2001 From: vseanreesermsft <78103370+vseanreesermsft@users.noreply.github.com> Date: Wed, 7 May 2025 17:22:06 -0700 Subject: [PATCH 18/76] Update branding to 8.0.17 (#61830) --- eng/Versions.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index dbfe6df117bd..5619419190d2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -8,10 +8,10 @@ 8 0 - 16 + 17 - true + false 7.1.2 7.* - - - - - + @@ -34,11 +30,7 @@ - - - - - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8e1af97f6bae..df12d6737195 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -9,37 +9,37 @@ --> - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 + 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 + 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 + 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 + 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 + 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 + 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 + 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - c755c4a6f3df392ac86ce9985f27a8c3e851b3b3 + 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 634e2fe0a46b..c6fee9f40828 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -143,14 +143,14 @@ 8.1.0-preview.23604.1 8.1.0-preview.23604.1 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 + 8.0.17 + 8.0.17 + 8.0.17 + 8.0.17 + 8.0.17 + 8.0.17 + 8.0.17 + 8.0.17 4.8.0-7.24574.2 4.8.0-7.24574.2 From 1bc29c1e83dcc91aff1e0e1c847c51152aaac73d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 8 May 2025 08:49:54 -0700 Subject: [PATCH 20/76] Update dependencies from https://github.com/dotnet/arcade build 20250430.1 (#61832) Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor From Version 8.0.0-beta.25208.7 -> To Version 8.0.0-beta.25230.1 Co-authored-by: dotnet-maestro[bot] --- NuGet.config | 12 - eng/Version.Details.xml | 20 +- eng/Versions.props | 6 +- .../templates-official/job/source-build.yml | 2 +- .../job/source-index-stage1.yml | 4 +- .../templates-official/jobs/source-build.yml | 2 +- .../templates-official/steps/source-build.yml | 2 +- eng/common/templates/job/source-build.yml | 4 +- .../templates/job/source-index-stage1.yml | 4 +- eng/common/templates/jobs/source-build.yml | 2 +- global.json | 4 +- .../build-configuration.json | 4 + .../eng/common/PSScriptAnalyzerSettings.psd1 | 11 + src/arcade/eng/common/README.md | 28 ++ .../eng/common/cross/arm/tizen/tizen.patch | 9 + .../eng/common/cross/armel/tizen/tizen.patch | 9 + .../eng/common/cross/x64/tizen/tizen.patch | 9 + .../eng/common/cross/x86/tizen/tizen.patch | 9 + src/arcade/eng/common/dotnet-install.cmd | 2 + src/arcade/eng/common/dotnet-install.ps1 | 28 ++ .../common/enable-cross-org-publishing.ps1 | 13 + src/arcade/eng/common/generate-locproject.ps1 | 189 +++++++++++++ src/arcade/eng/common/generate-sbom-prep.ps1 | 29 ++ src/arcade/eng/common/init-tools-native.ps1 | 203 ++++++++++++++ src/arcade/eng/common/init-tools-native.sh | 238 ++++++++++++++++ .../eng/common/internal-feed-operations.ps1 | 132 +++++++++ .../eng/common/internal-feed-operations.sh | 141 ++++++++++ src/arcade/eng/common/internal/NuGet.config | 7 + .../common/loc/P22DotNetHtmlLocalization.lss | 29 ++ src/arcade/eng/common/msbuild.ps1 | 28 ++ src/arcade/eng/common/msbuild.sh | 58 ++++ .../eng/common/native/common-library.sh | 172 ++++++++++++ .../eng/common/native/install-cmake-test.sh | 117 ++++++++ src/arcade/eng/common/native/install-cmake.sh | 117 ++++++++ src/arcade/eng/common/native/install-tool.ps1 | 132 +++++++++ .../eng/common/pipeline-logging-functions.ps1 | 260 ++++++++++++++++++ .../eng/common/pipeline-logging-functions.sh | 206 ++++++++++++++ src/arcade/eng/common/retain-build.ps1 | 45 +++ .../eng/common/sdl/configure-sdl-tool.ps1 | 130 +++++++++ .../common/sdl/extract-artifact-archives.ps1 | 63 +++++ .../common/sdl/extract-artifact-packages.ps1 | 82 ++++++ .../arcade/eng}/common/sdl/packages.config | 2 +- src/arcade/eng/common/sdl/run-sdl.ps1 | 49 ++++ .../variables/pool-providers.yml | 45 +++ .../variables/sdl-variables.yml | 7 + 45 files changed, 2627 insertions(+), 38 deletions(-) create mode 100644 src/arcade/eng/common/BuildConfiguration/build-configuration.json create mode 100644 src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 create mode 100644 src/arcade/eng/common/README.md create mode 100644 src/arcade/eng/common/cross/arm/tizen/tizen.patch create mode 100644 src/arcade/eng/common/cross/armel/tizen/tizen.patch create mode 100644 src/arcade/eng/common/cross/x64/tizen/tizen.patch create mode 100644 src/arcade/eng/common/cross/x86/tizen/tizen.patch create mode 100644 src/arcade/eng/common/dotnet-install.cmd create mode 100644 src/arcade/eng/common/dotnet-install.ps1 create mode 100644 src/arcade/eng/common/enable-cross-org-publishing.ps1 create mode 100644 src/arcade/eng/common/generate-locproject.ps1 create mode 100644 src/arcade/eng/common/generate-sbom-prep.ps1 create mode 100644 src/arcade/eng/common/init-tools-native.ps1 create mode 100644 src/arcade/eng/common/init-tools-native.sh create mode 100644 src/arcade/eng/common/internal-feed-operations.ps1 create mode 100644 src/arcade/eng/common/internal-feed-operations.sh create mode 100644 src/arcade/eng/common/internal/NuGet.config create mode 100644 src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss create mode 100644 src/arcade/eng/common/msbuild.ps1 create mode 100644 src/arcade/eng/common/msbuild.sh create mode 100644 src/arcade/eng/common/native/common-library.sh create mode 100644 src/arcade/eng/common/native/install-cmake-test.sh create mode 100644 src/arcade/eng/common/native/install-cmake.sh create mode 100644 src/arcade/eng/common/native/install-tool.ps1 create mode 100644 src/arcade/eng/common/pipeline-logging-functions.ps1 create mode 100644 src/arcade/eng/common/pipeline-logging-functions.sh create mode 100644 src/arcade/eng/common/retain-build.ps1 create mode 100644 src/arcade/eng/common/sdl/configure-sdl-tool.ps1 create mode 100644 src/arcade/eng/common/sdl/extract-artifact-archives.ps1 create mode 100644 src/arcade/eng/common/sdl/extract-artifact-packages.ps1 rename {eng => src/arcade/eng}/common/sdl/packages.config (51%) create mode 100644 src/arcade/eng/common/sdl/run-sdl.ps1 create mode 100644 src/arcade/eng/common/templates-official/variables/pool-providers.yml create mode 100644 src/arcade/eng/common/templates-official/variables/sdl-variables.yml diff --git a/NuGet.config b/NuGet.config index e2087a016db2..1c2f27eb90ce 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,14 +6,8 @@ - - - - - - @@ -34,14 +28,8 @@ - - - - - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ee11ee5e72e9..ebd02201a1bf 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -376,26 +376,26 @@ https://github.com/dotnet/winforms abda8e3bfa78319363526b5a5f86863ec979940e - + https://github.com/dotnet/arcade - c7a36e53f91e41943746f97a8c183549364c5092 + 4246a31e5de9de87f760218c4f588cebf4661f45 - + https://github.com/dotnet/arcade - c7a36e53f91e41943746f97a8c183549364c5092 + 4246a31e5de9de87f760218c4f588cebf4661f45 - + https://github.com/dotnet/arcade - c7a36e53f91e41943746f97a8c183549364c5092 + 4246a31e5de9de87f760218c4f588cebf4661f45 - + https://github.com/dotnet/arcade - c7a36e53f91e41943746f97a8c183549364c5092 + 4246a31e5de9de87f760218c4f588cebf4661f45 - + https://github.com/dotnet/arcade - c7a36e53f91e41943746f97a8c183549364c5092 + 4246a31e5de9de87f760218c4f588cebf4661f45 https://github.com/dotnet/extensions diff --git a/eng/Versions.props b/eng/Versions.props index 5619419190d2..1aa1d61db540 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -162,9 +162,9 @@ 6.2.4 6.2.4 - 8.0.0-beta.25208.7 - 8.0.0-beta.25208.7 - 8.0.0-beta.25208.7 + 8.0.0-beta.25230.1 + 8.0.0-beta.25230.1 + 8.0.0-beta.25230.1 8.0.0-alpha.1.25202.2 diff --git a/eng/common/templates-official/job/source-build.yml b/eng/common/templates-official/job/source-build.yml index f983033bb028..4217d6d8b148 100644 --- a/eng/common/templates-official/job/source-build.yml +++ b/eng/common/templates-official/job/source-build.yml @@ -54,7 +54,7 @@ jobs: pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore-Svc-Public' ), False, 'NetCore-Public')] - demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open + demands: ImageOverride -equals Build.Ubuntu.2204.Amd64.Open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore1ESPool-Svc-Internal'), False, 'NetCore1ESPool-Internal')] diff --git a/eng/common/templates-official/job/source-index-stage1.yml b/eng/common/templates-official/job/source-index-stage1.yml index 60dfb6b2d1c0..fb632b71a250 100644 --- a/eng/common/templates-official/job/source-index-stage1.yml +++ b/eng/common/templates-official/job/source-index-stage1.yml @@ -1,7 +1,7 @@ parameters: runAsPublic: false - sourceIndexUploadPackageVersion: 2.0.0-20240502.12 - sourceIndexProcessBinlogPackageVersion: 1.0.1-20240129.2 + sourceIndexUploadPackageVersion: 2.0.0-20250425.2 + sourceIndexProcessBinlogPackageVersion: 1.0.1-20250425.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/templates-official/jobs/source-build.yml b/eng/common/templates-official/jobs/source-build.yml index 5cf6a269c0b6..b9247be1547b 100644 --- a/eng/common/templates-official/jobs/source-build.yml +++ b/eng/common/templates-official/jobs/source-build.yml @@ -14,7 +14,7 @@ parameters: # This is the default platform provided by Arcade, intended for use by a managed-only repo. defaultManagedPlatform: name: 'Managed' - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8' + container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream-9-amd64' # Defines the platforms on which to run build jobs. One job is created for each platform, and the # object in this array is sent to the job template as 'platform'. If no platforms are specified, diff --git a/eng/common/templates-official/steps/source-build.yml b/eng/common/templates-official/steps/source-build.yml index 503164fa7f22..829f17c34d11 100644 --- a/eng/common/templates-official/steps/source-build.yml +++ b/eng/common/templates-official/steps/source-build.yml @@ -44,7 +44,7 @@ steps: # in the default public locations. internalRuntimeDownloadArgs= if [ '$(dotnetbuilds-internal-container-read-token-base64)' != '$''(dotnetbuilds-internal-container-read-token-base64)' ]; then - internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) --runtimesourcefeed https://ci.dot.net/internal --runtimesourcefeedkey $(dotnetbuilds-internal-container-read-token-base64)' + internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) --runtimesourcefeed https://dotnetbuilds.blob.core.windows.net/internal --runtimesourcefeedkey $(dotnetbuilds-internal-container-read-token-base64)' fi buildConfig=Release diff --git a/eng/common/templates/job/source-build.yml b/eng/common/templates/job/source-build.yml index c0ff472b697b..c48f95d93d91 100644 --- a/eng/common/templates/job/source-build.yml +++ b/eng/common/templates/job/source-build.yml @@ -54,11 +54,11 @@ jobs: pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore-Svc-Public' ), False, 'NetCore-Public')] - demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open + demands: ImageOverride -equals Build.Ubuntu.2204.Amd64.Open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore1ESPool-Svc-Internal'), False, 'NetCore1ESPool-Internal')] - demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 + demands: ImageOverride -equals Build.Ubuntu.2204.Amd64 ${{ if ne(parameters.platform.pool, '') }}: pool: ${{ parameters.platform.pool }} diff --git a/eng/common/templates/job/source-index-stage1.yml b/eng/common/templates/job/source-index-stage1.yml index 0b6bb89dc78a..8538f44bab28 100644 --- a/eng/common/templates/job/source-index-stage1.yml +++ b/eng/common/templates/job/source-index-stage1.yml @@ -1,7 +1,7 @@ parameters: runAsPublic: false - sourceIndexUploadPackageVersion: 2.0.0-20240502.12 - sourceIndexProcessBinlogPackageVersion: 1.0.1-20240129.2 + sourceIndexUploadPackageVersion: 2.0.0-20250425.2 + sourceIndexProcessBinlogPackageVersion: 1.0.1-20250425.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/templates/jobs/source-build.yml b/eng/common/templates/jobs/source-build.yml index 5f46bfa895c1..3ec997108107 100644 --- a/eng/common/templates/jobs/source-build.yml +++ b/eng/common/templates/jobs/source-build.yml @@ -14,7 +14,7 @@ parameters: # This is the default platform provided by Arcade, intended for use by a managed-only repo. defaultManagedPlatform: name: 'Managed' - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8' + container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream-9-amd64' # Defines the platforms on which to run build jobs. One job is created for each platform, and the # object in this array is sent to the job template as 'platform'. If no platforms are specified, diff --git a/global.json b/global.json index a7cd171707cd..2d7bd87b2e5f 100644 --- a/global.json +++ b/global.json @@ -25,8 +25,8 @@ }, "msbuild-sdks": { "Yarn.MSBuild": "1.22.19", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25208.7", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25208.7" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25230.1", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25230.1" }, "native-tools": { "jdk": "latest" diff --git a/src/arcade/eng/common/BuildConfiguration/build-configuration.json b/src/arcade/eng/common/BuildConfiguration/build-configuration.json new file mode 100644 index 000000000000..3d1cc89894c9 --- /dev/null +++ b/src/arcade/eng/common/BuildConfiguration/build-configuration.json @@ -0,0 +1,4 @@ +{ + "RetryCountLimit": 1, + "RetryByAnyError": false +} diff --git a/src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 b/src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 new file mode 100644 index 000000000000..4c1ea7c98ea4 --- /dev/null +++ b/src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 @@ -0,0 +1,11 @@ +@{ + IncludeRules=@('PSAvoidUsingCmdletAliases', + 'PSAvoidUsingWMICmdlet', + 'PSAvoidUsingPositionalParameters', + 'PSAvoidUsingInvokeExpression', + 'PSUseDeclaredVarsMoreThanAssignments', + 'PSUseCmdletCorrectly', + 'PSStandardDSCFunctionsInResource', + 'PSUseIdenticalMandatoryParametersForDSC', + 'PSUseIdenticalParametersForDSC') +} \ No newline at end of file diff --git a/src/arcade/eng/common/README.md b/src/arcade/eng/common/README.md new file mode 100644 index 000000000000..ff49c371527a --- /dev/null +++ b/src/arcade/eng/common/README.md @@ -0,0 +1,28 @@ +# Don't touch this folder + + uuuuuuuuuuuuuuuuuuuu + u" uuuuuuuuuuuuuuuuuu "u + u" u$$$$$$$$$$$$$$$$$$$$u "u + u" u$$$$$$$$$$$$$$$$$$$$$$$$u "u + u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u + u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u + u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u + $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ + $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ + $ $$$" ... "$... ...$" ... "$$$ ... "$$$ $ + $ $$$u `"$$$$$$$ $$$ $$$$$ $$ $$$ $$$ $ + $ $$$$$$uu "$$$$ $$$ $$$$$ $$ """ u$$$ $ + $ $$$""$$$ $$$$ $$$u "$$$" u$$ $$$$$$$$ $ + $ $$$$....,$$$$$..$$$$$....,$$$$..$$$$$$$$ $ + $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ + "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" + "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" + "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" + "u "$$$$$$$$$$$$$$$$$$$$$$$$" u" + "u "$$$$$$$$$$$$$$$$$$$$" u" + "u """""""""""""""""" u" + """""""""""""""""""" + +!!! Changes made in this directory are subject to being overwritten by automation !!! + +The files in this directory are shared by all Arcade repos and managed by automation. If you need to make changes to these files, open an issue or submit a pull request to https://github.com/dotnet/arcade first. diff --git a/src/arcade/eng/common/cross/arm/tizen/tizen.patch b/src/arcade/eng/common/cross/arm/tizen/tizen.patch new file mode 100644 index 000000000000..fb12ade7250a --- /dev/null +++ b/src/arcade/eng/common/cross/arm/tizen/tizen.patch @@ -0,0 +1,9 @@ +diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so +--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 ++++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf32-littlearm) +-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux-armhf.so.3 ) ) ++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-armhf.so.3 ) ) diff --git a/src/arcade/eng/common/cross/armel/tizen/tizen.patch b/src/arcade/eng/common/cross/armel/tizen/tizen.patch new file mode 100644 index 000000000000..ca7c7c1ff751 --- /dev/null +++ b/src/arcade/eng/common/cross/armel/tizen/tizen.patch @@ -0,0 +1,9 @@ +diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so +--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 ++++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf32-littlearm) +-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.3 ) ) ++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.3 ) ) diff --git a/src/arcade/eng/common/cross/x64/tizen/tizen.patch b/src/arcade/eng/common/cross/x64/tizen/tizen.patch new file mode 100644 index 000000000000..56fbc881095b --- /dev/null +++ b/src/arcade/eng/common/cross/x64/tizen/tizen.patch @@ -0,0 +1,9 @@ +diff -u -r a/usr/lib64/libc.so b/usr/lib64/libc.so +--- a/usr/lib64/libc.so 2016-12-30 23:00:08.284951863 +0900 ++++ b/usr/lib64/libc.so 2016-12-30 23:00:32.140951815 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf64-x86-64) +-GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) ) ++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-x86-64.so.2 ) ) diff --git a/src/arcade/eng/common/cross/x86/tizen/tizen.patch b/src/arcade/eng/common/cross/x86/tizen/tizen.patch new file mode 100644 index 000000000000..f4fe8838ad66 --- /dev/null +++ b/src/arcade/eng/common/cross/x86/tizen/tizen.patch @@ -0,0 +1,9 @@ +diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so +--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 ++++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf32-i386) +-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.2 ) ) ++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.2 ) ) diff --git a/src/arcade/eng/common/dotnet-install.cmd b/src/arcade/eng/common/dotnet-install.cmd new file mode 100644 index 000000000000..b1c2642e76f7 --- /dev/null +++ b/src/arcade/eng/common/dotnet-install.cmd @@ -0,0 +1,2 @@ +@echo off +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0dotnet-install.ps1""" %*" \ No newline at end of file diff --git a/src/arcade/eng/common/dotnet-install.ps1 b/src/arcade/eng/common/dotnet-install.ps1 new file mode 100644 index 000000000000..811f0f717f73 --- /dev/null +++ b/src/arcade/eng/common/dotnet-install.ps1 @@ -0,0 +1,28 @@ +[CmdletBinding(PositionalBinding=$false)] +Param( + [string] $verbosity = 'minimal', + [string] $architecture = '', + [string] $version = 'Latest', + [string] $runtime = 'dotnet', + [string] $RuntimeSourceFeed = '', + [string] $RuntimeSourceFeedKey = '' +) + +. $PSScriptRoot\tools.ps1 + +$dotnetRoot = Join-Path $RepoRoot '.dotnet' + +$installdir = $dotnetRoot +try { + if ($architecture -and $architecture.Trim() -eq 'x86') { + $installdir = Join-Path $installdir 'x86' + } + InstallDotNet $installdir $version $architecture $runtime $true -RuntimeSourceFeed $RuntimeSourceFeed -RuntimeSourceFeedKey $RuntimeSourceFeedKey +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_ + ExitWithExitCode 1 +} + +ExitWithExitCode 0 diff --git a/src/arcade/eng/common/enable-cross-org-publishing.ps1 b/src/arcade/eng/common/enable-cross-org-publishing.ps1 new file mode 100644 index 000000000000..da09da4f1fc4 --- /dev/null +++ b/src/arcade/eng/common/enable-cross-org-publishing.ps1 @@ -0,0 +1,13 @@ +param( + [string] $token +) + + +. $PSScriptRoot\pipeline-logging-functions.ps1 + +# Write-PipelineSetVariable will no-op if a variable named $ci is not defined +# Since this script is only ever called in AzDO builds, just universally set it +$ci = $true + +Write-PipelineSetVariable -Name 'VSS_NUGET_ACCESSTOKEN' -Value $token -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'VSS_NUGET_URI_PREFIXES' -Value 'https://dnceng.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/dnceng/;https://devdiv.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/devdiv/' -IsMultiJobVariable $false diff --git a/src/arcade/eng/common/generate-locproject.ps1 b/src/arcade/eng/common/generate-locproject.ps1 new file mode 100644 index 000000000000..524aaa57f2b7 --- /dev/null +++ b/src/arcade/eng/common/generate-locproject.ps1 @@ -0,0 +1,189 @@ +Param( + [Parameter(Mandatory=$true)][string] $SourcesDirectory, # Directory where source files live; if using a Localize directory it should live in here + [string] $LanguageSet = 'VS_Main_Languages', # Language set to be used in the LocProject.json + [switch] $UseCheckedInLocProjectJson, # When set, generates a LocProject.json and compares it to one that already exists in the repo; otherwise just generates one + [switch] $CreateNeutralXlfs # Creates neutral xlf files. Only set to false when running locally +) + +# Generates LocProject.json files for the OneLocBuild task. OneLocBuildTask is described here: +# https://ceapex.visualstudio.com/CEINTL/_wiki/wikis/CEINTL.wiki/107/Localization-with-OneLocBuild-Task + +Set-StrictMode -Version 2.0 +$ErrorActionPreference = "Stop" +. $PSScriptRoot\pipeline-logging-functions.ps1 + +$exclusionsFilePath = "$SourcesDirectory\eng\Localize\LocExclusions.json" +$exclusions = @{ Exclusions = @() } +if (Test-Path -Path $exclusionsFilePath) +{ + $exclusions = Get-Content "$exclusionsFilePath" | ConvertFrom-Json +} + +Push-Location "$SourcesDirectory" # push location for Resolve-Path -Relative to work + +# Template files +$jsonFiles = @() +$jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern +$jsonTemplateFiles | ForEach-Object { + $null = $_.Name -Match "(.+)\.[\w-]+\.json" # matches '[filename].[langcode].json + + $destinationFile = "$($_.Directory.FullName)\$($Matches.1).json" + $jsonFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru +} + +$jsonWinformsTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern + +$wxlFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\\.+\.wxl" -And -Not( $_.Directory.Name -Match "\d{4}" ) } # localized files live in four digit lang ID directories; this excludes them +if (-not $wxlFiles) { + $wxlEnFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\\1033\\.+\.wxl" } # pick up en files (1033 = en) specifically so we can copy them to use as the neutral xlf files + if ($wxlEnFiles) { + $wxlFiles = @() + $wxlEnFiles | ForEach-Object { + $destinationFile = "$($_.Directory.Parent.FullName)\$($_.Name)" + $wxlFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru + } + } +} + +$macosHtmlEnFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\.lproj\\.+\.html$" } # add installer HTML files +$macosHtmlFiles = @() +if ($macosHtmlEnFiles) { + $macosHtmlEnFiles | ForEach-Object { + $destinationFile = "$($_.Directory.Parent.FullName)\$($_.Name)" + $macosHtmlFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru + } +} + +$xlfFiles = @() + +$allXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.xlf" +$langXlfFiles = @() +if ($allXlfFiles) { + $null = $allXlfFiles[0].FullName -Match "\.([\w-]+)\.xlf" # matches '[langcode].xlf' + $firstLangCode = $Matches.1 + $langXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.$firstLangCode.xlf" +} +$langXlfFiles | ForEach-Object { + $null = $_.Name -Match "(.+)\.[\w-]+\.xlf" # matches '[filename].[langcode].xlf + + $destinationFile = "$($_.Directory.FullName)\$($Matches.1).xlf" + $xlfFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru +} + +$locFiles = $jsonFiles + $jsonWinformsTemplateFiles + $xlfFiles + +$locJson = @{ + Projects = @( + @{ + LanguageSet = $LanguageSet + LocItems = @( + $locFiles | ForEach-Object { + $outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")" + $continue = $true + foreach ($exclusion in $exclusions.Exclusions) { + if ($_.FullName.Contains($exclusion)) + { + $continue = $false + } + } + $sourceFile = ($_.FullName | Resolve-Path -Relative) + if (!$CreateNeutralXlfs -and $_.Extension -eq '.xlf') { + Remove-Item -Path $sourceFile + } + if ($continue) + { + if ($_.Directory.Name -eq 'en' -and $_.Extension -eq '.json') { + return @{ + SourceFile = $sourceFile + CopyOption = "LangIDOnPath" + OutputPath = "$($_.Directory.Parent.FullName | Resolve-Path -Relative)\" + } + } else { + return @{ + SourceFile = $sourceFile + CopyOption = "LangIDOnName" + OutputPath = $outputPath + } + } + } + } + ) + }, + @{ + LanguageSet = $LanguageSet + CloneLanguageSet = "WiX_CloneLanguages" + LssFiles = @( "wxl_loc.lss" ) + LocItems = @( + $wxlFiles | ForEach-Object { + $outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\" + $continue = $true + foreach ($exclusion in $exclusions.Exclusions) { + if ($_.FullName.Contains($exclusion)) { + $continue = $false + } + } + $sourceFile = ($_.FullName | Resolve-Path -Relative) + if ($continue) + { + return @{ + SourceFile = $sourceFile + CopyOption = "LangIDOnPath" + OutputPath = $outputPath + } + } + } + ) + }, + @{ + LanguageSet = $LanguageSet + CloneLanguageSet = "VS_macOS_CloneLanguages" + LssFiles = @( ".\eng\common\loc\P22DotNetHtmlLocalization.lss" ) + LocItems = @( + $macosHtmlFiles | ForEach-Object { + $outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\" + $continue = $true + foreach ($exclusion in $exclusions.Exclusions) { + if ($_.FullName.Contains($exclusion)) { + $continue = $false + } + } + $sourceFile = ($_.FullName | Resolve-Path -Relative) + $lciFile = $sourceFile + ".lci" + if ($continue) { + $result = @{ + SourceFile = $sourceFile + CopyOption = "LangIDOnPath" + OutputPath = $outputPath + } + if (Test-Path $lciFile -PathType Leaf) { + $result["LciFile"] = $lciFile + } + return $result + } + } + ) + } + ) +} + +$json = ConvertTo-Json $locJson -Depth 5 +Write-Host "LocProject.json generated:`n`n$json`n`n" +Pop-Location + +if (!$UseCheckedInLocProjectJson) { + New-Item "$SourcesDirectory\eng\Localize\LocProject.json" -Force # Need this to make sure the Localize directory is created + Set-Content "$SourcesDirectory\eng\Localize\LocProject.json" $json +} +else { + New-Item "$SourcesDirectory\eng\Localize\LocProject-generated.json" -Force # Need this to make sure the Localize directory is created + Set-Content "$SourcesDirectory\eng\Localize\LocProject-generated.json" $json + + if ((Get-FileHash "$SourcesDirectory\eng\Localize\LocProject-generated.json").Hash -ne (Get-FileHash "$SourcesDirectory\eng\Localize\LocProject.json").Hash) { + Write-PipelineTelemetryError -Category "OneLocBuild" -Message "Existing LocProject.json differs from generated LocProject.json. Download LocProject-generated.json and compare them." + + exit 1 + } + else { + Write-Host "Generated LocProject.json and current LocProject.json are identical." + } +} diff --git a/src/arcade/eng/common/generate-sbom-prep.ps1 b/src/arcade/eng/common/generate-sbom-prep.ps1 new file mode 100644 index 000000000000..a0c7d792a76f --- /dev/null +++ b/src/arcade/eng/common/generate-sbom-prep.ps1 @@ -0,0 +1,29 @@ +Param( + [Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed +) + +. $PSScriptRoot\pipeline-logging-functions.ps1 + +# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly +# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. +$ArtifactName = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" +$SafeArtifactName = $ArtifactName -replace '["/:<>\\|?@*"() ]', '_' +$SbomGenerationDir = Join-Path $ManifestDirPath $SafeArtifactName + +Write-Host "Artifact name before : $ArtifactName" +Write-Host "Artifact name after : $SafeArtifactName" + +Write-Host "Creating dir $ManifestDirPath" + +# create directory for sbom manifest to be placed +if (!(Test-Path -path $SbomGenerationDir)) +{ + New-Item -ItemType Directory -path $SbomGenerationDir + Write-Host "Successfully created directory $SbomGenerationDir" +} +else{ + Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." +} + +Write-Host "Updating artifact name" +Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$SafeArtifactName" diff --git a/src/arcade/eng/common/init-tools-native.ps1 b/src/arcade/eng/common/init-tools-native.ps1 new file mode 100644 index 000000000000..27ccdb9ecc95 --- /dev/null +++ b/src/arcade/eng/common/init-tools-native.ps1 @@ -0,0 +1,203 @@ +<# +.SYNOPSIS +Entry point script for installing native tools + +.DESCRIPTION +Reads $RepoRoot\global.json file to determine native assets to install +and executes installers for those tools + +.PARAMETER BaseUri +Base file directory or Url from which to acquire tool archives + +.PARAMETER InstallDirectory +Directory to install native toolset. This is a command-line override for the default +Install directory precedence order: +- InstallDirectory command-line override +- NETCOREENG_INSTALL_DIRECTORY environment variable +- (default) %USERPROFILE%/.netcoreeng/native + +.PARAMETER Clean +Switch specifying to not install anything, but cleanup native asset folders + +.PARAMETER Force +Clean and then install tools + +.PARAMETER DownloadRetries +Total number of retry attempts + +.PARAMETER RetryWaitTimeInSeconds +Wait time between retry attempts in seconds + +.PARAMETER GlobalJsonFile +File path to global.json file + +.PARAMETER PathPromotion +Optional switch to enable either promote native tools specified in the global.json to the path (in Azure Pipelines) +or break the build if a native tool is not found on the path (on a local dev machine) + +.NOTES +#> +[CmdletBinding(PositionalBinding=$false)] +Param ( + [string] $BaseUri = 'https://netcorenativeassets.blob.core.windows.net/resource-packages/external', + [string] $InstallDirectory, + [switch] $Clean = $False, + [switch] $Force = $False, + [int] $DownloadRetries = 5, + [int] $RetryWaitTimeInSeconds = 30, + [string] $GlobalJsonFile, + [switch] $PathPromotion +) + +if (!$GlobalJsonFile) { + $GlobalJsonFile = Join-Path (Get-Item $PSScriptRoot).Parent.Parent.FullName 'global.json' +} + +Set-StrictMode -version 2.0 +$ErrorActionPreference='Stop' + +. $PSScriptRoot\pipeline-logging-functions.ps1 +Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1') + +try { + # Define verbose switch if undefined + $Verbose = $VerbosePreference -Eq 'Continue' + + $EngCommonBaseDir = Join-Path $PSScriptRoot 'native\' + $NativeBaseDir = $InstallDirectory + if (!$NativeBaseDir) { + $NativeBaseDir = CommonLibrary\Get-NativeInstallDirectory + } + $Env:CommonLibrary_NativeInstallDir = $NativeBaseDir + $InstallBin = Join-Path $NativeBaseDir 'bin' + $InstallerPath = Join-Path $EngCommonBaseDir 'install-tool.ps1' + + # Process tools list + Write-Host "Processing $GlobalJsonFile" + If (-Not (Test-Path $GlobalJsonFile)) { + Write-Host "Unable to find '$GlobalJsonFile'" + exit 0 + } + $NativeTools = Get-Content($GlobalJsonFile) -Raw | + ConvertFrom-Json | + Select-Object -Expand 'native-tools' -ErrorAction SilentlyContinue + if ($NativeTools) { + if ($PathPromotion -eq $True) { + $ArcadeToolsDirectory = "$env:SYSTEMDRIVE\arcade-tools" + if (Test-Path $ArcadeToolsDirectory) { # if this directory exists, we should use native tools on machine + $NativeTools.PSObject.Properties | ForEach-Object { + $ToolName = $_.Name + $ToolVersion = $_.Value + $InstalledTools = @{} + + if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) { + if ($ToolVersion -eq "latest") { + $ToolVersion = "" + } + $ToolDirectories = (Get-ChildItem -Path "$ArcadeToolsDirectory" -Filter "$ToolName-$ToolVersion*" | Sort-Object -Descending) + if ($ToolDirectories -eq $null) { + Write-Error "Unable to find directory for $ToolName $ToolVersion; please make sure the tool is installed on this image." + exit 1 + } + $ToolDirectory = $ToolDirectories[0] + $BinPathFile = "$($ToolDirectory.FullName)\binpath.txt" + if (-not (Test-Path -Path "$BinPathFile")) { + Write-Error "Unable to find binpath.txt in '$($ToolDirectory.FullName)' ($ToolName $ToolVersion); artifact is either installed incorrectly or is not a bootstrappable tool." + exit 1 + } + $BinPath = Get-Content "$BinPathFile" + $ToolPath = Convert-Path -Path $BinPath + Write-Host "Adding $ToolName to the path ($ToolPath)..." + Write-Host "##vso[task.prependpath]$ToolPath" + $env:PATH = "$ToolPath;$env:PATH" + $InstalledTools += @{ $ToolName = $ToolDirectory.FullName } + } + } + return $InstalledTools + } else { + $NativeTools.PSObject.Properties | ForEach-Object { + $ToolName = $_.Name + $ToolVersion = $_.Value + + if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) { + Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message "$ToolName not found on path. Please install $ToolName $ToolVersion before proceeding." + Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message "If this is running on a build machine, the arcade-tools directory was not found, which means there's an error with the image." + } + } + exit 0 + } + } else { + $NativeTools.PSObject.Properties | ForEach-Object { + $ToolName = $_.Name + $ToolVersion = $_.Value + $LocalInstallerArguments = @{ ToolName = "$ToolName" } + $LocalInstallerArguments += @{ InstallPath = "$InstallBin" } + $LocalInstallerArguments += @{ BaseUri = "$BaseUri" } + $LocalInstallerArguments += @{ CommonLibraryDirectory = "$EngCommonBaseDir" } + $LocalInstallerArguments += @{ Version = "$ToolVersion" } + + if ($Verbose) { + $LocalInstallerArguments += @{ Verbose = $True } + } + if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') { + if($Force) { + $LocalInstallerArguments += @{ Force = $True } + } + } + if ($Clean) { + $LocalInstallerArguments += @{ Clean = $True } + } + + Write-Verbose "Installing $ToolName version $ToolVersion" + Write-Verbose "Executing '$InstallerPath $($LocalInstallerArguments.Keys.ForEach({"-$_ '$($LocalInstallerArguments.$_)'"}) -join ' ')'" + & $InstallerPath @LocalInstallerArguments + if ($LASTEXITCODE -Ne "0") { + $errMsg = "$ToolName installation failed" + if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) { + $showNativeToolsWarning = $true + if ((Get-Variable 'DoNotDisplayNativeToolsInstallationWarnings' -ErrorAction 'SilentlyContinue') -and $DoNotDisplayNativeToolsInstallationWarnings) { + $showNativeToolsWarning = $false + } + if ($showNativeToolsWarning) { + Write-Warning $errMsg + } + $toolInstallationFailure = $true + } else { + # We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482 + Write-Host $errMsg + exit 1 + } + } + } + + if ((Get-Variable 'toolInstallationFailure' -ErrorAction 'SilentlyContinue') -and $toolInstallationFailure) { + # We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482 + Write-Host 'Native tools bootstrap failed' + exit 1 + } + } + } + else { + Write-Host 'No native tools defined in global.json' + exit 0 + } + + if ($Clean) { + exit 0 + } + if (Test-Path $InstallBin) { + Write-Host 'Native tools are available from ' (Convert-Path -Path $InstallBin) + Write-Host "##vso[task.prependpath]$(Convert-Path -Path $InstallBin)" + return $InstallBin + } + elseif (-not ($PathPromotion)) { + Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message 'Native tools install directory does not exist, installation failed' + exit 1 + } + exit 0 +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/init-tools-native.sh b/src/arcade/eng/common/init-tools-native.sh new file mode 100644 index 000000000000..3e6a8d6acf2f --- /dev/null +++ b/src/arcade/eng/common/init-tools-native.sh @@ -0,0 +1,238 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +base_uri='https://netcorenativeassets.blob.core.windows.net/resource-packages/external' +install_directory='' +clean=false +force=false +download_retries=5 +retry_wait_time_seconds=30 +global_json_file="$(dirname "$(dirname "${scriptroot}")")/global.json" +declare -a native_assets + +. $scriptroot/pipeline-logging-functions.sh +. $scriptroot/native/common-library.sh + +while (($# > 0)); do + lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" + case $lowerI in + --baseuri) + base_uri=$2 + shift 2 + ;; + --installdirectory) + install_directory=$2 + shift 2 + ;; + --clean) + clean=true + shift 1 + ;; + --force) + force=true + shift 1 + ;; + --donotabortonfailure) + donotabortonfailure=true + shift 1 + ;; + --donotdisplaywarnings) + donotdisplaywarnings=true + shift 1 + ;; + --downloadretries) + download_retries=$2 + shift 2 + ;; + --retrywaittimeseconds) + retry_wait_time_seconds=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --installdirectory Directory to install native toolset." + echo " This is a command-line override for the default" + echo " Install directory precedence order:" + echo " - InstallDirectory command-line override" + echo " - NETCOREENG_INSTALL_DIRECTORY environment variable" + echo " - (default) %USERPROFILE%/.netcoreeng/native" + echo "" + echo " --clean Switch specifying not to install anything, but cleanup native asset folders" + echo " --donotabortonfailure Switch specifiying whether to abort native tools installation on failure" + echo " --donotdisplaywarnings Switch specifiying whether to display warnings during native tools installation on failure" + echo " --force Clean and then install tools" + echo " --help Print help and exit" + echo "" + echo "Advanced settings:" + echo " --baseuri Base URI for where to download native tools from" + echo " --downloadretries Number of times a download should be attempted" + echo " --retrywaittimeseconds Wait time between download attempts" + echo "" + exit 0 + ;; + esac +done + +function ReadGlobalJsonNativeTools { + # happy path: we have a proper JSON parsing tool `jq(1)` in PATH! + if command -v jq &> /dev/null; then + + # jq: read each key/value pair under "native-tools" entry and emit: + # KEY="" VALUE="" + # followed by a null byte. + # + # bash: read line with null byte delimeter and push to array (for later `eval`uation). + + while IFS= read -rd '' line; do + native_assets+=("$line") + done < <(jq -r '. | + select(has("native-tools")) | + ."native-tools" | + keys[] as $k | + @sh "KEY=\($k) VALUE=\(.[$k])\u0000"' "$global_json_file") + + return + fi + + # Warning: falling back to manually parsing JSON, which is not recommended. + + # Following routine matches the output and escaping logic of jq(1)'s @sh formatter used above. + # It has been tested with several weird strings with escaped characters in entries (key and value) + # and results were compared with the output of jq(1) in binary representation using xxd(1); + # just before the assignment to 'native_assets' array (above and below). + + # try to capture the section under "native-tools". + if [[ ! "$(cat "$global_json_file")" =~ \"native-tools\"[[:space:]\:\{]*([^\}]+) ]]; then + return + fi + + section="${BASH_REMATCH[1]}" + + parseStarted=0 + possibleEnd=0 + escaping=0 + escaped=0 + isKey=1 + + for (( i=0; i<${#section}; i++ )); do + char="${section:$i:1}" + if ! ((parseStarted)) && [[ "$char" =~ [[:space:],:] ]]; then continue; fi + + if ! ((escaping)) && [[ "$char" == "\\" ]]; then + escaping=1 + elif ((escaping)) && ! ((escaped)); then + escaped=1 + fi + + if ! ((parseStarted)) && [[ "$char" == "\"" ]]; then + parseStarted=1 + possibleEnd=0 + elif [[ "$char" == "'" ]]; then + token="$token'\\\''" + possibleEnd=0 + elif ((escaping)) || [[ "$char" != "\"" ]]; then + token="$token$char" + possibleEnd=1 + fi + + if ((possibleEnd)) && ! ((escaping)) && [[ "$char" == "\"" ]]; then + # Use printf to unescape token to match jq(1)'s @sh formatting rules. + # do not use 'token="$(printf "$token")"' syntax, as $() eats the trailing linefeed. + printf -v token "'$token'" + + if ((isKey)); then + KEY="$token" + isKey=0 + else + line="KEY=$KEY VALUE=$token" + native_assets+=("$line") + isKey=1 + fi + + # reset for next token + parseStarted=0 + token= + elif ((escaping)) && ((escaped)); then + escaping=0 + escaped=0 + fi + done +} + +native_base_dir=$install_directory +if [[ -z $install_directory ]]; then + native_base_dir=$(GetNativeInstallDirectory) +fi + +install_bin="${native_base_dir}/bin" +installed_any=false + +ReadGlobalJsonNativeTools + +if [[ ${#native_assets[@]} -eq 0 ]]; then + echo "No native tools defined in global.json" + exit 0; +else + native_installer_dir="$scriptroot/native" + for index in "${!native_assets[@]}"; do + eval "${native_assets["$index"]}" + + installer_path="$native_installer_dir/install-$KEY.sh" + installer_command="$installer_path" + installer_command+=" --baseuri $base_uri" + installer_command+=" --installpath $install_bin" + installer_command+=" --version $VALUE" + echo $installer_command + + if [[ $force = true ]]; then + installer_command+=" --force" + fi + + if [[ $clean = true ]]; then + installer_command+=" --clean" + fi + + if [[ -a $installer_path ]]; then + $installer_command + if [[ $? != 0 ]]; then + if [[ $donotabortonfailure = true ]]; then + if [[ $donotdisplaywarnings != true ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" + fi + else + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" + exit 1 + fi + else + $installed_any = true + fi + else + if [[ $donotabortonfailure == true ]]; then + if [[ $donotdisplaywarnings != true ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script" + fi + else + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script" + exit 1 + fi + fi + done +fi + +if [[ $clean = true ]]; then + exit 0 +fi + +if [[ -d $install_bin ]]; then + echo "Native tools are available from $install_bin" + echo "##vso[task.prependpath]$install_bin" +else + if [[ $installed_any = true ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Native tools install directory does not exist, installation failed" + exit 1 + fi +fi + +exit 0 diff --git a/src/arcade/eng/common/internal-feed-operations.ps1 b/src/arcade/eng/common/internal-feed-operations.ps1 new file mode 100644 index 000000000000..92b77347d990 --- /dev/null +++ b/src/arcade/eng/common/internal-feed-operations.ps1 @@ -0,0 +1,132 @@ +param( + [Parameter(Mandatory=$true)][string] $Operation, + [string] $AuthToken, + [string] $CommitSha, + [string] $RepoName, + [switch] $IsFeedPrivate +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 +. $PSScriptRoot\tools.ps1 + +# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed +# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in +# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. This should ONLY be called from identified +# internal builds +function SetupCredProvider { + param( + [string] $AuthToken + ) + + # Install the Cred Provider NuGet plugin + Write-Host 'Setting up Cred Provider NuGet plugin in the agent...' + Write-Host "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..." + + $url = 'https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1' + + Write-Host "Writing the contents of 'installcredprovider.ps1' locally..." + Invoke-WebRequest $url -OutFile installcredprovider.ps1 + + Write-Host 'Installing plugin...' + .\installcredprovider.ps1 -Force + + Write-Host "Deleting local copy of 'installcredprovider.ps1'..." + Remove-Item .\installcredprovider.ps1 + + if (-Not("$env:USERPROFILE\.nuget\plugins\netcore")) { + Write-PipelineTelemetryError -Category 'Arcade' -Message 'CredProvider plugin was not installed correctly!' + ExitWithExitCode 1 + } + else { + Write-Host 'CredProvider plugin was installed correctly!' + } + + # Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable + # feeds successfully + + $nugetConfigPath = Join-Path $RepoRoot "NuGet.config" + + if (-Not (Test-Path -Path $nugetConfigPath)) { + Write-PipelineTelemetryError -Category 'Build' -Message 'NuGet.config file not found in repo root!' + ExitWithExitCode 1 + } + + $endpoints = New-Object System.Collections.ArrayList + $nugetConfigPackageSources = Select-Xml -Path $nugetConfigPath -XPath "//packageSources/add[contains(@key, 'darc-int-')]/@value" | foreach{$_.Node.Value} + + if (($nugetConfigPackageSources | Measure-Object).Count -gt 0 ) { + foreach ($stableRestoreResource in $nugetConfigPackageSources) { + $trimmedResource = ([string]$stableRestoreResource).Trim() + [void]$endpoints.Add(@{endpoint="$trimmedResource"; password="$AuthToken"}) + } + } + + if (($endpoints | Measure-Object).Count -gt 0) { + $endpointCredentials = @{endpointCredentials=$endpoints} | ConvertTo-Json -Compress + + # Create the environment variables the AzDo way + Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $endpointCredentials -Properties @{ + 'variable' = 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' + 'issecret' = 'false' + } + + # We don't want sessions cached since we will be updating the endpoints quite frequently + Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data 'False' -Properties @{ + 'variable' = 'NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED' + 'issecret' = 'false' + } + } + else + { + Write-Host 'No internal endpoints found in NuGet.config' + } +} + +#Workaround for https://github.com/microsoft/msbuild/issues/4430 +function InstallDotNetSdkAndRestoreArcade { + $dotnetTempDir = Join-Path $RepoRoot "dotnet" + $dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*) + $dotnet = "$dotnetTempDir\dotnet.exe" + $restoreProjPath = "$PSScriptRoot\restore.proj" + + Write-Host "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..." + InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion" + + '' | Out-File "$restoreProjPath" + + & $dotnet restore $restoreProjPath + + Write-Host 'Arcade SDK restored!' + + if (Test-Path -Path $restoreProjPath) { + Remove-Item $restoreProjPath + } + + if (Test-Path -Path $dotnetTempDir) { + Remove-Item $dotnetTempDir -Recurse + } +} + +try { + Push-Location $PSScriptRoot + + if ($Operation -like 'setup') { + SetupCredProvider $AuthToken + } + elseif ($Operation -like 'install-restore') { + InstallDotNetSdkAndRestoreArcade + } + else { + Write-PipelineTelemetryError -Category 'Arcade' -Message "Unknown operation '$Operation'!" + ExitWithExitCode 1 + } +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category 'Arcade' -Message $_ + ExitWithExitCode 1 +} +finally { + Pop-Location +} diff --git a/src/arcade/eng/common/internal-feed-operations.sh b/src/arcade/eng/common/internal-feed-operations.sh new file mode 100644 index 000000000000..9378223ba095 --- /dev/null +++ b/src/arcade/eng/common/internal-feed-operations.sh @@ -0,0 +1,141 @@ +#!/usr/bin/env bash + +set -e + +# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed +# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in +# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. +# This should ONLY be called from identified internal builds +function SetupCredProvider { + local authToken=$1 + + # Install the Cred Provider NuGet plugin + echo "Setting up Cred Provider NuGet plugin in the agent..."... + echo "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..." + + local url="https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh" + + echo "Writing the contents of 'installcredprovider.ps1' locally..." + local installcredproviderPath="installcredprovider.sh" + if command -v curl > /dev/null; then + curl $url > "$installcredproviderPath" + else + wget -q -O "$installcredproviderPath" "$url" + fi + + echo "Installing plugin..." + . "$installcredproviderPath" + + echo "Deleting local copy of 'installcredprovider.sh'..." + rm installcredprovider.sh + + if [ ! -d "$HOME/.nuget/plugins" ]; then + Write-PipelineTelemetryError -category 'Build' 'CredProvider plugin was not installed correctly!' + ExitWithExitCode 1 + else + echo "CredProvider plugin was installed correctly!" + fi + + # Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable + # feeds successfully + + local nugetConfigPath="{$repo_root}NuGet.config" + + if [ ! "$nugetConfigPath" ]; then + Write-PipelineTelemetryError -category 'Build' "NuGet.config file not found in repo's root!" + ExitWithExitCode 1 + fi + + local endpoints='[' + local nugetConfigPackageValues=`cat "$nugetConfigPath" | grep "key=\"darc-int-"` + local pattern="value=\"(.*)\"" + + for value in $nugetConfigPackageValues + do + if [[ $value =~ $pattern ]]; then + local endpoint="${BASH_REMATCH[1]}" + endpoints+="{\"endpoint\": \"$endpoint\", \"password\": \"$authToken\"}," + fi + done + + endpoints=${endpoints%?} + endpoints+=']' + + if [ ${#endpoints} -gt 2 ]; then + local endpointCredentials="{\"endpointCredentials\": "$endpoints"}" + + echo "##vso[task.setvariable variable=VSS_NUGET_EXTERNAL_FEED_ENDPOINTS]$endpointCredentials" + echo "##vso[task.setvariable variable=NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED]False" + else + echo "No internal endpoints found in NuGet.config" + fi +} + +# Workaround for https://github.com/microsoft/msbuild/issues/4430 +function InstallDotNetSdkAndRestoreArcade { + local dotnetTempDir="$repo_root/dotnet" + local dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*) + local restoreProjPath="$repo_root/eng/common/restore.proj" + + echo "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..." + echo "" > "$restoreProjPath" + + InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion" + + local res=`$dotnetTempDir/dotnet restore $restoreProjPath` + echo "Arcade SDK restored!" + + # Cleanup + if [ "$restoreProjPath" ]; then + rm "$restoreProjPath" + fi + + if [ "$dotnetTempDir" ]; then + rm -r $dotnetTempDir + fi +} + +source="${BASH_SOURCE[0]}" +operation='' +authToken='' +repoName='' + +while [[ $# > 0 ]]; do + opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + --operation) + operation=$2 + shift + ;; + --authtoken) + authToken=$2 + shift + ;; + *) + echo "Invalid argument: $1" + usage + exit 1 + ;; + esac + + shift +done + +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. "$scriptroot/tools.sh" + +if [ "$operation" = "setup" ]; then + SetupCredProvider $authToken +elif [ "$operation" = "install-restore" ]; then + InstallDotNetSdkAndRestoreArcade +else + echo "Unknown operation '$operation'!" +fi diff --git a/src/arcade/eng/common/internal/NuGet.config b/src/arcade/eng/common/internal/NuGet.config new file mode 100644 index 000000000000..19d3d311b166 --- /dev/null +++ b/src/arcade/eng/common/internal/NuGet.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss b/src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss new file mode 100644 index 000000000000..5d892d619398 --- /dev/null +++ b/src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/arcade/eng/common/msbuild.ps1 b/src/arcade/eng/common/msbuild.ps1 new file mode 100644 index 000000000000..f041e5ddd958 --- /dev/null +++ b/src/arcade/eng/common/msbuild.ps1 @@ -0,0 +1,28 @@ +[CmdletBinding(PositionalBinding=$false)] +Param( + [string] $verbosity = 'minimal', + [bool] $warnAsError = $true, + [bool] $nodeReuse = $true, + [switch] $ci, + [switch] $prepareMachine, + [switch] $excludePrereleaseVS, + [string] $msbuildEngine = $null, + [Parameter(ValueFromRemainingArguments=$true)][String[]]$extraArgs +) + +. $PSScriptRoot\tools.ps1 + +try { + if ($ci) { + $nodeReuse = $false + } + + MSBuild @extraArgs +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category 'Build' -Message $_ + ExitWithExitCode 1 +} + +ExitWithExitCode 0 \ No newline at end of file diff --git a/src/arcade/eng/common/msbuild.sh b/src/arcade/eng/common/msbuild.sh new file mode 100644 index 000000000000..20d3dad54352 --- /dev/null +++ b/src/arcade/eng/common/msbuild.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" + +# resolve $source until the file is no longer a symlink +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +verbosity='minimal' +warn_as_error=true +node_reuse=true +prepare_machine=false +extra_args='' + +while (($# > 0)); do + lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" + case $lowerI in + --verbosity) + verbosity=$2 + shift 2 + ;; + --warnaserror) + warn_as_error=$2 + shift 2 + ;; + --nodereuse) + node_reuse=$2 + shift 2 + ;; + --ci) + ci=true + shift 1 + ;; + --preparemachine) + prepare_machine=true + shift 1 + ;; + *) + extra_args="$extra_args $1" + shift 1 + ;; + esac +done + +. "$scriptroot/tools.sh" + +if [[ "$ci" == true ]]; then + node_reuse=false +fi + +MSBuild $extra_args +ExitWithExitCode 0 diff --git a/src/arcade/eng/common/native/common-library.sh b/src/arcade/eng/common/native/common-library.sh new file mode 100644 index 000000000000..080c2c283ae4 --- /dev/null +++ b/src/arcade/eng/common/native/common-library.sh @@ -0,0 +1,172 @@ +#!/usr/bin/env bash + +function GetNativeInstallDirectory { + local install_dir + + if [[ -z $NETCOREENG_INSTALL_DIRECTORY ]]; then + install_dir=$HOME/.netcoreeng/native/ + else + install_dir=$NETCOREENG_INSTALL_DIRECTORY + fi + + echo $install_dir + return 0 +} + +function GetTempDirectory { + + echo $(GetNativeInstallDirectory)temp/ + return 0 +} + +function ExpandZip { + local zip_path=$1 + local output_directory=$2 + local force=${3:-false} + + echo "Extracting $zip_path to $output_directory" + if [[ -d $output_directory ]] && [[ $force = false ]]; then + echo "Directory '$output_directory' already exists, skipping extract" + return 0 + fi + + if [[ -d $output_directory ]]; then + echo "'Force flag enabled, but '$output_directory' exists. Removing directory" + rm -rf $output_directory + if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Unable to remove '$output_directory'" + return 1 + fi + fi + + echo "Creating directory: '$output_directory'" + mkdir -p $output_directory + + echo "Extracting archive" + tar -xf $zip_path -C $output_directory + if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Unable to extract '$zip_path'" + return 1 + fi + + return 0 +} + +function GetCurrentOS { + local unameOut="$(uname -s)" + case $unameOut in + Linux*) echo "Linux";; + Darwin*) echo "MacOS";; + esac + return 0 +} + +function GetFile { + local uri=$1 + local path=$2 + local force=${3:-false} + local download_retries=${4:-5} + local retry_wait_time_seconds=${5:-30} + + if [[ -f $path ]]; then + if [[ $force = false ]]; then + echo "File '$path' already exists. Skipping download" + return 0 + else + rm -rf $path + fi + fi + + if [[ -f $uri ]]; then + echo "'$uri' is a file path, copying file to '$path'" + cp $uri $path + return $? + fi + + echo "Downloading $uri" + # Use curl if available, otherwise use wget + if command -v curl > /dev/null; then + curl "$uri" -sSL --retry $download_retries --retry-delay $retry_wait_time_seconds --create-dirs -o "$path" --fail + else + wget -q -O "$path" "$uri" --tries="$download_retries" + fi + + return $? +} + +function GetTempPathFileName { + local path=$1 + + local temp_dir=$(GetTempDirectory) + local temp_file_name=$(basename $path) + echo $temp_dir$temp_file_name + return 0 +} + +function DownloadAndExtract { + local uri=$1 + local installDir=$2 + local force=${3:-false} + local download_retries=${4:-5} + local retry_wait_time_seconds=${5:-30} + + local temp_tool_path=$(GetTempPathFileName $uri) + + echo "downloading to: $temp_tool_path" + + # Download file + GetFile "$uri" "$temp_tool_path" $force $download_retries $retry_wait_time_seconds + if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Failed to download '$uri' to '$temp_tool_path'." + return 1 + fi + + # Extract File + echo "extracting from $temp_tool_path to $installDir" + ExpandZip "$temp_tool_path" "$installDir" $force $download_retries $retry_wait_time_seconds + if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Failed to extract '$temp_tool_path' to '$installDir'." + return 1 + fi + + return 0 +} + +function NewScriptShim { + local shimpath=$1 + local tool_file_path=$2 + local force=${3:-false} + + echo "Generating '$shimpath' shim" + if [[ -f $shimpath ]]; then + if [[ $force = false ]]; then + echo "File '$shimpath' already exists." >&2 + return 1 + else + rm -rf $shimpath + fi + fi + + if [[ ! -f $tool_file_path ]]; then + # try to see if the path is lower cased + tool_file_path="$(echo $tool_file_path | tr "[:upper:]" "[:lower:]")" + if [[ ! -f $tool_file_path ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Specified tool file path:'$tool_file_path' does not exist" + return 1 + fi + fi + + local shim_contents=$'#!/usr/bin/env bash\n' + shim_contents+="SHIMARGS="$'$1\n' + shim_contents+="$tool_file_path"$' $SHIMARGS\n' + + # Write shim file + echo "$shim_contents" > $shimpath + + chmod +x $shimpath + + echo "Finished generating shim '$shimpath'" + + return $? +} + diff --git a/src/arcade/eng/common/native/install-cmake-test.sh b/src/arcade/eng/common/native/install-cmake-test.sh new file mode 100644 index 000000000000..8a5e7cf0db5a --- /dev/null +++ b/src/arcade/eng/common/native/install-cmake-test.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. $scriptroot/common-library.sh + +base_uri= +install_path= +version= +clean=false +force=false +download_retries=5 +retry_wait_time_seconds=30 + +while (($# > 0)); do + lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" + case $lowerI in + --baseuri) + base_uri=$2 + shift 2 + ;; + --installpath) + install_path=$2 + shift 2 + ;; + --version) + version=$2 + shift 2 + ;; + --clean) + clean=true + shift 1 + ;; + --force) + force=true + shift 1 + ;; + --downloadretries) + download_retries=$2 + shift 2 + ;; + --retrywaittimeseconds) + retry_wait_time_seconds=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --baseuri Base file directory or Url wrom which to acquire tool archives" + echo " --installpath Base directory to install native tool to" + echo " --clean Don't install the tool, just clean up the current install of the tool" + echo " --force Force install of tools even if they previously exist" + echo " --help Print help and exit" + echo "" + echo "Advanced settings:" + echo " --downloadretries Total number of retry attempts" + echo " --retrywaittimeseconds Wait time between retry attempts in seconds" + echo "" + exit 0 + ;; + esac +done + +tool_name="cmake-test" +tool_os=$(GetCurrentOS) +tool_folder="$(echo $tool_os | tr "[:upper:]" "[:lower:]")" +tool_arch="x86_64" +tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch" +tool_install_directory="$install_path/$tool_name/$version" +tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name" +shim_path="$install_path/$tool_name.sh" +uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz" + +# Clean up tool and installers +if [[ $clean = true ]]; then + echo "Cleaning $tool_install_directory" + if [[ -d $tool_install_directory ]]; then + rm -rf $tool_install_directory + fi + + echo "Cleaning $shim_path" + if [[ -f $shim_path ]]; then + rm -rf $shim_path + fi + + tool_temp_path=$(GetTempPathFileName $uri) + echo "Cleaning $tool_temp_path" + if [[ -f $tool_temp_path ]]; then + rm -rf $tool_temp_path + fi + + exit 0 +fi + +# Install tool +if [[ -f $tool_file_path ]] && [[ $force = false ]]; then + echo "$tool_name ($version) already exists, skipping install" + exit 0 +fi + +DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds + +if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Installation failed' + exit 1 +fi + +# Generate Shim +# Always rewrite shims so that we are referencing the expected version +NewScriptShim $shim_path $tool_file_path true + +if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Shim generation failed' + exit 1 +fi + +exit 0 diff --git a/src/arcade/eng/common/native/install-cmake.sh b/src/arcade/eng/common/native/install-cmake.sh new file mode 100644 index 000000000000..de496beebc5a --- /dev/null +++ b/src/arcade/eng/common/native/install-cmake.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. $scriptroot/common-library.sh + +base_uri= +install_path= +version= +clean=false +force=false +download_retries=5 +retry_wait_time_seconds=30 + +while (($# > 0)); do + lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" + case $lowerI in + --baseuri) + base_uri=$2 + shift 2 + ;; + --installpath) + install_path=$2 + shift 2 + ;; + --version) + version=$2 + shift 2 + ;; + --clean) + clean=true + shift 1 + ;; + --force) + force=true + shift 1 + ;; + --downloadretries) + download_retries=$2 + shift 2 + ;; + --retrywaittimeseconds) + retry_wait_time_seconds=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --baseuri Base file directory or Url wrom which to acquire tool archives" + echo " --installpath Base directory to install native tool to" + echo " --clean Don't install the tool, just clean up the current install of the tool" + echo " --force Force install of tools even if they previously exist" + echo " --help Print help and exit" + echo "" + echo "Advanced settings:" + echo " --downloadretries Total number of retry attempts" + echo " --retrywaittimeseconds Wait time between retry attempts in seconds" + echo "" + exit 0 + ;; + esac +done + +tool_name="cmake" +tool_os=$(GetCurrentOS) +tool_folder="$(echo $tool_os | tr "[:upper:]" "[:lower:]")" +tool_arch="x86_64" +tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch" +tool_install_directory="$install_path/$tool_name/$version" +tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name" +shim_path="$install_path/$tool_name.sh" +uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz" + +# Clean up tool and installers +if [[ $clean = true ]]; then + echo "Cleaning $tool_install_directory" + if [[ -d $tool_install_directory ]]; then + rm -rf $tool_install_directory + fi + + echo "Cleaning $shim_path" + if [[ -f $shim_path ]]; then + rm -rf $shim_path + fi + + tool_temp_path=$(GetTempPathFileName $uri) + echo "Cleaning $tool_temp_path" + if [[ -f $tool_temp_path ]]; then + rm -rf $tool_temp_path + fi + + exit 0 +fi + +# Install tool +if [[ -f $tool_file_path ]] && [[ $force = false ]]; then + echo "$tool_name ($version) already exists, skipping install" + exit 0 +fi + +DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds + +if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Installation failed' + exit 1 +fi + +# Generate Shim +# Always rewrite shims so that we are referencing the expected version +NewScriptShim $shim_path $tool_file_path true + +if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Shim generation failed' + exit 1 +fi + +exit 0 diff --git a/src/arcade/eng/common/native/install-tool.ps1 b/src/arcade/eng/common/native/install-tool.ps1 new file mode 100644 index 000000000000..78f2d84a4e4b --- /dev/null +++ b/src/arcade/eng/common/native/install-tool.ps1 @@ -0,0 +1,132 @@ +<# +.SYNOPSIS +Install native tool + +.DESCRIPTION +Install cmake native tool from Azure blob storage + +.PARAMETER InstallPath +Base directory to install native tool to + +.PARAMETER BaseUri +Base file directory or Url from which to acquire tool archives + +.PARAMETER CommonLibraryDirectory +Path to folder containing common library modules + +.PARAMETER Force +Force install of tools even if they previously exist + +.PARAMETER Clean +Don't install the tool, just clean up the current install of the tool + +.PARAMETER DownloadRetries +Total number of retry attempts + +.PARAMETER RetryWaitTimeInSeconds +Wait time between retry attempts in seconds + +.NOTES +Returns 0 if install succeeds, 1 otherwise +#> +[CmdletBinding(PositionalBinding=$false)] +Param ( + [Parameter(Mandatory=$True)] + [string] $ToolName, + [Parameter(Mandatory=$True)] + [string] $InstallPath, + [Parameter(Mandatory=$True)] + [string] $BaseUri, + [Parameter(Mandatory=$True)] + [string] $Version, + [string] $CommonLibraryDirectory = $PSScriptRoot, + [switch] $Force = $False, + [switch] $Clean = $False, + [int] $DownloadRetries = 5, + [int] $RetryWaitTimeInSeconds = 30 +) + +. $PSScriptRoot\..\pipeline-logging-functions.ps1 + +# Import common library modules +Import-Module -Name (Join-Path $CommonLibraryDirectory "CommonLibrary.psm1") + +try { + # Define verbose switch if undefined + $Verbose = $VerbosePreference -Eq "Continue" + + $Arch = CommonLibrary\Get-MachineArchitecture + $ToolOs = "win64" + if($Arch -Eq "x32") { + $ToolOs = "win32" + } + $ToolNameMoniker = "$ToolName-$Version-$ToolOs-$Arch" + $ToolInstallDirectory = Join-Path $InstallPath "$ToolName\$Version\" + $Uri = "$BaseUri/windows/$ToolName/$ToolNameMoniker.zip" + $ShimPath = Join-Path $InstallPath "$ToolName.exe" + + if ($Clean) { + Write-Host "Cleaning $ToolInstallDirectory" + if (Test-Path $ToolInstallDirectory) { + Remove-Item $ToolInstallDirectory -Force -Recurse + } + Write-Host "Cleaning $ShimPath" + if (Test-Path $ShimPath) { + Remove-Item $ShimPath -Force + } + $ToolTempPath = CommonLibrary\Get-TempPathFilename -Path $Uri + Write-Host "Cleaning $ToolTempPath" + if (Test-Path $ToolTempPath) { + Remove-Item $ToolTempPath -Force + } + exit 0 + } + + # Install tool + if ((Test-Path $ToolInstallDirectory) -And (-Not $Force)) { + Write-Verbose "$ToolName ($Version) already exists, skipping install" + } + else { + $InstallStatus = CommonLibrary\DownloadAndExtract -Uri $Uri ` + -InstallDirectory $ToolInstallDirectory ` + -Force:$Force ` + -DownloadRetries $DownloadRetries ` + -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` + -Verbose:$Verbose + + if ($InstallStatus -Eq $False) { + Write-PipelineTelemetryError "Installation failed" -Category "NativeToolsetBootstrapping" + exit 1 + } + } + + $ToolFilePath = Get-ChildItem $ToolInstallDirectory -Recurse -Filter "$ToolName.exe" | % { $_.FullName } + if (@($ToolFilePath).Length -Gt 1) { + Write-Error "There are multiple copies of $ToolName in $($ToolInstallDirectory): `n$(@($ToolFilePath | out-string))" + exit 1 + } elseif (@($ToolFilePath).Length -Lt 1) { + Write-Host "$ToolName was not found in $ToolInstallDirectory." + exit 1 + } + + # Generate shim + # Always rewrite shims so that we are referencing the expected version + $GenerateShimStatus = CommonLibrary\New-ScriptShim -ShimName $ToolName ` + -ShimDirectory $InstallPath ` + -ToolFilePath "$ToolFilePath" ` + -BaseUri $BaseUri ` + -Force:$Force ` + -Verbose:$Verbose + + if ($GenerateShimStatus -Eq $False) { + Write-PipelineTelemetryError "Generate shim failed" -Category "NativeToolsetBootstrapping" + return 1 + } + + exit 0 +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category "NativeToolsetBootstrapping" -Message $_ + exit 1 +} diff --git a/src/arcade/eng/common/pipeline-logging-functions.ps1 b/src/arcade/eng/common/pipeline-logging-functions.ps1 new file mode 100644 index 000000000000..8e422c561e4b --- /dev/null +++ b/src/arcade/eng/common/pipeline-logging-functions.ps1 @@ -0,0 +1,260 @@ +# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1 and modified. + +# NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1 + +$script:loggingCommandPrefix = '##vso[' +$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"? + New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' } + New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' } + New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' } + New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' } +) +# TODO: BUG: Escape % ??? +# TODO: Add test to verify don't need to escape "=". + +# Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set +function Write-PipelineTelemetryError { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Category, + [Parameter(Mandatory = $true)] + [string]$Message, + [Parameter(Mandatory = $false)] + [string]$Type = 'error', + [string]$ErrCode, + [string]$SourcePath, + [string]$LineNumber, + [string]$ColumnNumber, + [switch]$AsOutput, + [switch]$Force) + + $PSBoundParameters.Remove('Category') | Out-Null + + if ($Force -Or ((Test-Path variable:ci) -And $ci)) { + $Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message" + } + $PSBoundParameters.Remove('Message') | Out-Null + $PSBoundParameters.Add('Message', $Message) + Write-PipelineTaskError @PSBoundParameters +} + +# Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set +function Write-PipelineTaskError { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Message, + [Parameter(Mandatory = $false)] + [string]$Type = 'error', + [string]$ErrCode, + [string]$SourcePath, + [string]$LineNumber, + [string]$ColumnNumber, + [switch]$AsOutput, + [switch]$Force + ) + + if (!$Force -And (-Not (Test-Path variable:ci) -Or !$ci)) { + if ($Type -eq 'error') { + Write-Host $Message -ForegroundColor Red + return + } + elseif ($Type -eq 'warning') { + Write-Host $Message -ForegroundColor Yellow + return + } + } + + if (($Type -ne 'error') -and ($Type -ne 'warning')) { + Write-Host $Message + return + } + $PSBoundParameters.Remove('Force') | Out-Null + if (-not $PSBoundParameters.ContainsKey('Type')) { + $PSBoundParameters.Add('Type', 'error') + } + Write-LogIssue @PSBoundParameters +} + +function Write-PipelineSetVariable { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Name, + [string]$Value, + [switch]$Secret, + [switch]$AsOutput, + [bool]$IsMultiJobVariable = $true) + + if ((Test-Path variable:ci) -And $ci) { + Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{ + 'variable' = $Name + 'isSecret' = $Secret + 'isOutput' = $IsMultiJobVariable + } -AsOutput:$AsOutput + } +} + +function Write-PipelinePrependPath { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Path, + [switch]$AsOutput) + + if ((Test-Path variable:ci) -And $ci) { + Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput + } +} + +function Write-PipelineSetResult { + [CmdletBinding()] + param( + [ValidateSet("Succeeded", "SucceededWithIssues", "Failed", "Cancelled", "Skipped")] + [Parameter(Mandatory = $true)] + [string]$Result, + [string]$Message) + if ((Test-Path variable:ci) -And $ci) { + Write-LoggingCommand -Area 'task' -Event 'complete' -Data $Message -Properties @{ + 'result' = $Result + } + } +} + +<######################################## +# Private functions. +########################################> +function Format-LoggingCommandData { + [CmdletBinding()] + param([string]$Value, [switch]$Reverse) + + if (!$Value) { + return '' + } + + if (!$Reverse) { + foreach ($mapping in $script:loggingCommandEscapeMappings) { + $Value = $Value.Replace($mapping.Token, $mapping.Replacement) + } + } + else { + for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) { + $mapping = $script:loggingCommandEscapeMappings[$i] + $Value = $Value.Replace($mapping.Replacement, $mapping.Token) + } + } + + return $Value +} + +function Format-LoggingCommand { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Area, + [Parameter(Mandatory = $true)] + [string]$Event, + [string]$Data, + [hashtable]$Properties) + + # Append the preamble. + [System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder + $null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event) + + # Append the properties. + if ($Properties) { + $first = $true + foreach ($key in $Properties.Keys) { + [string]$value = Format-LoggingCommandData $Properties[$key] + if ($value) { + if ($first) { + $null = $sb.Append(' ') + $first = $false + } + else { + $null = $sb.Append(';') + } + + $null = $sb.Append("$key=$value") + } + } + } + + # Append the tail and output the value. + $Data = Format-LoggingCommandData $Data + $sb.Append(']').Append($Data).ToString() +} + +function Write-LoggingCommand { + [CmdletBinding(DefaultParameterSetName = 'Parameters')] + param( + [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] + [string]$Area, + [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] + [string]$Event, + [Parameter(ParameterSetName = 'Parameters')] + [string]$Data, + [Parameter(ParameterSetName = 'Parameters')] + [hashtable]$Properties, + [Parameter(Mandatory = $true, ParameterSetName = 'Object')] + $Command, + [switch]$AsOutput) + + if ($PSCmdlet.ParameterSetName -eq 'Object') { + Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput + return + } + + $command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties + if ($AsOutput) { + $command + } + else { + Write-Host $command + } +} + +function Write-LogIssue { + [CmdletBinding()] + param( + [ValidateSet('warning', 'error')] + [Parameter(Mandatory = $true)] + [string]$Type, + [string]$Message, + [string]$ErrCode, + [string]$SourcePath, + [string]$LineNumber, + [string]$ColumnNumber, + [switch]$AsOutput) + + $command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{ + 'type' = $Type + 'code' = $ErrCode + 'sourcepath' = $SourcePath + 'linenumber' = $LineNumber + 'columnnumber' = $ColumnNumber + } + if ($AsOutput) { + return $command + } + + if ($Type -eq 'error') { + $foregroundColor = $host.PrivateData.ErrorForegroundColor + $backgroundColor = $host.PrivateData.ErrorBackgroundColor + if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { + $foregroundColor = [System.ConsoleColor]::Red + $backgroundColor = [System.ConsoleColor]::Black + } + } + else { + $foregroundColor = $host.PrivateData.WarningForegroundColor + $backgroundColor = $host.PrivateData.WarningBackgroundColor + if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { + $foregroundColor = [System.ConsoleColor]::Yellow + $backgroundColor = [System.ConsoleColor]::Black + } + } + + Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor +} diff --git a/src/arcade/eng/common/pipeline-logging-functions.sh b/src/arcade/eng/common/pipeline-logging-functions.sh new file mode 100644 index 000000000000..6a0b2255e911 --- /dev/null +++ b/src/arcade/eng/common/pipeline-logging-functions.sh @@ -0,0 +1,206 @@ +#!/usr/bin/env bash + +function Write-PipelineTelemetryError { + local telemetry_category='' + local force=false + local function_args=() + local message='' + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + -category|-c) + telemetry_category=$2 + shift + ;; + -force|-f) + force=true + ;; + -*) + function_args+=("$1 $2") + shift + ;; + *) + message=$* + ;; + esac + shift + done + + if [[ $force != true ]] && [[ "$ci" != true ]]; then + echo "$message" >&2 + return + fi + + if [[ $force == true ]]; then + function_args+=("-force") + fi + message="(NETCORE_ENGINEERING_TELEMETRY=$telemetry_category) $message" + function_args+=("$message") + Write-PipelineTaskError ${function_args[@]} +} + +function Write-PipelineTaskError { + local message_type="error" + local sourcepath='' + local linenumber='' + local columnnumber='' + local error_code='' + local force=false + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + -type|-t) + message_type=$2 + shift + ;; + -sourcepath|-s) + sourcepath=$2 + shift + ;; + -linenumber|-ln) + linenumber=$2 + shift + ;; + -columnnumber|-cn) + columnnumber=$2 + shift + ;; + -errcode|-e) + error_code=$2 + shift + ;; + -force|-f) + force=true + ;; + *) + break + ;; + esac + + shift + done + + if [[ $force != true ]] && [[ "$ci" != true ]]; then + echo "$@" >&2 + return + fi + + local message="##vso[task.logissue" + + message="$message type=$message_type" + + if [ -n "$sourcepath" ]; then + message="$message;sourcepath=$sourcepath" + fi + + if [ -n "$linenumber" ]; then + message="$message;linenumber=$linenumber" + fi + + if [ -n "$columnnumber" ]; then + message="$message;columnnumber=$columnnumber" + fi + + if [ -n "$error_code" ]; then + message="$message;code=$error_code" + fi + + message="$message]$*" + echo "$message" +} + +function Write-PipelineSetVariable { + if [[ "$ci" != true ]]; then + return + fi + + local name='' + local value='' + local secret=false + local as_output=false + local is_multi_job_variable=true + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + -name|-n) + name=$2 + shift + ;; + -value|-v) + value=$2 + shift + ;; + -secret|-s) + secret=true + ;; + -as_output|-a) + as_output=true + ;; + -is_multi_job_variable|-i) + is_multi_job_variable=$2 + shift + ;; + esac + shift + done + + value=${value/;/%3B} + value=${value/\\r/%0D} + value=${value/\\n/%0A} + value=${value/]/%5D} + + local message="##vso[task.setvariable variable=$name;isSecret=$secret;isOutput=$is_multi_job_variable]$value" + + if [[ "$as_output" == true ]]; then + $message + else + echo "$message" + fi +} + +function Write-PipelinePrependPath { + local prepend_path='' + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + -path|-p) + prepend_path=$2 + shift + ;; + esac + shift + done + + export PATH="$prepend_path:$PATH" + + if [[ "$ci" == true ]]; then + echo "##vso[task.prependpath]$prepend_path" + fi +} + +function Write-PipelineSetResult { + local result='' + local message='' + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + -result|-r) + result=$2 + shift + ;; + -message|-m) + message=$2 + shift + ;; + esac + shift + done + + if [[ "$ci" == true ]]; then + echo "##vso[task.complete result=$result;]$message" + fi +} diff --git a/src/arcade/eng/common/retain-build.ps1 b/src/arcade/eng/common/retain-build.ps1 new file mode 100644 index 000000000000..e7ba975adeb6 --- /dev/null +++ b/src/arcade/eng/common/retain-build.ps1 @@ -0,0 +1,45 @@ + +Param( +[Parameter(Mandatory=$true)][int] $buildId, +[Parameter(Mandatory=$true)][string] $azdoOrgUri, +[Parameter(Mandatory=$true)][string] $azdoProject, +[Parameter(Mandatory=$true)][string] $token +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +function Get-AzDOHeaders( + [string] $token) +{ + $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":${token}")) + $headers = @{"Authorization"="Basic $base64AuthInfo"} + return $headers +} + +function Update-BuildRetention( + [string] $azdoOrgUri, + [string] $azdoProject, + [int] $buildId, + [string] $token) +{ + $headers = Get-AzDOHeaders -token $token + $requestBody = "{ + `"keepForever`": `"true`" + }" + + $requestUri = "${azdoOrgUri}/${azdoProject}/_apis/build/builds/${buildId}?api-version=6.0" + write-Host "Attempting to retain build using the following URI: ${requestUri} ..." + + try { + Invoke-RestMethod -Uri $requestUri -Method Patch -Body $requestBody -Header $headers -contentType "application/json" + Write-Host "Updated retention settings for build ${buildId}." + } + catch { + Write-Error "Failed to update retention settings for build: $_.Exception.Response.StatusDescription" + exit 1 + } +} + +Update-BuildRetention -azdoOrgUri $azdoOrgUri -azdoProject $azdoProject -buildId $buildId -token $token +exit 0 diff --git a/src/arcade/eng/common/sdl/configure-sdl-tool.ps1 b/src/arcade/eng/common/sdl/configure-sdl-tool.ps1 new file mode 100644 index 000000000000..27f5a4115fc7 --- /dev/null +++ b/src/arcade/eng/common/sdl/configure-sdl-tool.ps1 @@ -0,0 +1,130 @@ +Param( + [string] $GuardianCliLocation, + [string] $WorkingDirectory, + [string] $TargetDirectory, + [string] $GdnFolder, + # The list of Guardian tools to configure. For each object in the array: + # - If the item is a [hashtable], it must contain these entries: + # - Name = The tool name as Guardian knows it. + # - Scenario = (Optional) Scenario-specific name for this configuration entry. It must be unique + # among all tool entries with the same Name. + # - Args = (Optional) Array of Guardian tool configuration args, like '@("Target > C:\temp")' + # - If the item is a [string] $v, it is treated as '@{ Name="$v" }' + [object[]] $ToolsList, + [string] $GuardianLoggerLevel='Standard', + # Optional: Additional params to add to any tool using CredScan. + [string[]] $CrScanAdditionalRunConfigParams, + # Optional: Additional params to add to any tool using PoliCheck. + [string[]] $PoliCheckAdditionalRunConfigParams, + # Optional: Additional params to add to any tool using CodeQL/Semmle. + [string[]] $CodeQLAdditionalRunConfigParams, + # Optional: Additional params to add to any tool using Binskim. + [string[]] $BinskimAdditionalRunConfigParams +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 +$disableConfigureToolsetImport = $true +$global:LASTEXITCODE = 0 + +try { + # `tools.ps1` checks $ci to perform some actions. Since the SDL + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + . $PSScriptRoot\..\tools.ps1 + + # Normalize tools list: all in [hashtable] form with defined values for each key. + $ToolsList = $ToolsList | + ForEach-Object { + if ($_ -is [string]) { + $_ = @{ Name = $_ } + } + + if (-not ($_['Scenario'])) { $_.Scenario = "" } + if (-not ($_['Args'])) { $_.Args = @() } + $_ + } + + Write-Host "List of tools to configure:" + $ToolsList | ForEach-Object { $_ | Out-String | Write-Host } + + # We store config files in the r directory of .gdn + $gdnConfigPath = Join-Path $GdnFolder 'r' + $ValidPath = Test-Path $GuardianCliLocation + + if ($ValidPath -eq $False) + { + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location." + ExitWithExitCode 1 + } + + foreach ($tool in $ToolsList) { + # Put together the name and scenario to make a unique key. + $toolConfigName = $tool.Name + if ($tool.Scenario) { + $toolConfigName += "_" + $tool.Scenario + } + + Write-Host "=== Configuring $toolConfigName..." + + $gdnConfigFile = Join-Path $gdnConfigPath "$toolConfigName-configure.gdnconfig" + + # For some tools, add default and automatic args. + switch -Exact ($tool.Name) { + 'credscan' { + if ($targetDirectory) { + $tool.Args += "`"TargetDirectory < $TargetDirectory`"" + } + $tool.Args += "`"OutputType < pre`"" + $tool.Args += $CrScanAdditionalRunConfigParams + } + 'policheck' { + if ($targetDirectory) { + $tool.Args += "`"Target < $TargetDirectory`"" + } + $tool.Args += $PoliCheckAdditionalRunConfigParams + } + {$_ -in 'semmle', 'codeql'} { + if ($targetDirectory) { + $tool.Args += "`"SourceCodeDirectory < $TargetDirectory`"" + } + $tool.Args += $CodeQLAdditionalRunConfigParams + } + 'binskim' { + if ($targetDirectory) { + # Binskim crashes due to specific PDBs. GitHub issue: https://github.com/microsoft/binskim/issues/924. + # We are excluding all `_.pdb` files from the scan. + $tool.Args += "`"Target < $TargetDirectory\**;-:file|$TargetDirectory\**\_.pdb`"" + } + $tool.Args += $BinskimAdditionalRunConfigParams + } + } + + # Create variable pointing to the args array directly so we can use splat syntax later. + $toolArgs = $tool.Args + + # Configure the tool. If args array is provided or the current tool has some default arguments + # defined, add "--args" and splat each element on the end. Arg format is "{Arg id} < {Value}", + # one per parameter. Doc page for "guardian configure": + # https://dev.azure.com/securitytools/SecurityIntegration/_wiki/wikis/Guardian/1395/configure + Exec-BlockVerbosely { + & $GuardianCliLocation configure ` + --working-directory $WorkingDirectory ` + --tool $tool.Name ` + --output-path $gdnConfigFile ` + --logger-level $GuardianLoggerLevel ` + --noninteractive ` + --force ` + $(if ($toolArgs) { "--args" }) @toolArgs + Exit-IfNZEC "Sdl" + } + + Write-Host "Created '$toolConfigName' configuration file: $gdnConfigFile" + } +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/sdl/extract-artifact-archives.ps1 b/src/arcade/eng/common/sdl/extract-artifact-archives.ps1 new file mode 100644 index 000000000000..68da4fbf2571 --- /dev/null +++ b/src/arcade/eng/common/sdl/extract-artifact-archives.ps1 @@ -0,0 +1,63 @@ +# This script looks for each archive file in a directory and extracts it into the target directory. +# For example, the file "$InputPath/bin.tar.gz" extracts to "$ExtractPath/bin.tar.gz.extracted/**". +# Uses the "tar" utility added to Windows 10 / Windows 2019 that supports tar.gz and zip. +param( + # Full path to directory where archives are stored. + [Parameter(Mandatory=$true)][string] $InputPath, + # Full path to directory to extract archives into. May be the same as $InputPath. + [Parameter(Mandatory=$true)][string] $ExtractPath +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +$disableConfigureToolsetImport = $true + +try { + # `tools.ps1` checks $ci to perform some actions. Since the SDL + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + . $PSScriptRoot\..\tools.ps1 + + Measure-Command { + $jobs = @() + + # Find archive files for non-Windows and Windows builds. + $archiveFiles = @( + Get-ChildItem (Join-Path $InputPath "*.tar.gz") + Get-ChildItem (Join-Path $InputPath "*.zip") + ) + + foreach ($targzFile in $archiveFiles) { + $jobs += Start-Job -ScriptBlock { + $file = $using:targzFile + $fileName = [System.IO.Path]::GetFileName($file) + $extractDir = Join-Path $using:ExtractPath "$fileName.extracted" + + New-Item $extractDir -ItemType Directory -Force | Out-Null + + Write-Host "Extracting '$file' to '$extractDir'..." + + # Pipe errors to stdout to prevent PowerShell detecting them and quitting the job early. + # This type of quit skips the catch, so we wouldn't be able to tell which file triggered the + # error. Save output so it can be stored in the exception string along with context. + $output = tar -xf $file -C $extractDir 2>&1 + # Handle NZEC manually rather than using Exit-IfNZEC: we are in a background job, so we + # don't have access to the outer scope. + if ($LASTEXITCODE -ne 0) { + throw "Error extracting '$file': non-zero exit code ($LASTEXITCODE). Output: '$output'" + } + + Write-Host "Extracted to $extractDir" + } + } + + Receive-Job $jobs -Wait + } +} +catch { + Write-Host $_ + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/sdl/extract-artifact-packages.ps1 b/src/arcade/eng/common/sdl/extract-artifact-packages.ps1 new file mode 100644 index 000000000000..f031ed5b25e9 --- /dev/null +++ b/src/arcade/eng/common/sdl/extract-artifact-packages.ps1 @@ -0,0 +1,82 @@ +param( + [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where artifact packages are stored + [Parameter(Mandatory=$true)][string] $ExtractPath # Full path to directory where the packages will be extracted +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +$disableConfigureToolsetImport = $true + +function ExtractArtifacts { + if (!(Test-Path $InputPath)) { + Write-Host "Input Path does not exist: $InputPath" + ExitWithExitCode 0 + } + $Jobs = @() + Get-ChildItem "$InputPath\*.nupkg" | + ForEach-Object { + $Jobs += Start-Job -ScriptBlock $ExtractPackage -ArgumentList $_.FullName + } + + foreach ($Job in $Jobs) { + Wait-Job -Id $Job.Id | Receive-Job + } +} + +try { + # `tools.ps1` checks $ci to perform some actions. Since the SDL + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + . $PSScriptRoot\..\tools.ps1 + + $ExtractPackage = { + param( + [string] $PackagePath # Full path to a NuGet package + ) + + if (!(Test-Path $PackagePath)) { + Write-PipelineTelemetryError -Category 'Build' -Message "Input file does not exist: $PackagePath" + ExitWithExitCode 1 + } + + $RelevantExtensions = @('.dll', '.exe', '.pdb') + Write-Host -NoNewLine 'Extracting ' ([System.IO.Path]::GetFileName($PackagePath)) '...' + + $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) + $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId + + Add-Type -AssemblyName System.IO.Compression.FileSystem + + [System.IO.Directory]::CreateDirectory($ExtractPath); + + try { + $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) + + $zip.Entries | + Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} | + ForEach-Object { + $TargetPath = Join-Path -Path $ExtractPath -ChildPath (Split-Path -Path $_.FullName) + [System.IO.Directory]::CreateDirectory($TargetPath); + + $TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.FullName + [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile) + } + } + catch { + Write-Host $_ + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + ExitWithExitCode 1 + } + finally { + $zip.Dispose() + } + } + Measure-Command { ExtractArtifacts } +} +catch { + Write-Host $_ + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + ExitWithExitCode 1 +} diff --git a/eng/common/sdl/packages.config b/src/arcade/eng/common/sdl/packages.config similarity index 51% rename from eng/common/sdl/packages.config rename to src/arcade/eng/common/sdl/packages.config index 4585cfd6bba1..e5f543ea68c2 100644 --- a/eng/common/sdl/packages.config +++ b/src/arcade/eng/common/sdl/packages.config @@ -1,4 +1,4 @@ - + diff --git a/src/arcade/eng/common/sdl/run-sdl.ps1 b/src/arcade/eng/common/sdl/run-sdl.ps1 new file mode 100644 index 000000000000..2eac8c78f103 --- /dev/null +++ b/src/arcade/eng/common/sdl/run-sdl.ps1 @@ -0,0 +1,49 @@ +Param( + [string] $GuardianCliLocation, + [string] $WorkingDirectory, + [string] $GdnFolder, + [string] $UpdateBaseline, + [string] $GuardianLoggerLevel='Standard' +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 +$disableConfigureToolsetImport = $true +$global:LASTEXITCODE = 0 + +try { + # `tools.ps1` checks $ci to perform some actions. Since the SDL + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + . $PSScriptRoot\..\tools.ps1 + + # We store config files in the r directory of .gdn + $gdnConfigPath = Join-Path $GdnFolder 'r' + $ValidPath = Test-Path $GuardianCliLocation + + if ($ValidPath -eq $False) + { + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location." + ExitWithExitCode 1 + } + + $gdnConfigFiles = Get-ChildItem $gdnConfigPath -Recurse -Include '*.gdnconfig' + Write-Host "Discovered Guardian config files:" + $gdnConfigFiles | Out-String | Write-Host + + Exec-BlockVerbosely { + & $GuardianCliLocation run ` + --working-directory $WorkingDirectory ` + --baseline mainbaseline ` + --update-baseline $UpdateBaseline ` + --logger-level $GuardianLoggerLevel ` + --config @gdnConfigFiles + Exit-IfNZEC "Sdl" + } +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/templates-official/variables/pool-providers.yml b/src/arcade/eng/common/templates-official/variables/pool-providers.yml new file mode 100644 index 000000000000..1f308b24efc4 --- /dev/null +++ b/src/arcade/eng/common/templates-official/variables/pool-providers.yml @@ -0,0 +1,45 @@ +# Select a pool provider based off branch name. Anything with branch name containing 'release' must go into an -Svc pool, +# otherwise it should go into the "normal" pools. This separates out the queueing and billing of released branches. + +# Motivation: +# Once a given branch of a repository's output has been officially "shipped" once, it is then considered to be COGS +# (Cost of goods sold) and should be moved to a servicing pool provider. This allows both separation of queueing +# (allowing release builds and main PR builds to not intefere with each other) and billing (required for COGS. +# Additionally, the pool provider name itself may be subject to change when the .NET Core Engineering Services +# team needs to move resources around and create new and potentially differently-named pools. Using this template +# file from an Arcade-ified repo helps guard against both having to update one's release/* branches and renaming. + +# How to use: +# This yaml assumes your shipped product branches use the naming convention "release/..." (which many do). +# If we find alternate naming conventions in broad usage it can be added to the condition below. +# +# First, import the template in an arcade-ified repo to pick up the variables, e.g.: +# +# variables: +# - template: /eng/common/templates-official/variables/pool-providers.yml +# +# ... then anywhere specifying the pool provider use the runtime variables, +# $(DncEngInternalBuildPool) +# +# pool: +# name: $(DncEngInternalBuildPool) +# image: 1es-windows-2022 + +variables: + # Coalesce the target and source branches so we know when a PR targets a release branch + # If these variables are somehow missing, fall back to main (tends to have more capacity) + + # Any new -Svc alternative pools should have variables added here to allow for splitting work + + - name: DncEngInternalBuildPool + value: $[ + replace( + replace( + eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), + True, + 'NetCore1ESPool-Svc-Internal' + ), + False, + 'NetCore1ESPool-Internal' + ) + ] \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/variables/sdl-variables.yml b/src/arcade/eng/common/templates-official/variables/sdl-variables.yml new file mode 100644 index 000000000000..dbdd66d4a4b3 --- /dev/null +++ b/src/arcade/eng/common/templates-official/variables/sdl-variables.yml @@ -0,0 +1,7 @@ +variables: +# The Guardian version specified in 'eng/common/sdl/packages.config'. This value must be kept in +# sync with the packages.config file. +- name: DefaultGuardianVersion + value: 0.109.0 +- name: GuardianPackagesConfigFile + value: $(Build.SourcesDirectory)\eng\common\sdl\packages.config \ No newline at end of file From 4c5cbc84486f200448dfce521ce27b419a835712 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 8 May 2025 08:52:32 -0700 Subject: [PATCH 21/76] [release/8.0] Forwarded Headers Middleware: Ignore XForwardedHeaders from Unknown Proxy (#61623) * Header Spoofing Proof for XForwardedProto, XForwardedHost and XForwardedPrefix * Fix Header Spoofing --------- Co-authored-by: Yannic Hamann --- .../src/ForwardedHeadersMiddleware.cs | 18 ++--- .../test/ForwardedHeadersMiddlewareTest.cs | 73 +++++++++++++++++++ 2 files changed, 82 insertions(+), 9 deletions(-) diff --git a/src/Middleware/HttpOverrides/src/ForwardedHeadersMiddleware.cs b/src/Middleware/HttpOverrides/src/ForwardedHeadersMiddleware.cs index 178a12012a40..b2738f32d33c 100644 --- a/src/Middleware/HttpOverrides/src/ForwardedHeadersMiddleware.cs +++ b/src/Middleware/HttpOverrides/src/ForwardedHeadersMiddleware.cs @@ -228,19 +228,19 @@ public void ApplyForwarders(HttpContext context) for (; entriesConsumed < sets.Length; entriesConsumed++) { var set = sets[entriesConsumed]; - if (checkFor) + // For the first instance, allow remoteIp to be null for servers that don't support it natively. + if (currentValues.RemoteIpAndPort != null && checkKnownIps && !CheckKnownAddress(currentValues.RemoteIpAndPort.Address)) { - // For the first instance, allow remoteIp to be null for servers that don't support it natively. - if (currentValues.RemoteIpAndPort != null && checkKnownIps && !CheckKnownAddress(currentValues.RemoteIpAndPort.Address)) + // Stop at the first unknown remote IP, but still apply changes processed so far. + if (_logger.IsEnabled(LogLevel.Debug)) { - // Stop at the first unknown remote IP, but still apply changes processed so far. - if (_logger.IsEnabled(LogLevel.Debug)) - { - _logger.LogDebug(1, "Unknown proxy: {RemoteIpAndPort}", currentValues.RemoteIpAndPort); - } - break; + _logger.LogDebug(1, "Unknown proxy: {RemoteIpAndPort}", currentValues.RemoteIpAndPort); } + break; + } + if (checkFor) + { if (IPEndPoint.TryParse(set.IpAndPortText, out var parsedEndPoint)) { applyChanges = true; diff --git a/src/Middleware/HttpOverrides/test/ForwardedHeadersMiddlewareTest.cs b/src/Middleware/HttpOverrides/test/ForwardedHeadersMiddlewareTest.cs index aa33a191e7b7..4fd1341acc45 100644 --- a/src/Middleware/HttpOverrides/test/ForwardedHeadersMiddlewareTest.cs +++ b/src/Middleware/HttpOverrides/test/ForwardedHeadersMiddlewareTest.cs @@ -962,6 +962,79 @@ public async Task AllOptionsDisabledRequestDoesntChange() Assert.Equal(PathString.Empty, context.Request.PathBase); } + [Theory] + [InlineData(ForwardedHeaders.XForwardedFor, false)] + [InlineData(ForwardedHeaders.XForwardedFor, true)] + [InlineData(ForwardedHeaders.XForwardedHost, false)] + [InlineData(ForwardedHeaders.XForwardedHost, true)] + [InlineData(ForwardedHeaders.XForwardedProto, false)] + [InlineData(ForwardedHeaders.XForwardedProto, true)] + [InlineData(ForwardedHeaders.XForwardedPrefix, false)] + [InlineData(ForwardedHeaders.XForwardedPrefix, true)] + public async Task IgnoreXForwardedHeadersFromUnknownProxy(ForwardedHeaders forwardedHeaders, bool unknownProxy) + { + using var host = new HostBuilder() + .ConfigureWebHost(webHostBuilder => + { + webHostBuilder + .UseTestServer() + .Configure(app => + { + var options = new ForwardedHeadersOptions + { + ForwardedHeaders = forwardedHeaders + }; + if (!unknownProxy) + { + var proxy = IPAddress.Parse("10.0.0.1"); + options.KnownProxies.Add(proxy); + } + app.UseForwardedHeaders(options); + }); + }).Build(); + + await host.StartAsync(); + + var server = host.GetTestServer(); + + var context = await server.SendAsync(c => + { + c.Request.Headers["X-Forwarded-For"] = "11.111.111.11"; + c.Request.Headers["X-Forwarded-Host"] = "testhost"; + c.Request.Headers["X-Forwarded-Proto"] = "Protocol"; + c.Request.Headers["X-Forwarded-Prefix"] = "/pathbase"; + c.Connection.RemoteIpAddress = IPAddress.Parse("10.0.0.1"); + c.Connection.RemotePort = 99; + }); + + if (unknownProxy) + { + Assert.Equal("10.0.0.1", context.Connection.RemoteIpAddress.ToString()); + Assert.Equal("localhost", context.Request.Host.ToString()); + Assert.Equal("http", context.Request.Scheme); + Assert.Equal(PathString.Empty, context.Request.PathBase); + } + else + { + if (forwardedHeaders.HasFlag(ForwardedHeaders.XForwardedFor)) + { + Assert.Equal("11.111.111.11", context.Connection.RemoteIpAddress.ToString()); + } + if (forwardedHeaders.HasFlag(ForwardedHeaders.XForwardedHost)) + { + Assert.Equal("testhost", context.Request.Host.ToString()); + } + if (forwardedHeaders.HasFlag(ForwardedHeaders.XForwardedProto)) + { + Assert.Equal("Protocol", context.Request.Scheme); + } + if (forwardedHeaders.HasFlag(ForwardedHeaders.XForwardedPrefix)) + { + Assert.Equal("/pathbase", context.Request.PathBase); + } + } + } + [Fact] public async Task PartiallyEnabledForwardsPartiallyChangesRequest() { From 93a7b663b5adbab9375994b3e2efa5f471e4721e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 May 2025 16:12:53 -0700 Subject: [PATCH 22/76] [release/8.0] (deps): Bump src/submodules/googletest (#61761) Bumps [src/submodules/googletest](https://github.com/google/googletest) from `52204f7` to `04ee1b4`. - [Release notes](https://github.com/google/googletest/releases) - [Commits](https://github.com/google/googletest/compare/52204f78f94d7512df1f0f3bea1d47437a2c3a58...04ee1b4f2aefdffb0135d7cf2a2c519fe50dabe4) --- updated-dependencies: - dependency-name: src/submodules/googletest dependency-version: 04ee1b4f2aefdffb0135d7cf2a2c519fe50dabe4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/submodules/googletest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/submodules/googletest b/src/submodules/googletest index 52204f78f94d..04ee1b4f2aef 160000 --- a/src/submodules/googletest +++ b/src/submodules/googletest @@ -1 +1 @@ -Subproject commit 52204f78f94d7512df1f0f3bea1d47437a2c3a58 +Subproject commit 04ee1b4f2aefdffb0135d7cf2a2c519fe50dabe4 From 327b4f990da6a54912fa5d57c9d862c45c363ff0 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 13 May 2025 15:42:23 -0700 Subject: [PATCH 23/76] Update baseline, SDK --- eng/Baseline.Designer.props | 426 ++++++++++++++++++------------------ eng/Baseline.xml | 212 +++++++++--------- eng/Versions.props | 40 ++-- global.json | 4 +- 4 files changed, 341 insertions(+), 341 deletions(-) diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props index f1b0e807fea1..3769c18a21cb 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -2,117 +2,117 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - + - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 @@ -120,138 +120,138 @@ - 8.0.15 + 8.0.16 - + - + - + - 8.0.15 + 8.0.16 - + - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - + - 8.0.15 + 8.0.16 - - + + - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - - + + - 8.0.15 + 8.0.16 - + - 8.0.15 + 8.0.16 - + - 8.0.15 + 8.0.16 - + - 8.0.15 + 8.0.16 - - + + - 8.0.15 + 8.0.16 - - - + + + - 8.0.15 + 8.0.16 - - + + - 8.0.15 + 8.0.16 - - + + - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - - + + @@ -259,7 +259,7 @@ - 8.0.15 + 8.0.16 @@ -268,51 +268,51 @@ - 8.0.15 + 8.0.16 - + - + - + - + - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - + - + - + - 8.0.15 + 8.0.16 - - + + @@ -322,8 +322,8 @@ - - + + @@ -331,8 +331,8 @@ - - + + @@ -343,58 +343,58 @@ - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - - + + - 8.0.15 + 8.0.16 - + - + - + - 8.0.15 + 8.0.16 - + - + - + - 8.0.15 + 8.0.16 - + - 8.0.15 + 8.0.16 @@ -403,7 +403,7 @@ - 8.0.15 + 8.0.16 @@ -411,71 +411,71 @@ - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - + - + - + - + - 8.0.15 + 8.0.16 - + - + - + - 8.0.15 + 8.0.16 - - + + - 8.0.15 + 8.0.16 - - + + - 8.0.15 + 8.0.16 @@ -491,27 +491,27 @@ - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - + - 8.0.15 + 8.0.16 @@ -520,23 +520,23 @@ - 8.0.15 + 8.0.16 - + - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 @@ -545,54 +545,54 @@ - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - - + + - - + + - - + + - 8.0.15 + 8.0.16 - - + + - - + + - - + + - - + + @@ -600,83 +600,83 @@ - 8.0.15 + 8.0.16 - + - + - + - 8.0.15 + 8.0.16 - + - + - + - 8.0.15 + 8.0.16 - + - + - + - 8.0.15 + 8.0.16 - + - + - + - 8.0.15 + 8.0.16 - - - - + + + + - 8.0.15 + 8.0.16 @@ -685,64 +685,64 @@ - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - + - 8.0.15 + 8.0.16 - + - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 @@ -764,7 +764,7 @@ - 8.0.15 + 8.0.16 @@ -786,7 +786,7 @@ - 8.0.15 + 8.0.16 @@ -802,23 +802,23 @@ - 8.0.15 + 8.0.16 - + - + - + @@ -826,24 +826,24 @@ - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - - - + + + - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 @@ -853,7 +853,7 @@ - 8.0.15 + 8.0.16 @@ -862,73 +862,73 @@ - 8.0.15 + 8.0.16 - + - + - + - 8.0.15 + 8.0.16 - + - + - + - 8.0.15 + 8.0.16 - + - + - + - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 @@ -957,11 +957,11 @@ - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 @@ -979,18 +979,18 @@ - 8.0.15 + 8.0.16 - 8.0.15 + 8.0.16 - + - 8.0.15 + 8.0.16 diff --git a/eng/Baseline.xml b/eng/Baseline.xml index 9746528d4365..a1df454eacdf 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -4,110 +4,110 @@ This file contains a list of all the packages and their versions which were rele Update this list when preparing for a new patch. --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eng/Versions.props b/eng/Versions.props index 390d644f09ee..61ccec8c755c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -11,7 +11,7 @@ 17 - false + true 7.1.2 7.* 8.0.2 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16-servicing.25215.6 + 8.0.15 + 8.0.15 + 8.0.15 + 8.0.15 + 8.0.15 + 8.0.15-servicing.25164.13 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.16-servicing.25215.6 + 8.0.15-servicing.25164.13 8.0.1 8.0.1 8.0.1 @@ -109,7 +109,7 @@ 8.0.0 8.0.2 8.0.0 - 8.0.16-servicing.25215.6 + 8.0.15-servicing.25164.13 8.0.1 8.0.1 8.0.2 @@ -117,7 +117,7 @@ 8.0.0-rtm.23520.14 8.0.0 8.0.1 - 8.0.3 + 8.0.2 8.0.1 8.0.0 8.0.1 @@ -129,9 +129,9 @@ 8.0.0 8.0.0 8.0.0 - 8.0.16-servicing.25215.6 + 8.0.15-servicing.25164.13 - 8.0.16-servicing.25215.6 + 8.0.15-servicing.25164.13 8.0.0 8.0.1 @@ -143,14 +143,14 @@ 8.1.0-preview.23604.1 8.1.0-preview.23604.1 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 + 8.0.15 + 8.0.15 + 8.0.15 + 8.0.15 + 8.0.15 + 8.0.15 + 8.0.15 + 8.0.15 4.8.0-7.24574.2 4.8.0-7.24574.2 diff --git a/global.json b/global.json index 2d7bd87b2e5f..c77c161a20d5 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "sdk": { - "version": "8.0.115" + "version": "8.0.116" }, "tools": { - "dotnet": "8.0.115", + "dotnet": "8.0.116", "runtimes": { "dotnet/x86": [ "$(MicrosoftNETCoreBrowserDebugHostTransportVersion)" From effd4bce38b162d38749df6cc015b38375ddef93 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 13 May 2025 16:02:40 -0700 Subject: [PATCH 24/76] Fix versions.props --- eng/Versions.props | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 61ccec8c755c..b863546ddc2c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -67,12 +67,12 @@ 8.0.2 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15-servicing.25164.13 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16-servicing.25215.6 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.15-servicing.25164.13 + 8.0.16-servicing.25215.6 8.0.1 8.0.1 8.0.1 @@ -109,7 +109,7 @@ 8.0.0 8.0.2 8.0.0 - 8.0.15-servicing.25164.13 + 8.0.16-servicing.25215.6 8.0.1 8.0.1 8.0.2 @@ -117,7 +117,7 @@ 8.0.0-rtm.23520.14 8.0.0 8.0.1 - 8.0.2 + 8.0.3 8.0.1 8.0.0 8.0.1 @@ -129,9 +129,9 @@ 8.0.0 8.0.0 8.0.0 - 8.0.15-servicing.25164.13 + 8.0.16-servicing.25215.6 - 8.0.15-servicing.25164.13 + 8.0.16-servicing.25215.6 8.0.0 8.0.1 @@ -143,14 +143,14 @@ 8.1.0-preview.23604.1 8.1.0-preview.23604.1 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 - 8.0.15 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 + 8.0.16 4.8.0-7.24574.2 4.8.0-7.24574.2 @@ -339,4 +339,4 @@ 1.10.93 1.2.3 - + \ No newline at end of file From 516428097d25a9239fd589f789842046a6292b1c Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Thu, 15 May 2025 20:26:10 +0000 Subject: [PATCH 25/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250515.3 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.16 -> To Version 8.0.17 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/NuGet.config b/NuGet.config index 1dd20d7bdb25..df9dd3783bca 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,7 +6,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index df12d6737195..675d3784f651 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,35 +11,35 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 + e19dd3f1365aba4bd3eca0493020a8525dbef8a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 + e19dd3f1365aba4bd3eca0493020a8525dbef8a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 + e19dd3f1365aba4bd3eca0493020a8525dbef8a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 + e19dd3f1365aba4bd3eca0493020a8525dbef8a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 + e19dd3f1365aba4bd3eca0493020a8525dbef8a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 + e19dd3f1365aba4bd3eca0493020a8525dbef8a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 + e19dd3f1365aba4bd3eca0493020a8525dbef8a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 7e1b4d7614303c215ffddc9a624337bdbd7e33a2 + e19dd3f1365aba4bd3eca0493020a8525dbef8a0 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime From de90ac52e196b3d417df0080c828a1b43b860a96 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Fri, 16 May 2025 00:36:18 +0000 Subject: [PATCH 26/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250515.8 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.16 -> To Version 8.0.17 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/NuGet.config b/NuGet.config index df9dd3783bca..01260f26369c 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,7 +6,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 675d3784f651..3db42c4214ee 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,35 +11,35 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - e19dd3f1365aba4bd3eca0493020a8525dbef8a0 + 24803208652bc45831e2fe56b187be740576495f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - e19dd3f1365aba4bd3eca0493020a8525dbef8a0 + 24803208652bc45831e2fe56b187be740576495f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - e19dd3f1365aba4bd3eca0493020a8525dbef8a0 + 24803208652bc45831e2fe56b187be740576495f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - e19dd3f1365aba4bd3eca0493020a8525dbef8a0 + 24803208652bc45831e2fe56b187be740576495f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - e19dd3f1365aba4bd3eca0493020a8525dbef8a0 + 24803208652bc45831e2fe56b187be740576495f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - e19dd3f1365aba4bd3eca0493020a8525dbef8a0 + 24803208652bc45831e2fe56b187be740576495f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - e19dd3f1365aba4bd3eca0493020a8525dbef8a0 + 24803208652bc45831e2fe56b187be740576495f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - e19dd3f1365aba4bd3eca0493020a8525dbef8a0 + 24803208652bc45831e2fe56b187be740576495f https://dev.azure.com/dnceng/internal/_git/dotnet-runtime From c87e4ae1b4fba359315de56a7ca0f44923ede28b Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Fri, 16 May 2025 14:28:42 +0000 Subject: [PATCH 27/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-runtime build 20250516.2 Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.DirectoryServices.Protocols , System.Net.Http.WinHttpHandler , Microsoft.SourceBuild.Intermediate.runtime.linux-x64 From Version 8.0.16-servicing.25215.6 -> To Version 8.0.17-servicing.25266.2 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 46 ++++++++++++++++++++--------------------- eng/Versions.props | 22 ++++++++++---------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/NuGet.config b/NuGet.config index 01260f26369c..cdb95acc6406 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3db42c4214ee..dab7a28048df 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -121,9 +121,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - b33d4e34e1cbf993583d78fc1b64ea8400935978 + 77545d6fd5ca79bc08198fd6d8037c14843f14ad https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -185,9 +185,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - b33d4e34e1cbf993583d78fc1b64ea8400935978 + 77545d6fd5ca79bc08198fd6d8037c14843f14ad https://github.com/dotnet/source-build-externals @@ -211,9 +211,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 50c4cb9fc31c47f03eac865d7bc518af173b74b7 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 50c4cb9fc31c47f03eac865d7bc518af173b74b7 + 77545d6fd5ca79bc08198fd6d8037c14843f14ad https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -225,7 +225,7 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - b33d4e34e1cbf993583d78fc1b64ea8400935978 + 77545d6fd5ca79bc08198fd6d8037c14843f14ad https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -275,17 +275,17 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 81cabf2857a01351e5ab578947c7403a5b128ad1 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - b33d4e34e1cbf993583d78fc1b64ea8400935978 + 77545d6fd5ca79bc08198fd6d8037c14843f14ad - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - b33d4e34e1cbf993583d78fc1b64ea8400935978 + 77545d6fd5ca79bc08198fd6d8037c14843f14ad - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - b33d4e34e1cbf993583d78fc1b64ea8400935978 + 77545d6fd5ca79bc08198fd6d8037c14843f14ad https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -316,22 +316,22 @@ Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime. All Runtime.$rid packages should have the same version. --> - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - b33d4e34e1cbf993583d78fc1b64ea8400935978 + 77545d6fd5ca79bc08198fd6d8037c14843f14ad - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - b33d4e34e1cbf993583d78fc1b64ea8400935978 + 77545d6fd5ca79bc08198fd6d8037c14843f14ad - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - b33d4e34e1cbf993583d78fc1b64ea8400935978 + 77545d6fd5ca79bc08198fd6d8037c14843f14ad - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - b33d4e34e1cbf993583d78fc1b64ea8400935978 + 77545d6fd5ca79bc08198fd6d8037c14843f14ad https://github.com/dotnet/xdt @@ -368,9 +368,9 @@ - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - b33d4e34e1cbf993583d78fc1b64ea8400935978 + 77545d6fd5ca79bc08198fd6d8037c14843f14ad https://github.com/dotnet/winforms diff --git a/eng/Versions.props b/eng/Versions.props index c6fee9f40828..8df6e865b828 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -67,12 +67,12 @@ 8.0.2 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16 - 8.0.16-servicing.25251.5 + 8.0.17 + 8.0.17 + 8.0.17 + 8.0.17 + 8.0.17 + 8.0.17-servicing.25266.2 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.16-servicing.25251.5 + 8.0.17-servicing.25266.2 8.0.1 8.0.1 8.0.1 @@ -109,11 +109,11 @@ 8.0.0 8.0.2 8.0.0 - 8.0.16-servicing.25251.5 + 8.0.17-servicing.25266.2 8.0.1 8.0.1 8.0.2 - 8.0.1 + 8.0.2 8.0.0-rtm.23520.14 8.0.0 8.0.1 @@ -129,9 +129,9 @@ 8.0.0 8.0.0 8.0.0 - 8.0.16-servicing.25251.5 + 8.0.17-servicing.25266.2 - 8.0.16-servicing.25251.5 + 8.0.17-servicing.25266.2 8.0.0 8.0.1 From 15899853051c09a391f5f1811de8af5e8736e2f4 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Fri, 16 May 2025 16:46:07 +0000 Subject: [PATCH 28/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250516.4 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.17 -> To Version 8.0.17 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 16 ++++++++-------- eng/Versions.props | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/NuGet.config b/NuGet.config index cdb95acc6406..73db13ca0ac3 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,7 +6,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 476ad8f51e26..cd32adc1d071 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,35 +11,35 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24803208652bc45831e2fe56b187be740576495f + f7b16ef09831139dd1b087f281910e2446129bef https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24803208652bc45831e2fe56b187be740576495f + f7b16ef09831139dd1b087f281910e2446129bef https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24803208652bc45831e2fe56b187be740576495f + f7b16ef09831139dd1b087f281910e2446129bef https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24803208652bc45831e2fe56b187be740576495f + f7b16ef09831139dd1b087f281910e2446129bef https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24803208652bc45831e2fe56b187be740576495f + f7b16ef09831139dd1b087f281910e2446129bef https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24803208652bc45831e2fe56b187be740576495f + f7b16ef09831139dd1b087f281910e2446129bef https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24803208652bc45831e2fe56b187be740576495f + f7b16ef09831139dd1b087f281910e2446129bef https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24803208652bc45831e2fe56b187be740576495f + f7b16ef09831139dd1b087f281910e2446129bef https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 76049fd519cb..3a2de112b070 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -339,4 +339,4 @@ 1.10.93 1.2.3 - \ No newline at end of file + From db457a8105bb73d71256a5b301c45533b68f2518 Mon Sep 17 00:00:00 2001 From: vseanreesermsft <78103370+vseanreesermsft@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:06:47 -0700 Subject: [PATCH 29/76] Update branding to 8.0.18 (#62241) --- eng/Versions.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index b863546ddc2c..5c7c7778c92c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -8,10 +8,10 @@ 8 0 - 17 + 18 - true + false 7.1.2 7.* (AlmaLinux.8.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-8-helix-amd64 - (Alpine.318.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.18-helix-amd64 + (Alpine.321.Amd64.Open)azurelinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-helix-amd64 (Debian.12.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64 (Fedora.41.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-41-helix (Mariner)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-helix-amd64 @@ -42,7 +42,7 @@ - + diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 70e01877befa..0aab28ef20cc 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -17,7 +17,7 @@ $(HelixQueueAlmaLinux8); - $(HelixQueueAlpine318); + $(HelixQueueAlpine); $(HelixQueueDebian12); $(HelixQueueFedora40); $(HelixQueueMariner); From 6fe896d77f2cf120c668c3ad8520caceaeca328c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:25:40 -0700 Subject: [PATCH 31/76] [release/8.0] (deps): Bump src/submodules/googletest (#62201) Bumps [src/submodules/googletest](https://github.com/google/googletest) from `04ee1b4` to `e9092b1`. - [Release notes](https://github.com/google/googletest/releases) - [Commits](https://github.com/google/googletest/compare/04ee1b4f2aefdffb0135d7cf2a2c519fe50dabe4...e9092b12dc3cf617d47578f13a1f64285cfa5b2f) --- updated-dependencies: - dependency-name: src/submodules/googletest dependency-version: e9092b12dc3cf617d47578f13a1f64285cfa5b2f dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/submodules/googletest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/submodules/googletest b/src/submodules/googletest index 04ee1b4f2aef..e9092b12dc3c 160000 --- a/src/submodules/googletest +++ b/src/submodules/googletest @@ -1 +1 @@ -Subproject commit 04ee1b4f2aefdffb0135d7cf2a2c519fe50dabe4 +Subproject commit e9092b12dc3cf617d47578f13a1f64285cfa5b2f From e374499f939e20551b8f8de5a8b128f06a6e880d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Wed, 4 Jun 2025 20:29:14 +0200 Subject: [PATCH 32/76] Delete src/arcade directory (#61994) It got accidentally added due to a darc bug, see https://github.com/dotnet/arcade-services/issues/4837 --- .../build-configuration.json | 4 - .../eng/common/PSScriptAnalyzerSettings.psd1 | 11 - src/arcade/eng/common/README.md | 28 -- .../eng/common/cross/arm/tizen/tizen.patch | 9 - .../eng/common/cross/armel/tizen/tizen.patch | 9 - .../eng/common/cross/x64/tizen/tizen.patch | 9 - .../eng/common/cross/x86/tizen/tizen.patch | 9 - src/arcade/eng/common/dotnet-install.cmd | 2 - src/arcade/eng/common/dotnet-install.ps1 | 28 -- .../common/enable-cross-org-publishing.ps1 | 13 - src/arcade/eng/common/generate-locproject.ps1 | 189 ------------- src/arcade/eng/common/generate-sbom-prep.ps1 | 29 -- src/arcade/eng/common/init-tools-native.ps1 | 203 -------------- src/arcade/eng/common/init-tools-native.sh | 238 ---------------- .../eng/common/internal-feed-operations.ps1 | 132 --------- .../eng/common/internal-feed-operations.sh | 141 ---------- src/arcade/eng/common/internal/NuGet.config | 7 - .../common/loc/P22DotNetHtmlLocalization.lss | 29 -- src/arcade/eng/common/msbuild.ps1 | 28 -- src/arcade/eng/common/msbuild.sh | 58 ---- .../eng/common/native/common-library.sh | 172 ------------ .../eng/common/native/install-cmake-test.sh | 117 -------- src/arcade/eng/common/native/install-cmake.sh | 117 -------- src/arcade/eng/common/native/install-tool.ps1 | 132 --------- .../eng/common/pipeline-logging-functions.ps1 | 260 ------------------ .../eng/common/pipeline-logging-functions.sh | 206 -------------- src/arcade/eng/common/retain-build.ps1 | 45 --- .../eng/common/sdl/configure-sdl-tool.ps1 | 130 --------- .../common/sdl/extract-artifact-archives.ps1 | 63 ----- .../common/sdl/extract-artifact-packages.ps1 | 82 ------ src/arcade/eng/common/sdl/packages.config | 4 - src/arcade/eng/common/sdl/run-sdl.ps1 | 49 ---- .../variables/pool-providers.yml | 45 --- .../variables/sdl-variables.yml | 7 - 34 files changed, 2605 deletions(-) delete mode 100644 src/arcade/eng/common/BuildConfiguration/build-configuration.json delete mode 100644 src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 delete mode 100644 src/arcade/eng/common/README.md delete mode 100644 src/arcade/eng/common/cross/arm/tizen/tizen.patch delete mode 100644 src/arcade/eng/common/cross/armel/tizen/tizen.patch delete mode 100644 src/arcade/eng/common/cross/x64/tizen/tizen.patch delete mode 100644 src/arcade/eng/common/cross/x86/tizen/tizen.patch delete mode 100644 src/arcade/eng/common/dotnet-install.cmd delete mode 100644 src/arcade/eng/common/dotnet-install.ps1 delete mode 100644 src/arcade/eng/common/enable-cross-org-publishing.ps1 delete mode 100644 src/arcade/eng/common/generate-locproject.ps1 delete mode 100644 src/arcade/eng/common/generate-sbom-prep.ps1 delete mode 100644 src/arcade/eng/common/init-tools-native.ps1 delete mode 100644 src/arcade/eng/common/init-tools-native.sh delete mode 100644 src/arcade/eng/common/internal-feed-operations.ps1 delete mode 100644 src/arcade/eng/common/internal-feed-operations.sh delete mode 100644 src/arcade/eng/common/internal/NuGet.config delete mode 100644 src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss delete mode 100644 src/arcade/eng/common/msbuild.ps1 delete mode 100644 src/arcade/eng/common/msbuild.sh delete mode 100644 src/arcade/eng/common/native/common-library.sh delete mode 100644 src/arcade/eng/common/native/install-cmake-test.sh delete mode 100644 src/arcade/eng/common/native/install-cmake.sh delete mode 100644 src/arcade/eng/common/native/install-tool.ps1 delete mode 100644 src/arcade/eng/common/pipeline-logging-functions.ps1 delete mode 100644 src/arcade/eng/common/pipeline-logging-functions.sh delete mode 100644 src/arcade/eng/common/retain-build.ps1 delete mode 100644 src/arcade/eng/common/sdl/configure-sdl-tool.ps1 delete mode 100644 src/arcade/eng/common/sdl/extract-artifact-archives.ps1 delete mode 100644 src/arcade/eng/common/sdl/extract-artifact-packages.ps1 delete mode 100644 src/arcade/eng/common/sdl/packages.config delete mode 100644 src/arcade/eng/common/sdl/run-sdl.ps1 delete mode 100644 src/arcade/eng/common/templates-official/variables/pool-providers.yml delete mode 100644 src/arcade/eng/common/templates-official/variables/sdl-variables.yml diff --git a/src/arcade/eng/common/BuildConfiguration/build-configuration.json b/src/arcade/eng/common/BuildConfiguration/build-configuration.json deleted file mode 100644 index 3d1cc89894c9..000000000000 --- a/src/arcade/eng/common/BuildConfiguration/build-configuration.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "RetryCountLimit": 1, - "RetryByAnyError": false -} diff --git a/src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 b/src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 deleted file mode 100644 index 4c1ea7c98ea4..000000000000 --- a/src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 +++ /dev/null @@ -1,11 +0,0 @@ -@{ - IncludeRules=@('PSAvoidUsingCmdletAliases', - 'PSAvoidUsingWMICmdlet', - 'PSAvoidUsingPositionalParameters', - 'PSAvoidUsingInvokeExpression', - 'PSUseDeclaredVarsMoreThanAssignments', - 'PSUseCmdletCorrectly', - 'PSStandardDSCFunctionsInResource', - 'PSUseIdenticalMandatoryParametersForDSC', - 'PSUseIdenticalParametersForDSC') -} \ No newline at end of file diff --git a/src/arcade/eng/common/README.md b/src/arcade/eng/common/README.md deleted file mode 100644 index ff49c371527a..000000000000 --- a/src/arcade/eng/common/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Don't touch this folder - - uuuuuuuuuuuuuuuuuuuu - u" uuuuuuuuuuuuuuuuuu "u - u" u$$$$$$$$$$$$$$$$$$$$u "u - u" u$$$$$$$$$$$$$$$$$$$$$$$$u "u - u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u - u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u - u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u - $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ - $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ - $ $$$" ... "$... ...$" ... "$$$ ... "$$$ $ - $ $$$u `"$$$$$$$ $$$ $$$$$ $$ $$$ $$$ $ - $ $$$$$$uu "$$$$ $$$ $$$$$ $$ """ u$$$ $ - $ $$$""$$$ $$$$ $$$u "$$$" u$$ $$$$$$$$ $ - $ $$$$....,$$$$$..$$$$$....,$$$$..$$$$$$$$ $ - $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ - "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" - "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" - "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" - "u "$$$$$$$$$$$$$$$$$$$$$$$$" u" - "u "$$$$$$$$$$$$$$$$$$$$" u" - "u """""""""""""""""" u" - """""""""""""""""""" - -!!! Changes made in this directory are subject to being overwritten by automation !!! - -The files in this directory are shared by all Arcade repos and managed by automation. If you need to make changes to these files, open an issue or submit a pull request to https://github.com/dotnet/arcade first. diff --git a/src/arcade/eng/common/cross/arm/tizen/tizen.patch b/src/arcade/eng/common/cross/arm/tizen/tizen.patch deleted file mode 100644 index fb12ade7250a..000000000000 --- a/src/arcade/eng/common/cross/arm/tizen/tizen.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so ---- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 -+++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 -@@ -2,4 +2,4 @@ - Use the shared library, but some functions are only in - the static library, so try that secondarily. */ - OUTPUT_FORMAT(elf32-littlearm) --GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux-armhf.so.3 ) ) -+GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-armhf.so.3 ) ) diff --git a/src/arcade/eng/common/cross/armel/tizen/tizen.patch b/src/arcade/eng/common/cross/armel/tizen/tizen.patch deleted file mode 100644 index ca7c7c1ff751..000000000000 --- a/src/arcade/eng/common/cross/armel/tizen/tizen.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so ---- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 -+++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 -@@ -2,4 +2,4 @@ - Use the shared library, but some functions are only in - the static library, so try that secondarily. */ - OUTPUT_FORMAT(elf32-littlearm) --GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.3 ) ) -+GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.3 ) ) diff --git a/src/arcade/eng/common/cross/x64/tizen/tizen.patch b/src/arcade/eng/common/cross/x64/tizen/tizen.patch deleted file mode 100644 index 56fbc881095b..000000000000 --- a/src/arcade/eng/common/cross/x64/tizen/tizen.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -u -r a/usr/lib64/libc.so b/usr/lib64/libc.so ---- a/usr/lib64/libc.so 2016-12-30 23:00:08.284951863 +0900 -+++ b/usr/lib64/libc.so 2016-12-30 23:00:32.140951815 +0900 -@@ -2,4 +2,4 @@ - Use the shared library, but some functions are only in - the static library, so try that secondarily. */ - OUTPUT_FORMAT(elf64-x86-64) --GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) ) -+GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-x86-64.so.2 ) ) diff --git a/src/arcade/eng/common/cross/x86/tizen/tizen.patch b/src/arcade/eng/common/cross/x86/tizen/tizen.patch deleted file mode 100644 index f4fe8838ad66..000000000000 --- a/src/arcade/eng/common/cross/x86/tizen/tizen.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so ---- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 -+++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 -@@ -2,4 +2,4 @@ - Use the shared library, but some functions are only in - the static library, so try that secondarily. */ - OUTPUT_FORMAT(elf32-i386) --GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.2 ) ) -+GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.2 ) ) diff --git a/src/arcade/eng/common/dotnet-install.cmd b/src/arcade/eng/common/dotnet-install.cmd deleted file mode 100644 index b1c2642e76f7..000000000000 --- a/src/arcade/eng/common/dotnet-install.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0dotnet-install.ps1""" %*" \ No newline at end of file diff --git a/src/arcade/eng/common/dotnet-install.ps1 b/src/arcade/eng/common/dotnet-install.ps1 deleted file mode 100644 index 811f0f717f73..000000000000 --- a/src/arcade/eng/common/dotnet-install.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -[CmdletBinding(PositionalBinding=$false)] -Param( - [string] $verbosity = 'minimal', - [string] $architecture = '', - [string] $version = 'Latest', - [string] $runtime = 'dotnet', - [string] $RuntimeSourceFeed = '', - [string] $RuntimeSourceFeedKey = '' -) - -. $PSScriptRoot\tools.ps1 - -$dotnetRoot = Join-Path $RepoRoot '.dotnet' - -$installdir = $dotnetRoot -try { - if ($architecture -and $architecture.Trim() -eq 'x86') { - $installdir = Join-Path $installdir 'x86' - } - InstallDotNet $installdir $version $architecture $runtime $true -RuntimeSourceFeed $RuntimeSourceFeed -RuntimeSourceFeedKey $RuntimeSourceFeedKey -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_ - ExitWithExitCode 1 -} - -ExitWithExitCode 0 diff --git a/src/arcade/eng/common/enable-cross-org-publishing.ps1 b/src/arcade/eng/common/enable-cross-org-publishing.ps1 deleted file mode 100644 index da09da4f1fc4..000000000000 --- a/src/arcade/eng/common/enable-cross-org-publishing.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -param( - [string] $token -) - - -. $PSScriptRoot\pipeline-logging-functions.ps1 - -# Write-PipelineSetVariable will no-op if a variable named $ci is not defined -# Since this script is only ever called in AzDO builds, just universally set it -$ci = $true - -Write-PipelineSetVariable -Name 'VSS_NUGET_ACCESSTOKEN' -Value $token -IsMultiJobVariable $false -Write-PipelineSetVariable -Name 'VSS_NUGET_URI_PREFIXES' -Value 'https://dnceng.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/dnceng/;https://devdiv.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/devdiv/' -IsMultiJobVariable $false diff --git a/src/arcade/eng/common/generate-locproject.ps1 b/src/arcade/eng/common/generate-locproject.ps1 deleted file mode 100644 index 524aaa57f2b7..000000000000 --- a/src/arcade/eng/common/generate-locproject.ps1 +++ /dev/null @@ -1,189 +0,0 @@ -Param( - [Parameter(Mandatory=$true)][string] $SourcesDirectory, # Directory where source files live; if using a Localize directory it should live in here - [string] $LanguageSet = 'VS_Main_Languages', # Language set to be used in the LocProject.json - [switch] $UseCheckedInLocProjectJson, # When set, generates a LocProject.json and compares it to one that already exists in the repo; otherwise just generates one - [switch] $CreateNeutralXlfs # Creates neutral xlf files. Only set to false when running locally -) - -# Generates LocProject.json files for the OneLocBuild task. OneLocBuildTask is described here: -# https://ceapex.visualstudio.com/CEINTL/_wiki/wikis/CEINTL.wiki/107/Localization-with-OneLocBuild-Task - -Set-StrictMode -Version 2.0 -$ErrorActionPreference = "Stop" -. $PSScriptRoot\pipeline-logging-functions.ps1 - -$exclusionsFilePath = "$SourcesDirectory\eng\Localize\LocExclusions.json" -$exclusions = @{ Exclusions = @() } -if (Test-Path -Path $exclusionsFilePath) -{ - $exclusions = Get-Content "$exclusionsFilePath" | ConvertFrom-Json -} - -Push-Location "$SourcesDirectory" # push location for Resolve-Path -Relative to work - -# Template files -$jsonFiles = @() -$jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern -$jsonTemplateFiles | ForEach-Object { - $null = $_.Name -Match "(.+)\.[\w-]+\.json" # matches '[filename].[langcode].json - - $destinationFile = "$($_.Directory.FullName)\$($Matches.1).json" - $jsonFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru -} - -$jsonWinformsTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern - -$wxlFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\\.+\.wxl" -And -Not( $_.Directory.Name -Match "\d{4}" ) } # localized files live in four digit lang ID directories; this excludes them -if (-not $wxlFiles) { - $wxlEnFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\\1033\\.+\.wxl" } # pick up en files (1033 = en) specifically so we can copy them to use as the neutral xlf files - if ($wxlEnFiles) { - $wxlFiles = @() - $wxlEnFiles | ForEach-Object { - $destinationFile = "$($_.Directory.Parent.FullName)\$($_.Name)" - $wxlFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru - } - } -} - -$macosHtmlEnFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\.lproj\\.+\.html$" } # add installer HTML files -$macosHtmlFiles = @() -if ($macosHtmlEnFiles) { - $macosHtmlEnFiles | ForEach-Object { - $destinationFile = "$($_.Directory.Parent.FullName)\$($_.Name)" - $macosHtmlFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru - } -} - -$xlfFiles = @() - -$allXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.xlf" -$langXlfFiles = @() -if ($allXlfFiles) { - $null = $allXlfFiles[0].FullName -Match "\.([\w-]+)\.xlf" # matches '[langcode].xlf' - $firstLangCode = $Matches.1 - $langXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.$firstLangCode.xlf" -} -$langXlfFiles | ForEach-Object { - $null = $_.Name -Match "(.+)\.[\w-]+\.xlf" # matches '[filename].[langcode].xlf - - $destinationFile = "$($_.Directory.FullName)\$($Matches.1).xlf" - $xlfFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru -} - -$locFiles = $jsonFiles + $jsonWinformsTemplateFiles + $xlfFiles - -$locJson = @{ - Projects = @( - @{ - LanguageSet = $LanguageSet - LocItems = @( - $locFiles | ForEach-Object { - $outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")" - $continue = $true - foreach ($exclusion in $exclusions.Exclusions) { - if ($_.FullName.Contains($exclusion)) - { - $continue = $false - } - } - $sourceFile = ($_.FullName | Resolve-Path -Relative) - if (!$CreateNeutralXlfs -and $_.Extension -eq '.xlf') { - Remove-Item -Path $sourceFile - } - if ($continue) - { - if ($_.Directory.Name -eq 'en' -and $_.Extension -eq '.json') { - return @{ - SourceFile = $sourceFile - CopyOption = "LangIDOnPath" - OutputPath = "$($_.Directory.Parent.FullName | Resolve-Path -Relative)\" - } - } else { - return @{ - SourceFile = $sourceFile - CopyOption = "LangIDOnName" - OutputPath = $outputPath - } - } - } - } - ) - }, - @{ - LanguageSet = $LanguageSet - CloneLanguageSet = "WiX_CloneLanguages" - LssFiles = @( "wxl_loc.lss" ) - LocItems = @( - $wxlFiles | ForEach-Object { - $outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\" - $continue = $true - foreach ($exclusion in $exclusions.Exclusions) { - if ($_.FullName.Contains($exclusion)) { - $continue = $false - } - } - $sourceFile = ($_.FullName | Resolve-Path -Relative) - if ($continue) - { - return @{ - SourceFile = $sourceFile - CopyOption = "LangIDOnPath" - OutputPath = $outputPath - } - } - } - ) - }, - @{ - LanguageSet = $LanguageSet - CloneLanguageSet = "VS_macOS_CloneLanguages" - LssFiles = @( ".\eng\common\loc\P22DotNetHtmlLocalization.lss" ) - LocItems = @( - $macosHtmlFiles | ForEach-Object { - $outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\" - $continue = $true - foreach ($exclusion in $exclusions.Exclusions) { - if ($_.FullName.Contains($exclusion)) { - $continue = $false - } - } - $sourceFile = ($_.FullName | Resolve-Path -Relative) - $lciFile = $sourceFile + ".lci" - if ($continue) { - $result = @{ - SourceFile = $sourceFile - CopyOption = "LangIDOnPath" - OutputPath = $outputPath - } - if (Test-Path $lciFile -PathType Leaf) { - $result["LciFile"] = $lciFile - } - return $result - } - } - ) - } - ) -} - -$json = ConvertTo-Json $locJson -Depth 5 -Write-Host "LocProject.json generated:`n`n$json`n`n" -Pop-Location - -if (!$UseCheckedInLocProjectJson) { - New-Item "$SourcesDirectory\eng\Localize\LocProject.json" -Force # Need this to make sure the Localize directory is created - Set-Content "$SourcesDirectory\eng\Localize\LocProject.json" $json -} -else { - New-Item "$SourcesDirectory\eng\Localize\LocProject-generated.json" -Force # Need this to make sure the Localize directory is created - Set-Content "$SourcesDirectory\eng\Localize\LocProject-generated.json" $json - - if ((Get-FileHash "$SourcesDirectory\eng\Localize\LocProject-generated.json").Hash -ne (Get-FileHash "$SourcesDirectory\eng\Localize\LocProject.json").Hash) { - Write-PipelineTelemetryError -Category "OneLocBuild" -Message "Existing LocProject.json differs from generated LocProject.json. Download LocProject-generated.json and compare them." - - exit 1 - } - else { - Write-Host "Generated LocProject.json and current LocProject.json are identical." - } -} diff --git a/src/arcade/eng/common/generate-sbom-prep.ps1 b/src/arcade/eng/common/generate-sbom-prep.ps1 deleted file mode 100644 index a0c7d792a76f..000000000000 --- a/src/arcade/eng/common/generate-sbom-prep.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -Param( - [Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed -) - -. $PSScriptRoot\pipeline-logging-functions.ps1 - -# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly -# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. -$ArtifactName = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" -$SafeArtifactName = $ArtifactName -replace '["/:<>\\|?@*"() ]', '_' -$SbomGenerationDir = Join-Path $ManifestDirPath $SafeArtifactName - -Write-Host "Artifact name before : $ArtifactName" -Write-Host "Artifact name after : $SafeArtifactName" - -Write-Host "Creating dir $ManifestDirPath" - -# create directory for sbom manifest to be placed -if (!(Test-Path -path $SbomGenerationDir)) -{ - New-Item -ItemType Directory -path $SbomGenerationDir - Write-Host "Successfully created directory $SbomGenerationDir" -} -else{ - Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." -} - -Write-Host "Updating artifact name" -Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$SafeArtifactName" diff --git a/src/arcade/eng/common/init-tools-native.ps1 b/src/arcade/eng/common/init-tools-native.ps1 deleted file mode 100644 index 27ccdb9ecc95..000000000000 --- a/src/arcade/eng/common/init-tools-native.ps1 +++ /dev/null @@ -1,203 +0,0 @@ -<# -.SYNOPSIS -Entry point script for installing native tools - -.DESCRIPTION -Reads $RepoRoot\global.json file to determine native assets to install -and executes installers for those tools - -.PARAMETER BaseUri -Base file directory or Url from which to acquire tool archives - -.PARAMETER InstallDirectory -Directory to install native toolset. This is a command-line override for the default -Install directory precedence order: -- InstallDirectory command-line override -- NETCOREENG_INSTALL_DIRECTORY environment variable -- (default) %USERPROFILE%/.netcoreeng/native - -.PARAMETER Clean -Switch specifying to not install anything, but cleanup native asset folders - -.PARAMETER Force -Clean and then install tools - -.PARAMETER DownloadRetries -Total number of retry attempts - -.PARAMETER RetryWaitTimeInSeconds -Wait time between retry attempts in seconds - -.PARAMETER GlobalJsonFile -File path to global.json file - -.PARAMETER PathPromotion -Optional switch to enable either promote native tools specified in the global.json to the path (in Azure Pipelines) -or break the build if a native tool is not found on the path (on a local dev machine) - -.NOTES -#> -[CmdletBinding(PositionalBinding=$false)] -Param ( - [string] $BaseUri = 'https://netcorenativeassets.blob.core.windows.net/resource-packages/external', - [string] $InstallDirectory, - [switch] $Clean = $False, - [switch] $Force = $False, - [int] $DownloadRetries = 5, - [int] $RetryWaitTimeInSeconds = 30, - [string] $GlobalJsonFile, - [switch] $PathPromotion -) - -if (!$GlobalJsonFile) { - $GlobalJsonFile = Join-Path (Get-Item $PSScriptRoot).Parent.Parent.FullName 'global.json' -} - -Set-StrictMode -version 2.0 -$ErrorActionPreference='Stop' - -. $PSScriptRoot\pipeline-logging-functions.ps1 -Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1') - -try { - # Define verbose switch if undefined - $Verbose = $VerbosePreference -Eq 'Continue' - - $EngCommonBaseDir = Join-Path $PSScriptRoot 'native\' - $NativeBaseDir = $InstallDirectory - if (!$NativeBaseDir) { - $NativeBaseDir = CommonLibrary\Get-NativeInstallDirectory - } - $Env:CommonLibrary_NativeInstallDir = $NativeBaseDir - $InstallBin = Join-Path $NativeBaseDir 'bin' - $InstallerPath = Join-Path $EngCommonBaseDir 'install-tool.ps1' - - # Process tools list - Write-Host "Processing $GlobalJsonFile" - If (-Not (Test-Path $GlobalJsonFile)) { - Write-Host "Unable to find '$GlobalJsonFile'" - exit 0 - } - $NativeTools = Get-Content($GlobalJsonFile) -Raw | - ConvertFrom-Json | - Select-Object -Expand 'native-tools' -ErrorAction SilentlyContinue - if ($NativeTools) { - if ($PathPromotion -eq $True) { - $ArcadeToolsDirectory = "$env:SYSTEMDRIVE\arcade-tools" - if (Test-Path $ArcadeToolsDirectory) { # if this directory exists, we should use native tools on machine - $NativeTools.PSObject.Properties | ForEach-Object { - $ToolName = $_.Name - $ToolVersion = $_.Value - $InstalledTools = @{} - - if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) { - if ($ToolVersion -eq "latest") { - $ToolVersion = "" - } - $ToolDirectories = (Get-ChildItem -Path "$ArcadeToolsDirectory" -Filter "$ToolName-$ToolVersion*" | Sort-Object -Descending) - if ($ToolDirectories -eq $null) { - Write-Error "Unable to find directory for $ToolName $ToolVersion; please make sure the tool is installed on this image." - exit 1 - } - $ToolDirectory = $ToolDirectories[0] - $BinPathFile = "$($ToolDirectory.FullName)\binpath.txt" - if (-not (Test-Path -Path "$BinPathFile")) { - Write-Error "Unable to find binpath.txt in '$($ToolDirectory.FullName)' ($ToolName $ToolVersion); artifact is either installed incorrectly or is not a bootstrappable tool." - exit 1 - } - $BinPath = Get-Content "$BinPathFile" - $ToolPath = Convert-Path -Path $BinPath - Write-Host "Adding $ToolName to the path ($ToolPath)..." - Write-Host "##vso[task.prependpath]$ToolPath" - $env:PATH = "$ToolPath;$env:PATH" - $InstalledTools += @{ $ToolName = $ToolDirectory.FullName } - } - } - return $InstalledTools - } else { - $NativeTools.PSObject.Properties | ForEach-Object { - $ToolName = $_.Name - $ToolVersion = $_.Value - - if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) { - Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message "$ToolName not found on path. Please install $ToolName $ToolVersion before proceeding." - Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message "If this is running on a build machine, the arcade-tools directory was not found, which means there's an error with the image." - } - } - exit 0 - } - } else { - $NativeTools.PSObject.Properties | ForEach-Object { - $ToolName = $_.Name - $ToolVersion = $_.Value - $LocalInstallerArguments = @{ ToolName = "$ToolName" } - $LocalInstallerArguments += @{ InstallPath = "$InstallBin" } - $LocalInstallerArguments += @{ BaseUri = "$BaseUri" } - $LocalInstallerArguments += @{ CommonLibraryDirectory = "$EngCommonBaseDir" } - $LocalInstallerArguments += @{ Version = "$ToolVersion" } - - if ($Verbose) { - $LocalInstallerArguments += @{ Verbose = $True } - } - if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') { - if($Force) { - $LocalInstallerArguments += @{ Force = $True } - } - } - if ($Clean) { - $LocalInstallerArguments += @{ Clean = $True } - } - - Write-Verbose "Installing $ToolName version $ToolVersion" - Write-Verbose "Executing '$InstallerPath $($LocalInstallerArguments.Keys.ForEach({"-$_ '$($LocalInstallerArguments.$_)'"}) -join ' ')'" - & $InstallerPath @LocalInstallerArguments - if ($LASTEXITCODE -Ne "0") { - $errMsg = "$ToolName installation failed" - if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) { - $showNativeToolsWarning = $true - if ((Get-Variable 'DoNotDisplayNativeToolsInstallationWarnings' -ErrorAction 'SilentlyContinue') -and $DoNotDisplayNativeToolsInstallationWarnings) { - $showNativeToolsWarning = $false - } - if ($showNativeToolsWarning) { - Write-Warning $errMsg - } - $toolInstallationFailure = $true - } else { - # We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482 - Write-Host $errMsg - exit 1 - } - } - } - - if ((Get-Variable 'toolInstallationFailure' -ErrorAction 'SilentlyContinue') -and $toolInstallationFailure) { - # We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482 - Write-Host 'Native tools bootstrap failed' - exit 1 - } - } - } - else { - Write-Host 'No native tools defined in global.json' - exit 0 - } - - if ($Clean) { - exit 0 - } - if (Test-Path $InstallBin) { - Write-Host 'Native tools are available from ' (Convert-Path -Path $InstallBin) - Write-Host "##vso[task.prependpath]$(Convert-Path -Path $InstallBin)" - return $InstallBin - } - elseif (-not ($PathPromotion)) { - Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message 'Native tools install directory does not exist, installation failed' - exit 1 - } - exit 0 -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/init-tools-native.sh b/src/arcade/eng/common/init-tools-native.sh deleted file mode 100644 index 3e6a8d6acf2f..000000000000 --- a/src/arcade/eng/common/init-tools-native.sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE[0]}" -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -base_uri='https://netcorenativeassets.blob.core.windows.net/resource-packages/external' -install_directory='' -clean=false -force=false -download_retries=5 -retry_wait_time_seconds=30 -global_json_file="$(dirname "$(dirname "${scriptroot}")")/global.json" -declare -a native_assets - -. $scriptroot/pipeline-logging-functions.sh -. $scriptroot/native/common-library.sh - -while (($# > 0)); do - lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" - case $lowerI in - --baseuri) - base_uri=$2 - shift 2 - ;; - --installdirectory) - install_directory=$2 - shift 2 - ;; - --clean) - clean=true - shift 1 - ;; - --force) - force=true - shift 1 - ;; - --donotabortonfailure) - donotabortonfailure=true - shift 1 - ;; - --donotdisplaywarnings) - donotdisplaywarnings=true - shift 1 - ;; - --downloadretries) - download_retries=$2 - shift 2 - ;; - --retrywaittimeseconds) - retry_wait_time_seconds=$2 - shift 2 - ;; - --help) - echo "Common settings:" - echo " --installdirectory Directory to install native toolset." - echo " This is a command-line override for the default" - echo " Install directory precedence order:" - echo " - InstallDirectory command-line override" - echo " - NETCOREENG_INSTALL_DIRECTORY environment variable" - echo " - (default) %USERPROFILE%/.netcoreeng/native" - echo "" - echo " --clean Switch specifying not to install anything, but cleanup native asset folders" - echo " --donotabortonfailure Switch specifiying whether to abort native tools installation on failure" - echo " --donotdisplaywarnings Switch specifiying whether to display warnings during native tools installation on failure" - echo " --force Clean and then install tools" - echo " --help Print help and exit" - echo "" - echo "Advanced settings:" - echo " --baseuri Base URI for where to download native tools from" - echo " --downloadretries Number of times a download should be attempted" - echo " --retrywaittimeseconds Wait time between download attempts" - echo "" - exit 0 - ;; - esac -done - -function ReadGlobalJsonNativeTools { - # happy path: we have a proper JSON parsing tool `jq(1)` in PATH! - if command -v jq &> /dev/null; then - - # jq: read each key/value pair under "native-tools" entry and emit: - # KEY="" VALUE="" - # followed by a null byte. - # - # bash: read line with null byte delimeter and push to array (for later `eval`uation). - - while IFS= read -rd '' line; do - native_assets+=("$line") - done < <(jq -r '. | - select(has("native-tools")) | - ."native-tools" | - keys[] as $k | - @sh "KEY=\($k) VALUE=\(.[$k])\u0000"' "$global_json_file") - - return - fi - - # Warning: falling back to manually parsing JSON, which is not recommended. - - # Following routine matches the output and escaping logic of jq(1)'s @sh formatter used above. - # It has been tested with several weird strings with escaped characters in entries (key and value) - # and results were compared with the output of jq(1) in binary representation using xxd(1); - # just before the assignment to 'native_assets' array (above and below). - - # try to capture the section under "native-tools". - if [[ ! "$(cat "$global_json_file")" =~ \"native-tools\"[[:space:]\:\{]*([^\}]+) ]]; then - return - fi - - section="${BASH_REMATCH[1]}" - - parseStarted=0 - possibleEnd=0 - escaping=0 - escaped=0 - isKey=1 - - for (( i=0; i<${#section}; i++ )); do - char="${section:$i:1}" - if ! ((parseStarted)) && [[ "$char" =~ [[:space:],:] ]]; then continue; fi - - if ! ((escaping)) && [[ "$char" == "\\" ]]; then - escaping=1 - elif ((escaping)) && ! ((escaped)); then - escaped=1 - fi - - if ! ((parseStarted)) && [[ "$char" == "\"" ]]; then - parseStarted=1 - possibleEnd=0 - elif [[ "$char" == "'" ]]; then - token="$token'\\\''" - possibleEnd=0 - elif ((escaping)) || [[ "$char" != "\"" ]]; then - token="$token$char" - possibleEnd=1 - fi - - if ((possibleEnd)) && ! ((escaping)) && [[ "$char" == "\"" ]]; then - # Use printf to unescape token to match jq(1)'s @sh formatting rules. - # do not use 'token="$(printf "$token")"' syntax, as $() eats the trailing linefeed. - printf -v token "'$token'" - - if ((isKey)); then - KEY="$token" - isKey=0 - else - line="KEY=$KEY VALUE=$token" - native_assets+=("$line") - isKey=1 - fi - - # reset for next token - parseStarted=0 - token= - elif ((escaping)) && ((escaped)); then - escaping=0 - escaped=0 - fi - done -} - -native_base_dir=$install_directory -if [[ -z $install_directory ]]; then - native_base_dir=$(GetNativeInstallDirectory) -fi - -install_bin="${native_base_dir}/bin" -installed_any=false - -ReadGlobalJsonNativeTools - -if [[ ${#native_assets[@]} -eq 0 ]]; then - echo "No native tools defined in global.json" - exit 0; -else - native_installer_dir="$scriptroot/native" - for index in "${!native_assets[@]}"; do - eval "${native_assets["$index"]}" - - installer_path="$native_installer_dir/install-$KEY.sh" - installer_command="$installer_path" - installer_command+=" --baseuri $base_uri" - installer_command+=" --installpath $install_bin" - installer_command+=" --version $VALUE" - echo $installer_command - - if [[ $force = true ]]; then - installer_command+=" --force" - fi - - if [[ $clean = true ]]; then - installer_command+=" --clean" - fi - - if [[ -a $installer_path ]]; then - $installer_command - if [[ $? != 0 ]]; then - if [[ $donotabortonfailure = true ]]; then - if [[ $donotdisplaywarnings != true ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" - fi - else - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" - exit 1 - fi - else - $installed_any = true - fi - else - if [[ $donotabortonfailure == true ]]; then - if [[ $donotdisplaywarnings != true ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script" - fi - else - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script" - exit 1 - fi - fi - done -fi - -if [[ $clean = true ]]; then - exit 0 -fi - -if [[ -d $install_bin ]]; then - echo "Native tools are available from $install_bin" - echo "##vso[task.prependpath]$install_bin" -else - if [[ $installed_any = true ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Native tools install directory does not exist, installation failed" - exit 1 - fi -fi - -exit 0 diff --git a/src/arcade/eng/common/internal-feed-operations.ps1 b/src/arcade/eng/common/internal-feed-operations.ps1 deleted file mode 100644 index 92b77347d990..000000000000 --- a/src/arcade/eng/common/internal-feed-operations.ps1 +++ /dev/null @@ -1,132 +0,0 @@ -param( - [Parameter(Mandatory=$true)][string] $Operation, - [string] $AuthToken, - [string] $CommitSha, - [string] $RepoName, - [switch] $IsFeedPrivate -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 -. $PSScriptRoot\tools.ps1 - -# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed -# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in -# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. This should ONLY be called from identified -# internal builds -function SetupCredProvider { - param( - [string] $AuthToken - ) - - # Install the Cred Provider NuGet plugin - Write-Host 'Setting up Cred Provider NuGet plugin in the agent...' - Write-Host "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..." - - $url = 'https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1' - - Write-Host "Writing the contents of 'installcredprovider.ps1' locally..." - Invoke-WebRequest $url -OutFile installcredprovider.ps1 - - Write-Host 'Installing plugin...' - .\installcredprovider.ps1 -Force - - Write-Host "Deleting local copy of 'installcredprovider.ps1'..." - Remove-Item .\installcredprovider.ps1 - - if (-Not("$env:USERPROFILE\.nuget\plugins\netcore")) { - Write-PipelineTelemetryError -Category 'Arcade' -Message 'CredProvider plugin was not installed correctly!' - ExitWithExitCode 1 - } - else { - Write-Host 'CredProvider plugin was installed correctly!' - } - - # Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable - # feeds successfully - - $nugetConfigPath = Join-Path $RepoRoot "NuGet.config" - - if (-Not (Test-Path -Path $nugetConfigPath)) { - Write-PipelineTelemetryError -Category 'Build' -Message 'NuGet.config file not found in repo root!' - ExitWithExitCode 1 - } - - $endpoints = New-Object System.Collections.ArrayList - $nugetConfigPackageSources = Select-Xml -Path $nugetConfigPath -XPath "//packageSources/add[contains(@key, 'darc-int-')]/@value" | foreach{$_.Node.Value} - - if (($nugetConfigPackageSources | Measure-Object).Count -gt 0 ) { - foreach ($stableRestoreResource in $nugetConfigPackageSources) { - $trimmedResource = ([string]$stableRestoreResource).Trim() - [void]$endpoints.Add(@{endpoint="$trimmedResource"; password="$AuthToken"}) - } - } - - if (($endpoints | Measure-Object).Count -gt 0) { - $endpointCredentials = @{endpointCredentials=$endpoints} | ConvertTo-Json -Compress - - # Create the environment variables the AzDo way - Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $endpointCredentials -Properties @{ - 'variable' = 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' - 'issecret' = 'false' - } - - # We don't want sessions cached since we will be updating the endpoints quite frequently - Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data 'False' -Properties @{ - 'variable' = 'NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED' - 'issecret' = 'false' - } - } - else - { - Write-Host 'No internal endpoints found in NuGet.config' - } -} - -#Workaround for https://github.com/microsoft/msbuild/issues/4430 -function InstallDotNetSdkAndRestoreArcade { - $dotnetTempDir = Join-Path $RepoRoot "dotnet" - $dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*) - $dotnet = "$dotnetTempDir\dotnet.exe" - $restoreProjPath = "$PSScriptRoot\restore.proj" - - Write-Host "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..." - InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion" - - '' | Out-File "$restoreProjPath" - - & $dotnet restore $restoreProjPath - - Write-Host 'Arcade SDK restored!' - - if (Test-Path -Path $restoreProjPath) { - Remove-Item $restoreProjPath - } - - if (Test-Path -Path $dotnetTempDir) { - Remove-Item $dotnetTempDir -Recurse - } -} - -try { - Push-Location $PSScriptRoot - - if ($Operation -like 'setup') { - SetupCredProvider $AuthToken - } - elseif ($Operation -like 'install-restore') { - InstallDotNetSdkAndRestoreArcade - } - else { - Write-PipelineTelemetryError -Category 'Arcade' -Message "Unknown operation '$Operation'!" - ExitWithExitCode 1 - } -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'Arcade' -Message $_ - ExitWithExitCode 1 -} -finally { - Pop-Location -} diff --git a/src/arcade/eng/common/internal-feed-operations.sh b/src/arcade/eng/common/internal-feed-operations.sh deleted file mode 100644 index 9378223ba095..000000000000 --- a/src/arcade/eng/common/internal-feed-operations.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed -# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in -# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. -# This should ONLY be called from identified internal builds -function SetupCredProvider { - local authToken=$1 - - # Install the Cred Provider NuGet plugin - echo "Setting up Cred Provider NuGet plugin in the agent..."... - echo "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..." - - local url="https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh" - - echo "Writing the contents of 'installcredprovider.ps1' locally..." - local installcredproviderPath="installcredprovider.sh" - if command -v curl > /dev/null; then - curl $url > "$installcredproviderPath" - else - wget -q -O "$installcredproviderPath" "$url" - fi - - echo "Installing plugin..." - . "$installcredproviderPath" - - echo "Deleting local copy of 'installcredprovider.sh'..." - rm installcredprovider.sh - - if [ ! -d "$HOME/.nuget/plugins" ]; then - Write-PipelineTelemetryError -category 'Build' 'CredProvider plugin was not installed correctly!' - ExitWithExitCode 1 - else - echo "CredProvider plugin was installed correctly!" - fi - - # Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable - # feeds successfully - - local nugetConfigPath="{$repo_root}NuGet.config" - - if [ ! "$nugetConfigPath" ]; then - Write-PipelineTelemetryError -category 'Build' "NuGet.config file not found in repo's root!" - ExitWithExitCode 1 - fi - - local endpoints='[' - local nugetConfigPackageValues=`cat "$nugetConfigPath" | grep "key=\"darc-int-"` - local pattern="value=\"(.*)\"" - - for value in $nugetConfigPackageValues - do - if [[ $value =~ $pattern ]]; then - local endpoint="${BASH_REMATCH[1]}" - endpoints+="{\"endpoint\": \"$endpoint\", \"password\": \"$authToken\"}," - fi - done - - endpoints=${endpoints%?} - endpoints+=']' - - if [ ${#endpoints} -gt 2 ]; then - local endpointCredentials="{\"endpointCredentials\": "$endpoints"}" - - echo "##vso[task.setvariable variable=VSS_NUGET_EXTERNAL_FEED_ENDPOINTS]$endpointCredentials" - echo "##vso[task.setvariable variable=NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED]False" - else - echo "No internal endpoints found in NuGet.config" - fi -} - -# Workaround for https://github.com/microsoft/msbuild/issues/4430 -function InstallDotNetSdkAndRestoreArcade { - local dotnetTempDir="$repo_root/dotnet" - local dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*) - local restoreProjPath="$repo_root/eng/common/restore.proj" - - echo "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..." - echo "" > "$restoreProjPath" - - InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion" - - local res=`$dotnetTempDir/dotnet restore $restoreProjPath` - echo "Arcade SDK restored!" - - # Cleanup - if [ "$restoreProjPath" ]; then - rm "$restoreProjPath" - fi - - if [ "$dotnetTempDir" ]; then - rm -r $dotnetTempDir - fi -} - -source="${BASH_SOURCE[0]}" -operation='' -authToken='' -repoName='' - -while [[ $# > 0 ]]; do - opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - --operation) - operation=$2 - shift - ;; - --authtoken) - authToken=$2 - shift - ;; - *) - echo "Invalid argument: $1" - usage - exit 1 - ;; - esac - - shift -done - -while [[ -h "$source" ]]; do - scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - source="$(readlink "$source")" - # if $source was a relative symlink, we need to resolve it relative to the path where the - # symlink file was located - [[ $source != /* ]] && source="$scriptroot/$source" -done -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -. "$scriptroot/tools.sh" - -if [ "$operation" = "setup" ]; then - SetupCredProvider $authToken -elif [ "$operation" = "install-restore" ]; then - InstallDotNetSdkAndRestoreArcade -else - echo "Unknown operation '$operation'!" -fi diff --git a/src/arcade/eng/common/internal/NuGet.config b/src/arcade/eng/common/internal/NuGet.config deleted file mode 100644 index 19d3d311b166..000000000000 --- a/src/arcade/eng/common/internal/NuGet.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss b/src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss deleted file mode 100644 index 5d892d619398..000000000000 --- a/src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/arcade/eng/common/msbuild.ps1 b/src/arcade/eng/common/msbuild.ps1 deleted file mode 100644 index f041e5ddd958..000000000000 --- a/src/arcade/eng/common/msbuild.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -[CmdletBinding(PositionalBinding=$false)] -Param( - [string] $verbosity = 'minimal', - [bool] $warnAsError = $true, - [bool] $nodeReuse = $true, - [switch] $ci, - [switch] $prepareMachine, - [switch] $excludePrereleaseVS, - [string] $msbuildEngine = $null, - [Parameter(ValueFromRemainingArguments=$true)][String[]]$extraArgs -) - -. $PSScriptRoot\tools.ps1 - -try { - if ($ci) { - $nodeReuse = $false - } - - MSBuild @extraArgs -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'Build' -Message $_ - ExitWithExitCode 1 -} - -ExitWithExitCode 0 \ No newline at end of file diff --git a/src/arcade/eng/common/msbuild.sh b/src/arcade/eng/common/msbuild.sh deleted file mode 100644 index 20d3dad54352..000000000000 --- a/src/arcade/eng/common/msbuild.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE[0]}" - -# resolve $source until the file is no longer a symlink -while [[ -h "$source" ]]; do - scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - source="$(readlink "$source")" - # if $source was a relative symlink, we need to resolve it relative to the path where the - # symlink file was located - [[ $source != /* ]] && source="$scriptroot/$source" -done -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -verbosity='minimal' -warn_as_error=true -node_reuse=true -prepare_machine=false -extra_args='' - -while (($# > 0)); do - lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" - case $lowerI in - --verbosity) - verbosity=$2 - shift 2 - ;; - --warnaserror) - warn_as_error=$2 - shift 2 - ;; - --nodereuse) - node_reuse=$2 - shift 2 - ;; - --ci) - ci=true - shift 1 - ;; - --preparemachine) - prepare_machine=true - shift 1 - ;; - *) - extra_args="$extra_args $1" - shift 1 - ;; - esac -done - -. "$scriptroot/tools.sh" - -if [[ "$ci" == true ]]; then - node_reuse=false -fi - -MSBuild $extra_args -ExitWithExitCode 0 diff --git a/src/arcade/eng/common/native/common-library.sh b/src/arcade/eng/common/native/common-library.sh deleted file mode 100644 index 080c2c283ae4..000000000000 --- a/src/arcade/eng/common/native/common-library.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env bash - -function GetNativeInstallDirectory { - local install_dir - - if [[ -z $NETCOREENG_INSTALL_DIRECTORY ]]; then - install_dir=$HOME/.netcoreeng/native/ - else - install_dir=$NETCOREENG_INSTALL_DIRECTORY - fi - - echo $install_dir - return 0 -} - -function GetTempDirectory { - - echo $(GetNativeInstallDirectory)temp/ - return 0 -} - -function ExpandZip { - local zip_path=$1 - local output_directory=$2 - local force=${3:-false} - - echo "Extracting $zip_path to $output_directory" - if [[ -d $output_directory ]] && [[ $force = false ]]; then - echo "Directory '$output_directory' already exists, skipping extract" - return 0 - fi - - if [[ -d $output_directory ]]; then - echo "'Force flag enabled, but '$output_directory' exists. Removing directory" - rm -rf $output_directory - if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Unable to remove '$output_directory'" - return 1 - fi - fi - - echo "Creating directory: '$output_directory'" - mkdir -p $output_directory - - echo "Extracting archive" - tar -xf $zip_path -C $output_directory - if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Unable to extract '$zip_path'" - return 1 - fi - - return 0 -} - -function GetCurrentOS { - local unameOut="$(uname -s)" - case $unameOut in - Linux*) echo "Linux";; - Darwin*) echo "MacOS";; - esac - return 0 -} - -function GetFile { - local uri=$1 - local path=$2 - local force=${3:-false} - local download_retries=${4:-5} - local retry_wait_time_seconds=${5:-30} - - if [[ -f $path ]]; then - if [[ $force = false ]]; then - echo "File '$path' already exists. Skipping download" - return 0 - else - rm -rf $path - fi - fi - - if [[ -f $uri ]]; then - echo "'$uri' is a file path, copying file to '$path'" - cp $uri $path - return $? - fi - - echo "Downloading $uri" - # Use curl if available, otherwise use wget - if command -v curl > /dev/null; then - curl "$uri" -sSL --retry $download_retries --retry-delay $retry_wait_time_seconds --create-dirs -o "$path" --fail - else - wget -q -O "$path" "$uri" --tries="$download_retries" - fi - - return $? -} - -function GetTempPathFileName { - local path=$1 - - local temp_dir=$(GetTempDirectory) - local temp_file_name=$(basename $path) - echo $temp_dir$temp_file_name - return 0 -} - -function DownloadAndExtract { - local uri=$1 - local installDir=$2 - local force=${3:-false} - local download_retries=${4:-5} - local retry_wait_time_seconds=${5:-30} - - local temp_tool_path=$(GetTempPathFileName $uri) - - echo "downloading to: $temp_tool_path" - - # Download file - GetFile "$uri" "$temp_tool_path" $force $download_retries $retry_wait_time_seconds - if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Failed to download '$uri' to '$temp_tool_path'." - return 1 - fi - - # Extract File - echo "extracting from $temp_tool_path to $installDir" - ExpandZip "$temp_tool_path" "$installDir" $force $download_retries $retry_wait_time_seconds - if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Failed to extract '$temp_tool_path' to '$installDir'." - return 1 - fi - - return 0 -} - -function NewScriptShim { - local shimpath=$1 - local tool_file_path=$2 - local force=${3:-false} - - echo "Generating '$shimpath' shim" - if [[ -f $shimpath ]]; then - if [[ $force = false ]]; then - echo "File '$shimpath' already exists." >&2 - return 1 - else - rm -rf $shimpath - fi - fi - - if [[ ! -f $tool_file_path ]]; then - # try to see if the path is lower cased - tool_file_path="$(echo $tool_file_path | tr "[:upper:]" "[:lower:]")" - if [[ ! -f $tool_file_path ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Specified tool file path:'$tool_file_path' does not exist" - return 1 - fi - fi - - local shim_contents=$'#!/usr/bin/env bash\n' - shim_contents+="SHIMARGS="$'$1\n' - shim_contents+="$tool_file_path"$' $SHIMARGS\n' - - # Write shim file - echo "$shim_contents" > $shimpath - - chmod +x $shimpath - - echo "Finished generating shim '$shimpath'" - - return $? -} - diff --git a/src/arcade/eng/common/native/install-cmake-test.sh b/src/arcade/eng/common/native/install-cmake-test.sh deleted file mode 100644 index 8a5e7cf0db5a..000000000000 --- a/src/arcade/eng/common/native/install-cmake-test.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE[0]}" -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -. $scriptroot/common-library.sh - -base_uri= -install_path= -version= -clean=false -force=false -download_retries=5 -retry_wait_time_seconds=30 - -while (($# > 0)); do - lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" - case $lowerI in - --baseuri) - base_uri=$2 - shift 2 - ;; - --installpath) - install_path=$2 - shift 2 - ;; - --version) - version=$2 - shift 2 - ;; - --clean) - clean=true - shift 1 - ;; - --force) - force=true - shift 1 - ;; - --downloadretries) - download_retries=$2 - shift 2 - ;; - --retrywaittimeseconds) - retry_wait_time_seconds=$2 - shift 2 - ;; - --help) - echo "Common settings:" - echo " --baseuri Base file directory or Url wrom which to acquire tool archives" - echo " --installpath Base directory to install native tool to" - echo " --clean Don't install the tool, just clean up the current install of the tool" - echo " --force Force install of tools even if they previously exist" - echo " --help Print help and exit" - echo "" - echo "Advanced settings:" - echo " --downloadretries Total number of retry attempts" - echo " --retrywaittimeseconds Wait time between retry attempts in seconds" - echo "" - exit 0 - ;; - esac -done - -tool_name="cmake-test" -tool_os=$(GetCurrentOS) -tool_folder="$(echo $tool_os | tr "[:upper:]" "[:lower:]")" -tool_arch="x86_64" -tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch" -tool_install_directory="$install_path/$tool_name/$version" -tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name" -shim_path="$install_path/$tool_name.sh" -uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz" - -# Clean up tool and installers -if [[ $clean = true ]]; then - echo "Cleaning $tool_install_directory" - if [[ -d $tool_install_directory ]]; then - rm -rf $tool_install_directory - fi - - echo "Cleaning $shim_path" - if [[ -f $shim_path ]]; then - rm -rf $shim_path - fi - - tool_temp_path=$(GetTempPathFileName $uri) - echo "Cleaning $tool_temp_path" - if [[ -f $tool_temp_path ]]; then - rm -rf $tool_temp_path - fi - - exit 0 -fi - -# Install tool -if [[ -f $tool_file_path ]] && [[ $force = false ]]; then - echo "$tool_name ($version) already exists, skipping install" - exit 0 -fi - -DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds - -if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Installation failed' - exit 1 -fi - -# Generate Shim -# Always rewrite shims so that we are referencing the expected version -NewScriptShim $shim_path $tool_file_path true - -if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Shim generation failed' - exit 1 -fi - -exit 0 diff --git a/src/arcade/eng/common/native/install-cmake.sh b/src/arcade/eng/common/native/install-cmake.sh deleted file mode 100644 index de496beebc5a..000000000000 --- a/src/arcade/eng/common/native/install-cmake.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE[0]}" -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -. $scriptroot/common-library.sh - -base_uri= -install_path= -version= -clean=false -force=false -download_retries=5 -retry_wait_time_seconds=30 - -while (($# > 0)); do - lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" - case $lowerI in - --baseuri) - base_uri=$2 - shift 2 - ;; - --installpath) - install_path=$2 - shift 2 - ;; - --version) - version=$2 - shift 2 - ;; - --clean) - clean=true - shift 1 - ;; - --force) - force=true - shift 1 - ;; - --downloadretries) - download_retries=$2 - shift 2 - ;; - --retrywaittimeseconds) - retry_wait_time_seconds=$2 - shift 2 - ;; - --help) - echo "Common settings:" - echo " --baseuri Base file directory or Url wrom which to acquire tool archives" - echo " --installpath Base directory to install native tool to" - echo " --clean Don't install the tool, just clean up the current install of the tool" - echo " --force Force install of tools even if they previously exist" - echo " --help Print help and exit" - echo "" - echo "Advanced settings:" - echo " --downloadretries Total number of retry attempts" - echo " --retrywaittimeseconds Wait time between retry attempts in seconds" - echo "" - exit 0 - ;; - esac -done - -tool_name="cmake" -tool_os=$(GetCurrentOS) -tool_folder="$(echo $tool_os | tr "[:upper:]" "[:lower:]")" -tool_arch="x86_64" -tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch" -tool_install_directory="$install_path/$tool_name/$version" -tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name" -shim_path="$install_path/$tool_name.sh" -uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz" - -# Clean up tool and installers -if [[ $clean = true ]]; then - echo "Cleaning $tool_install_directory" - if [[ -d $tool_install_directory ]]; then - rm -rf $tool_install_directory - fi - - echo "Cleaning $shim_path" - if [[ -f $shim_path ]]; then - rm -rf $shim_path - fi - - tool_temp_path=$(GetTempPathFileName $uri) - echo "Cleaning $tool_temp_path" - if [[ -f $tool_temp_path ]]; then - rm -rf $tool_temp_path - fi - - exit 0 -fi - -# Install tool -if [[ -f $tool_file_path ]] && [[ $force = false ]]; then - echo "$tool_name ($version) already exists, skipping install" - exit 0 -fi - -DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds - -if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Installation failed' - exit 1 -fi - -# Generate Shim -# Always rewrite shims so that we are referencing the expected version -NewScriptShim $shim_path $tool_file_path true - -if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Shim generation failed' - exit 1 -fi - -exit 0 diff --git a/src/arcade/eng/common/native/install-tool.ps1 b/src/arcade/eng/common/native/install-tool.ps1 deleted file mode 100644 index 78f2d84a4e4b..000000000000 --- a/src/arcade/eng/common/native/install-tool.ps1 +++ /dev/null @@ -1,132 +0,0 @@ -<# -.SYNOPSIS -Install native tool - -.DESCRIPTION -Install cmake native tool from Azure blob storage - -.PARAMETER InstallPath -Base directory to install native tool to - -.PARAMETER BaseUri -Base file directory or Url from which to acquire tool archives - -.PARAMETER CommonLibraryDirectory -Path to folder containing common library modules - -.PARAMETER Force -Force install of tools even if they previously exist - -.PARAMETER Clean -Don't install the tool, just clean up the current install of the tool - -.PARAMETER DownloadRetries -Total number of retry attempts - -.PARAMETER RetryWaitTimeInSeconds -Wait time between retry attempts in seconds - -.NOTES -Returns 0 if install succeeds, 1 otherwise -#> -[CmdletBinding(PositionalBinding=$false)] -Param ( - [Parameter(Mandatory=$True)] - [string] $ToolName, - [Parameter(Mandatory=$True)] - [string] $InstallPath, - [Parameter(Mandatory=$True)] - [string] $BaseUri, - [Parameter(Mandatory=$True)] - [string] $Version, - [string] $CommonLibraryDirectory = $PSScriptRoot, - [switch] $Force = $False, - [switch] $Clean = $False, - [int] $DownloadRetries = 5, - [int] $RetryWaitTimeInSeconds = 30 -) - -. $PSScriptRoot\..\pipeline-logging-functions.ps1 - -# Import common library modules -Import-Module -Name (Join-Path $CommonLibraryDirectory "CommonLibrary.psm1") - -try { - # Define verbose switch if undefined - $Verbose = $VerbosePreference -Eq "Continue" - - $Arch = CommonLibrary\Get-MachineArchitecture - $ToolOs = "win64" - if($Arch -Eq "x32") { - $ToolOs = "win32" - } - $ToolNameMoniker = "$ToolName-$Version-$ToolOs-$Arch" - $ToolInstallDirectory = Join-Path $InstallPath "$ToolName\$Version\" - $Uri = "$BaseUri/windows/$ToolName/$ToolNameMoniker.zip" - $ShimPath = Join-Path $InstallPath "$ToolName.exe" - - if ($Clean) { - Write-Host "Cleaning $ToolInstallDirectory" - if (Test-Path $ToolInstallDirectory) { - Remove-Item $ToolInstallDirectory -Force -Recurse - } - Write-Host "Cleaning $ShimPath" - if (Test-Path $ShimPath) { - Remove-Item $ShimPath -Force - } - $ToolTempPath = CommonLibrary\Get-TempPathFilename -Path $Uri - Write-Host "Cleaning $ToolTempPath" - if (Test-Path $ToolTempPath) { - Remove-Item $ToolTempPath -Force - } - exit 0 - } - - # Install tool - if ((Test-Path $ToolInstallDirectory) -And (-Not $Force)) { - Write-Verbose "$ToolName ($Version) already exists, skipping install" - } - else { - $InstallStatus = CommonLibrary\DownloadAndExtract -Uri $Uri ` - -InstallDirectory $ToolInstallDirectory ` - -Force:$Force ` - -DownloadRetries $DownloadRetries ` - -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` - -Verbose:$Verbose - - if ($InstallStatus -Eq $False) { - Write-PipelineTelemetryError "Installation failed" -Category "NativeToolsetBootstrapping" - exit 1 - } - } - - $ToolFilePath = Get-ChildItem $ToolInstallDirectory -Recurse -Filter "$ToolName.exe" | % { $_.FullName } - if (@($ToolFilePath).Length -Gt 1) { - Write-Error "There are multiple copies of $ToolName in $($ToolInstallDirectory): `n$(@($ToolFilePath | out-string))" - exit 1 - } elseif (@($ToolFilePath).Length -Lt 1) { - Write-Host "$ToolName was not found in $ToolInstallDirectory." - exit 1 - } - - # Generate shim - # Always rewrite shims so that we are referencing the expected version - $GenerateShimStatus = CommonLibrary\New-ScriptShim -ShimName $ToolName ` - -ShimDirectory $InstallPath ` - -ToolFilePath "$ToolFilePath" ` - -BaseUri $BaseUri ` - -Force:$Force ` - -Verbose:$Verbose - - if ($GenerateShimStatus -Eq $False) { - Write-PipelineTelemetryError "Generate shim failed" -Category "NativeToolsetBootstrapping" - return 1 - } - - exit 0 -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category "NativeToolsetBootstrapping" -Message $_ - exit 1 -} diff --git a/src/arcade/eng/common/pipeline-logging-functions.ps1 b/src/arcade/eng/common/pipeline-logging-functions.ps1 deleted file mode 100644 index 8e422c561e4b..000000000000 --- a/src/arcade/eng/common/pipeline-logging-functions.ps1 +++ /dev/null @@ -1,260 +0,0 @@ -# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1 and modified. - -# NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1 - -$script:loggingCommandPrefix = '##vso[' -$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"? - New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' } - New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' } - New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' } - New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' } -) -# TODO: BUG: Escape % ??? -# TODO: Add test to verify don't need to escape "=". - -# Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set -function Write-PipelineTelemetryError { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [string]$Category, - [Parameter(Mandatory = $true)] - [string]$Message, - [Parameter(Mandatory = $false)] - [string]$Type = 'error', - [string]$ErrCode, - [string]$SourcePath, - [string]$LineNumber, - [string]$ColumnNumber, - [switch]$AsOutput, - [switch]$Force) - - $PSBoundParameters.Remove('Category') | Out-Null - - if ($Force -Or ((Test-Path variable:ci) -And $ci)) { - $Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message" - } - $PSBoundParameters.Remove('Message') | Out-Null - $PSBoundParameters.Add('Message', $Message) - Write-PipelineTaskError @PSBoundParameters -} - -# Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set -function Write-PipelineTaskError { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [string]$Message, - [Parameter(Mandatory = $false)] - [string]$Type = 'error', - [string]$ErrCode, - [string]$SourcePath, - [string]$LineNumber, - [string]$ColumnNumber, - [switch]$AsOutput, - [switch]$Force - ) - - if (!$Force -And (-Not (Test-Path variable:ci) -Or !$ci)) { - if ($Type -eq 'error') { - Write-Host $Message -ForegroundColor Red - return - } - elseif ($Type -eq 'warning') { - Write-Host $Message -ForegroundColor Yellow - return - } - } - - if (($Type -ne 'error') -and ($Type -ne 'warning')) { - Write-Host $Message - return - } - $PSBoundParameters.Remove('Force') | Out-Null - if (-not $PSBoundParameters.ContainsKey('Type')) { - $PSBoundParameters.Add('Type', 'error') - } - Write-LogIssue @PSBoundParameters -} - -function Write-PipelineSetVariable { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [string]$Name, - [string]$Value, - [switch]$Secret, - [switch]$AsOutput, - [bool]$IsMultiJobVariable = $true) - - if ((Test-Path variable:ci) -And $ci) { - Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{ - 'variable' = $Name - 'isSecret' = $Secret - 'isOutput' = $IsMultiJobVariable - } -AsOutput:$AsOutput - } -} - -function Write-PipelinePrependPath { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [string]$Path, - [switch]$AsOutput) - - if ((Test-Path variable:ci) -And $ci) { - Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput - } -} - -function Write-PipelineSetResult { - [CmdletBinding()] - param( - [ValidateSet("Succeeded", "SucceededWithIssues", "Failed", "Cancelled", "Skipped")] - [Parameter(Mandatory = $true)] - [string]$Result, - [string]$Message) - if ((Test-Path variable:ci) -And $ci) { - Write-LoggingCommand -Area 'task' -Event 'complete' -Data $Message -Properties @{ - 'result' = $Result - } - } -} - -<######################################## -# Private functions. -########################################> -function Format-LoggingCommandData { - [CmdletBinding()] - param([string]$Value, [switch]$Reverse) - - if (!$Value) { - return '' - } - - if (!$Reverse) { - foreach ($mapping in $script:loggingCommandEscapeMappings) { - $Value = $Value.Replace($mapping.Token, $mapping.Replacement) - } - } - else { - for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) { - $mapping = $script:loggingCommandEscapeMappings[$i] - $Value = $Value.Replace($mapping.Replacement, $mapping.Token) - } - } - - return $Value -} - -function Format-LoggingCommand { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [string]$Area, - [Parameter(Mandatory = $true)] - [string]$Event, - [string]$Data, - [hashtable]$Properties) - - # Append the preamble. - [System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder - $null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event) - - # Append the properties. - if ($Properties) { - $first = $true - foreach ($key in $Properties.Keys) { - [string]$value = Format-LoggingCommandData $Properties[$key] - if ($value) { - if ($first) { - $null = $sb.Append(' ') - $first = $false - } - else { - $null = $sb.Append(';') - } - - $null = $sb.Append("$key=$value") - } - } - } - - # Append the tail and output the value. - $Data = Format-LoggingCommandData $Data - $sb.Append(']').Append($Data).ToString() -} - -function Write-LoggingCommand { - [CmdletBinding(DefaultParameterSetName = 'Parameters')] - param( - [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] - [string]$Area, - [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] - [string]$Event, - [Parameter(ParameterSetName = 'Parameters')] - [string]$Data, - [Parameter(ParameterSetName = 'Parameters')] - [hashtable]$Properties, - [Parameter(Mandatory = $true, ParameterSetName = 'Object')] - $Command, - [switch]$AsOutput) - - if ($PSCmdlet.ParameterSetName -eq 'Object') { - Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput - return - } - - $command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties - if ($AsOutput) { - $command - } - else { - Write-Host $command - } -} - -function Write-LogIssue { - [CmdletBinding()] - param( - [ValidateSet('warning', 'error')] - [Parameter(Mandatory = $true)] - [string]$Type, - [string]$Message, - [string]$ErrCode, - [string]$SourcePath, - [string]$LineNumber, - [string]$ColumnNumber, - [switch]$AsOutput) - - $command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{ - 'type' = $Type - 'code' = $ErrCode - 'sourcepath' = $SourcePath - 'linenumber' = $LineNumber - 'columnnumber' = $ColumnNumber - } - if ($AsOutput) { - return $command - } - - if ($Type -eq 'error') { - $foregroundColor = $host.PrivateData.ErrorForegroundColor - $backgroundColor = $host.PrivateData.ErrorBackgroundColor - if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { - $foregroundColor = [System.ConsoleColor]::Red - $backgroundColor = [System.ConsoleColor]::Black - } - } - else { - $foregroundColor = $host.PrivateData.WarningForegroundColor - $backgroundColor = $host.PrivateData.WarningBackgroundColor - if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { - $foregroundColor = [System.ConsoleColor]::Yellow - $backgroundColor = [System.ConsoleColor]::Black - } - } - - Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor -} diff --git a/src/arcade/eng/common/pipeline-logging-functions.sh b/src/arcade/eng/common/pipeline-logging-functions.sh deleted file mode 100644 index 6a0b2255e911..000000000000 --- a/src/arcade/eng/common/pipeline-logging-functions.sh +++ /dev/null @@ -1,206 +0,0 @@ -#!/usr/bin/env bash - -function Write-PipelineTelemetryError { - local telemetry_category='' - local force=false - local function_args=() - local message='' - while [[ $# -gt 0 ]]; do - opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -category|-c) - telemetry_category=$2 - shift - ;; - -force|-f) - force=true - ;; - -*) - function_args+=("$1 $2") - shift - ;; - *) - message=$* - ;; - esac - shift - done - - if [[ $force != true ]] && [[ "$ci" != true ]]; then - echo "$message" >&2 - return - fi - - if [[ $force == true ]]; then - function_args+=("-force") - fi - message="(NETCORE_ENGINEERING_TELEMETRY=$telemetry_category) $message" - function_args+=("$message") - Write-PipelineTaskError ${function_args[@]} -} - -function Write-PipelineTaskError { - local message_type="error" - local sourcepath='' - local linenumber='' - local columnnumber='' - local error_code='' - local force=false - - while [[ $# -gt 0 ]]; do - opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -type|-t) - message_type=$2 - shift - ;; - -sourcepath|-s) - sourcepath=$2 - shift - ;; - -linenumber|-ln) - linenumber=$2 - shift - ;; - -columnnumber|-cn) - columnnumber=$2 - shift - ;; - -errcode|-e) - error_code=$2 - shift - ;; - -force|-f) - force=true - ;; - *) - break - ;; - esac - - shift - done - - if [[ $force != true ]] && [[ "$ci" != true ]]; then - echo "$@" >&2 - return - fi - - local message="##vso[task.logissue" - - message="$message type=$message_type" - - if [ -n "$sourcepath" ]; then - message="$message;sourcepath=$sourcepath" - fi - - if [ -n "$linenumber" ]; then - message="$message;linenumber=$linenumber" - fi - - if [ -n "$columnnumber" ]; then - message="$message;columnnumber=$columnnumber" - fi - - if [ -n "$error_code" ]; then - message="$message;code=$error_code" - fi - - message="$message]$*" - echo "$message" -} - -function Write-PipelineSetVariable { - if [[ "$ci" != true ]]; then - return - fi - - local name='' - local value='' - local secret=false - local as_output=false - local is_multi_job_variable=true - - while [[ $# -gt 0 ]]; do - opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -name|-n) - name=$2 - shift - ;; - -value|-v) - value=$2 - shift - ;; - -secret|-s) - secret=true - ;; - -as_output|-a) - as_output=true - ;; - -is_multi_job_variable|-i) - is_multi_job_variable=$2 - shift - ;; - esac - shift - done - - value=${value/;/%3B} - value=${value/\\r/%0D} - value=${value/\\n/%0A} - value=${value/]/%5D} - - local message="##vso[task.setvariable variable=$name;isSecret=$secret;isOutput=$is_multi_job_variable]$value" - - if [[ "$as_output" == true ]]; then - $message - else - echo "$message" - fi -} - -function Write-PipelinePrependPath { - local prepend_path='' - - while [[ $# -gt 0 ]]; do - opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -path|-p) - prepend_path=$2 - shift - ;; - esac - shift - done - - export PATH="$prepend_path:$PATH" - - if [[ "$ci" == true ]]; then - echo "##vso[task.prependpath]$prepend_path" - fi -} - -function Write-PipelineSetResult { - local result='' - local message='' - - while [[ $# -gt 0 ]]; do - opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -result|-r) - result=$2 - shift - ;; - -message|-m) - message=$2 - shift - ;; - esac - shift - done - - if [[ "$ci" == true ]]; then - echo "##vso[task.complete result=$result;]$message" - fi -} diff --git a/src/arcade/eng/common/retain-build.ps1 b/src/arcade/eng/common/retain-build.ps1 deleted file mode 100644 index e7ba975adeb6..000000000000 --- a/src/arcade/eng/common/retain-build.ps1 +++ /dev/null @@ -1,45 +0,0 @@ - -Param( -[Parameter(Mandatory=$true)][int] $buildId, -[Parameter(Mandatory=$true)][string] $azdoOrgUri, -[Parameter(Mandatory=$true)][string] $azdoProject, -[Parameter(Mandatory=$true)][string] $token -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 - -function Get-AzDOHeaders( - [string] $token) -{ - $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":${token}")) - $headers = @{"Authorization"="Basic $base64AuthInfo"} - return $headers -} - -function Update-BuildRetention( - [string] $azdoOrgUri, - [string] $azdoProject, - [int] $buildId, - [string] $token) -{ - $headers = Get-AzDOHeaders -token $token - $requestBody = "{ - `"keepForever`": `"true`" - }" - - $requestUri = "${azdoOrgUri}/${azdoProject}/_apis/build/builds/${buildId}?api-version=6.0" - write-Host "Attempting to retain build using the following URI: ${requestUri} ..." - - try { - Invoke-RestMethod -Uri $requestUri -Method Patch -Body $requestBody -Header $headers -contentType "application/json" - Write-Host "Updated retention settings for build ${buildId}." - } - catch { - Write-Error "Failed to update retention settings for build: $_.Exception.Response.StatusDescription" - exit 1 - } -} - -Update-BuildRetention -azdoOrgUri $azdoOrgUri -azdoProject $azdoProject -buildId $buildId -token $token -exit 0 diff --git a/src/arcade/eng/common/sdl/configure-sdl-tool.ps1 b/src/arcade/eng/common/sdl/configure-sdl-tool.ps1 deleted file mode 100644 index 27f5a4115fc7..000000000000 --- a/src/arcade/eng/common/sdl/configure-sdl-tool.ps1 +++ /dev/null @@ -1,130 +0,0 @@ -Param( - [string] $GuardianCliLocation, - [string] $WorkingDirectory, - [string] $TargetDirectory, - [string] $GdnFolder, - # The list of Guardian tools to configure. For each object in the array: - # - If the item is a [hashtable], it must contain these entries: - # - Name = The tool name as Guardian knows it. - # - Scenario = (Optional) Scenario-specific name for this configuration entry. It must be unique - # among all tool entries with the same Name. - # - Args = (Optional) Array of Guardian tool configuration args, like '@("Target > C:\temp")' - # - If the item is a [string] $v, it is treated as '@{ Name="$v" }' - [object[]] $ToolsList, - [string] $GuardianLoggerLevel='Standard', - # Optional: Additional params to add to any tool using CredScan. - [string[]] $CrScanAdditionalRunConfigParams, - # Optional: Additional params to add to any tool using PoliCheck. - [string[]] $PoliCheckAdditionalRunConfigParams, - # Optional: Additional params to add to any tool using CodeQL/Semmle. - [string[]] $CodeQLAdditionalRunConfigParams, - # Optional: Additional params to add to any tool using Binskim. - [string[]] $BinskimAdditionalRunConfigParams -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 -$disableConfigureToolsetImport = $true -$global:LASTEXITCODE = 0 - -try { - # `tools.ps1` checks $ci to perform some actions. Since the SDL - # scripts don't necessarily execute in the same agent that run the - # build.ps1/sh script this variable isn't automatically set. - $ci = $true - . $PSScriptRoot\..\tools.ps1 - - # Normalize tools list: all in [hashtable] form with defined values for each key. - $ToolsList = $ToolsList | - ForEach-Object { - if ($_ -is [string]) { - $_ = @{ Name = $_ } - } - - if (-not ($_['Scenario'])) { $_.Scenario = "" } - if (-not ($_['Args'])) { $_.Args = @() } - $_ - } - - Write-Host "List of tools to configure:" - $ToolsList | ForEach-Object { $_ | Out-String | Write-Host } - - # We store config files in the r directory of .gdn - $gdnConfigPath = Join-Path $GdnFolder 'r' - $ValidPath = Test-Path $GuardianCliLocation - - if ($ValidPath -eq $False) - { - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location." - ExitWithExitCode 1 - } - - foreach ($tool in $ToolsList) { - # Put together the name and scenario to make a unique key. - $toolConfigName = $tool.Name - if ($tool.Scenario) { - $toolConfigName += "_" + $tool.Scenario - } - - Write-Host "=== Configuring $toolConfigName..." - - $gdnConfigFile = Join-Path $gdnConfigPath "$toolConfigName-configure.gdnconfig" - - # For some tools, add default and automatic args. - switch -Exact ($tool.Name) { - 'credscan' { - if ($targetDirectory) { - $tool.Args += "`"TargetDirectory < $TargetDirectory`"" - } - $tool.Args += "`"OutputType < pre`"" - $tool.Args += $CrScanAdditionalRunConfigParams - } - 'policheck' { - if ($targetDirectory) { - $tool.Args += "`"Target < $TargetDirectory`"" - } - $tool.Args += $PoliCheckAdditionalRunConfigParams - } - {$_ -in 'semmle', 'codeql'} { - if ($targetDirectory) { - $tool.Args += "`"SourceCodeDirectory < $TargetDirectory`"" - } - $tool.Args += $CodeQLAdditionalRunConfigParams - } - 'binskim' { - if ($targetDirectory) { - # Binskim crashes due to specific PDBs. GitHub issue: https://github.com/microsoft/binskim/issues/924. - # We are excluding all `_.pdb` files from the scan. - $tool.Args += "`"Target < $TargetDirectory\**;-:file|$TargetDirectory\**\_.pdb`"" - } - $tool.Args += $BinskimAdditionalRunConfigParams - } - } - - # Create variable pointing to the args array directly so we can use splat syntax later. - $toolArgs = $tool.Args - - # Configure the tool. If args array is provided or the current tool has some default arguments - # defined, add "--args" and splat each element on the end. Arg format is "{Arg id} < {Value}", - # one per parameter. Doc page for "guardian configure": - # https://dev.azure.com/securitytools/SecurityIntegration/_wiki/wikis/Guardian/1395/configure - Exec-BlockVerbosely { - & $GuardianCliLocation configure ` - --working-directory $WorkingDirectory ` - --tool $tool.Name ` - --output-path $gdnConfigFile ` - --logger-level $GuardianLoggerLevel ` - --noninteractive ` - --force ` - $(if ($toolArgs) { "--args" }) @toolArgs - Exit-IfNZEC "Sdl" - } - - Write-Host "Created '$toolConfigName' configuration file: $gdnConfigFile" - } -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/sdl/extract-artifact-archives.ps1 b/src/arcade/eng/common/sdl/extract-artifact-archives.ps1 deleted file mode 100644 index 68da4fbf2571..000000000000 --- a/src/arcade/eng/common/sdl/extract-artifact-archives.ps1 +++ /dev/null @@ -1,63 +0,0 @@ -# This script looks for each archive file in a directory and extracts it into the target directory. -# For example, the file "$InputPath/bin.tar.gz" extracts to "$ExtractPath/bin.tar.gz.extracted/**". -# Uses the "tar" utility added to Windows 10 / Windows 2019 that supports tar.gz and zip. -param( - # Full path to directory where archives are stored. - [Parameter(Mandatory=$true)][string] $InputPath, - # Full path to directory to extract archives into. May be the same as $InputPath. - [Parameter(Mandatory=$true)][string] $ExtractPath -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 - -$disableConfigureToolsetImport = $true - -try { - # `tools.ps1` checks $ci to perform some actions. Since the SDL - # scripts don't necessarily execute in the same agent that run the - # build.ps1/sh script this variable isn't automatically set. - $ci = $true - . $PSScriptRoot\..\tools.ps1 - - Measure-Command { - $jobs = @() - - # Find archive files for non-Windows and Windows builds. - $archiveFiles = @( - Get-ChildItem (Join-Path $InputPath "*.tar.gz") - Get-ChildItem (Join-Path $InputPath "*.zip") - ) - - foreach ($targzFile in $archiveFiles) { - $jobs += Start-Job -ScriptBlock { - $file = $using:targzFile - $fileName = [System.IO.Path]::GetFileName($file) - $extractDir = Join-Path $using:ExtractPath "$fileName.extracted" - - New-Item $extractDir -ItemType Directory -Force | Out-Null - - Write-Host "Extracting '$file' to '$extractDir'..." - - # Pipe errors to stdout to prevent PowerShell detecting them and quitting the job early. - # This type of quit skips the catch, so we wouldn't be able to tell which file triggered the - # error. Save output so it can be stored in the exception string along with context. - $output = tar -xf $file -C $extractDir 2>&1 - # Handle NZEC manually rather than using Exit-IfNZEC: we are in a background job, so we - # don't have access to the outer scope. - if ($LASTEXITCODE -ne 0) { - throw "Error extracting '$file': non-zero exit code ($LASTEXITCODE). Output: '$output'" - } - - Write-Host "Extracted to $extractDir" - } - } - - Receive-Job $jobs -Wait - } -} -catch { - Write-Host $_ - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/sdl/extract-artifact-packages.ps1 b/src/arcade/eng/common/sdl/extract-artifact-packages.ps1 deleted file mode 100644 index f031ed5b25e9..000000000000 --- a/src/arcade/eng/common/sdl/extract-artifact-packages.ps1 +++ /dev/null @@ -1,82 +0,0 @@ -param( - [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where artifact packages are stored - [Parameter(Mandatory=$true)][string] $ExtractPath # Full path to directory where the packages will be extracted -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 - -$disableConfigureToolsetImport = $true - -function ExtractArtifacts { - if (!(Test-Path $InputPath)) { - Write-Host "Input Path does not exist: $InputPath" - ExitWithExitCode 0 - } - $Jobs = @() - Get-ChildItem "$InputPath\*.nupkg" | - ForEach-Object { - $Jobs += Start-Job -ScriptBlock $ExtractPackage -ArgumentList $_.FullName - } - - foreach ($Job in $Jobs) { - Wait-Job -Id $Job.Id | Receive-Job - } -} - -try { - # `tools.ps1` checks $ci to perform some actions. Since the SDL - # scripts don't necessarily execute in the same agent that run the - # build.ps1/sh script this variable isn't automatically set. - $ci = $true - . $PSScriptRoot\..\tools.ps1 - - $ExtractPackage = { - param( - [string] $PackagePath # Full path to a NuGet package - ) - - if (!(Test-Path $PackagePath)) { - Write-PipelineTelemetryError -Category 'Build' -Message "Input file does not exist: $PackagePath" - ExitWithExitCode 1 - } - - $RelevantExtensions = @('.dll', '.exe', '.pdb') - Write-Host -NoNewLine 'Extracting ' ([System.IO.Path]::GetFileName($PackagePath)) '...' - - $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) - $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId - - Add-Type -AssemblyName System.IO.Compression.FileSystem - - [System.IO.Directory]::CreateDirectory($ExtractPath); - - try { - $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) - - $zip.Entries | - Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} | - ForEach-Object { - $TargetPath = Join-Path -Path $ExtractPath -ChildPath (Split-Path -Path $_.FullName) - [System.IO.Directory]::CreateDirectory($TargetPath); - - $TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.FullName - [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile) - } - } - catch { - Write-Host $_ - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - ExitWithExitCode 1 - } - finally { - $zip.Dispose() - } - } - Measure-Command { ExtractArtifacts } -} -catch { - Write-Host $_ - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/sdl/packages.config b/src/arcade/eng/common/sdl/packages.config deleted file mode 100644 index e5f543ea68c2..000000000000 --- a/src/arcade/eng/common/sdl/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/arcade/eng/common/sdl/run-sdl.ps1 b/src/arcade/eng/common/sdl/run-sdl.ps1 deleted file mode 100644 index 2eac8c78f103..000000000000 --- a/src/arcade/eng/common/sdl/run-sdl.ps1 +++ /dev/null @@ -1,49 +0,0 @@ -Param( - [string] $GuardianCliLocation, - [string] $WorkingDirectory, - [string] $GdnFolder, - [string] $UpdateBaseline, - [string] $GuardianLoggerLevel='Standard' -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 -$disableConfigureToolsetImport = $true -$global:LASTEXITCODE = 0 - -try { - # `tools.ps1` checks $ci to perform some actions. Since the SDL - # scripts don't necessarily execute in the same agent that run the - # build.ps1/sh script this variable isn't automatically set. - $ci = $true - . $PSScriptRoot\..\tools.ps1 - - # We store config files in the r directory of .gdn - $gdnConfigPath = Join-Path $GdnFolder 'r' - $ValidPath = Test-Path $GuardianCliLocation - - if ($ValidPath -eq $False) - { - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location." - ExitWithExitCode 1 - } - - $gdnConfigFiles = Get-ChildItem $gdnConfigPath -Recurse -Include '*.gdnconfig' - Write-Host "Discovered Guardian config files:" - $gdnConfigFiles | Out-String | Write-Host - - Exec-BlockVerbosely { - & $GuardianCliLocation run ` - --working-directory $WorkingDirectory ` - --baseline mainbaseline ` - --update-baseline $UpdateBaseline ` - --logger-level $GuardianLoggerLevel ` - --config @gdnConfigFiles - Exit-IfNZEC "Sdl" - } -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/templates-official/variables/pool-providers.yml b/src/arcade/eng/common/templates-official/variables/pool-providers.yml deleted file mode 100644 index 1f308b24efc4..000000000000 --- a/src/arcade/eng/common/templates-official/variables/pool-providers.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Select a pool provider based off branch name. Anything with branch name containing 'release' must go into an -Svc pool, -# otherwise it should go into the "normal" pools. This separates out the queueing and billing of released branches. - -# Motivation: -# Once a given branch of a repository's output has been officially "shipped" once, it is then considered to be COGS -# (Cost of goods sold) and should be moved to a servicing pool provider. This allows both separation of queueing -# (allowing release builds and main PR builds to not intefere with each other) and billing (required for COGS. -# Additionally, the pool provider name itself may be subject to change when the .NET Core Engineering Services -# team needs to move resources around and create new and potentially differently-named pools. Using this template -# file from an Arcade-ified repo helps guard against both having to update one's release/* branches and renaming. - -# How to use: -# This yaml assumes your shipped product branches use the naming convention "release/..." (which many do). -# If we find alternate naming conventions in broad usage it can be added to the condition below. -# -# First, import the template in an arcade-ified repo to pick up the variables, e.g.: -# -# variables: -# - template: /eng/common/templates-official/variables/pool-providers.yml -# -# ... then anywhere specifying the pool provider use the runtime variables, -# $(DncEngInternalBuildPool) -# -# pool: -# name: $(DncEngInternalBuildPool) -# image: 1es-windows-2022 - -variables: - # Coalesce the target and source branches so we know when a PR targets a release branch - # If these variables are somehow missing, fall back to main (tends to have more capacity) - - # Any new -Svc alternative pools should have variables added here to allow for splitting work - - - name: DncEngInternalBuildPool - value: $[ - replace( - replace( - eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), - True, - 'NetCore1ESPool-Svc-Internal' - ), - False, - 'NetCore1ESPool-Internal' - ) - ] \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/variables/sdl-variables.yml b/src/arcade/eng/common/templates-official/variables/sdl-variables.yml deleted file mode 100644 index dbdd66d4a4b3..000000000000 --- a/src/arcade/eng/common/templates-official/variables/sdl-variables.yml +++ /dev/null @@ -1,7 +0,0 @@ -variables: -# The Guardian version specified in 'eng/common/sdl/packages.config'. This value must be kept in -# sync with the packages.config file. -- name: DefaultGuardianVersion - value: 0.109.0 -- name: GuardianPackagesConfigFile - value: $(Build.SourcesDirectory)\eng\common\sdl\packages.config \ No newline at end of file From 35d37c3c9d6ce3ff975628c407bd9c54aa3a25a2 Mon Sep 17 00:00:00 2001 From: Brennan Date: Wed, 4 Jun 2025 12:52:36 -0700 Subject: [PATCH 33/76] [IIS] Manually parse exe bitness (#61894) (#62037) --- .../CommonLib/HostFxrResolver.cpp | 72 +++++++++++++++---- .../CommonLib/HostFxrResolver.h | 2 + src/Servers/IIS/build/Build.Lib.Settings | 2 +- 3 files changed, 63 insertions(+), 13 deletions(-) diff --git a/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.cpp b/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.cpp index 9b12cd0132b4..8fb960261590 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.cpp @@ -197,7 +197,7 @@ HostFxrResolver::TryGetHostFxrPath( size_t size = MAX_PATH * 2; hostfxrPath.resize(size); - get_hostfxr_parameters params; + get_hostfxr_parameters params{}; params.size = sizeof(get_hostfxr_parameters); params.assembly_path = applicationPath.c_str(); params.dotnet_root = dotnetRoot.c_str(); @@ -393,7 +393,7 @@ HostFxrResolver::GetAbsolutePathToDotnetFromHostfxr(const fs::path& hostfxrPath) // Tries to call where.exe to find the location of dotnet.exe. // Will check that the bitness of dotnet matches the current // worker process bitness. -// Returns true if a valid dotnet was found, else false.R +// Returns true if a valid dotnet was found, else false. // std::optional HostFxrResolver::InvokeWhereToFindDotnet() @@ -415,8 +415,7 @@ HostFxrResolver::InvokeWhereToFindDotnet() DWORD dwExitCode; STRU struDotnetSubstring; STRU struDotnetLocationsString; - DWORD dwNumBytesRead; - DWORD dwBinaryType; + DWORD dwNumBytesRead = 0; INT index = 0; INT prevIndex = 0; std::optional result; @@ -521,14 +520,7 @@ HostFxrResolver::InvokeWhereToFindDotnet() LOG_INFOF(L"Processing entry '%ls'", struDotnetSubstring.QueryStr()); - if (LOG_LAST_ERROR_IF(!GetBinaryTypeW(struDotnetSubstring.QueryStr(), &dwBinaryType))) - { - continue; - } - - LOG_INFOF(L"Binary type %d", dwBinaryType); - - if (fIsCurrentProcess64Bit == (dwBinaryType == SCS_64BIT_BINARY)) + if (fIsCurrentProcess64Bit == IsX64(struDotnetSubstring.QueryStr())) { // The bitness of dotnet matched with the current worker process bitness. return std::make_optional(struDotnetSubstring.QueryStr()); @@ -539,6 +531,62 @@ HostFxrResolver::InvokeWhereToFindDotnet() return result; } +BOOL HostFxrResolver::IsX64(const WCHAR* dotnetPath) +{ + // Errors while reading from the file shouldn't throw unless + // file.exception(bits) is set + std::ifstream file(dotnetPath, std::ios::binary); + if (!file.is_open()) + { + LOG_TRACEF(L"Failed to open file %ls", dotnetPath); + return false; + } + + // Read the DOS header + IMAGE_DOS_HEADER dosHeader{}; + file.read(reinterpret_cast(&dosHeader), sizeof(dosHeader)); + if (dosHeader.e_magic != IMAGE_DOS_SIGNATURE) // 'MZ' + { + LOG_TRACEF(L"%ls is not a valid executable file (missing MZ header).", dotnetPath); + return false; + } + + // Seek to the PE header + file.seekg(dosHeader.e_lfanew, std::ios::beg); + + // Read the PE header + DWORD peSignature{}; + file.read(reinterpret_cast(&peSignature), sizeof(peSignature)); + if (peSignature != IMAGE_NT_SIGNATURE) // 'PE\0\0' + { + LOG_TRACEF(L"%ls is not a valid PE file (missing PE header).", dotnetPath); + return false; + } + + // Read the file header + IMAGE_FILE_HEADER fileHeader{}; + file.read(reinterpret_cast(&fileHeader), sizeof(fileHeader)); + + // Read the optional header magic field + WORD magic{}; + file.read(reinterpret_cast(&magic), sizeof(magic)); + + // Determine the architecture based on the magic value + if (magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) + { + LOG_INFOF(L"%ls is 32-bit", dotnetPath); + return false; + } + else if (magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) + { + LOG_INFOF(L"%ls is 64-bit", dotnetPath); + return true; + } + + LOG_INFOF(L"%ls is unknown architecture %i", dotnetPath, fileHeader.Machine); + return false; +} + std::optional HostFxrResolver::GetAbsolutePathToDotnetFromProgramFiles() { diff --git a/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.h b/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.h index 519f6df52c97..08ec650aec54 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.h +++ b/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.h @@ -74,6 +74,8 @@ class HostFxrResolver const std::filesystem::path & requestedPath ); + static BOOL IsX64(const WCHAR* dotnetPath); + struct LocalFreeDeleter { void operator ()(_In_ LPWSTR* ptr) const diff --git a/src/Servers/IIS/build/Build.Lib.Settings b/src/Servers/IIS/build/Build.Lib.Settings index 0dcba8c2011a..9327eb363771 100644 --- a/src/Servers/IIS/build/Build.Lib.Settings +++ b/src/Servers/IIS/build/Build.Lib.Settings @@ -9,7 +9,7 @@ - false + true _LIB;%(PreprocessorDefinitions) true From 30214d3afbb7930a0c8a5ba9ec0779d6c17b77da Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:56:12 -0700 Subject: [PATCH 34/76] [release/8.0] Update dependencies from dotnet/source-build-reference-packages (#62006) * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250519.2 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 8.0.0-alpha.1.25210.2 -> To Version 8.0.0-alpha.1.25269.2 * Update NuGet.config --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: William Godbe --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 33cefb75346e..581fbde9c0b7 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -338,9 +338,9 @@ 9a1c3e1b7f0c8763d4c96e593961a61a72679a7b - + https://github.com/dotnet/source-build-reference-packages - 6ae07097c0f03eb59c8a581faaedcc3f2e4cc42c + cee2d057118e3ad3c58a72a23271ad88b87d4d4d diff --git a/eng/Versions.props b/eng/Versions.props index 5c7c7778c92c..90e8358fa2a2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -168,7 +168,7 @@ 8.0.0-alpha.1.25202.2 - 8.0.0-alpha.1.25210.2 + 8.0.0-alpha.1.25269.2 2.0.0-beta-23228-03 From b832cb671375c13126679aa1d784194c4e691685 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 13:11:07 -0700 Subject: [PATCH 35/76] [release/8.0] Update dependencies from dotnet/arcade (#61944) * Update dependencies from https://github.com/dotnet/arcade build 20250513.4 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor From Version 8.0.0-beta.25230.1 -> To Version 8.0.0-beta.25263.4 * Update NuGet.config --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: William Godbe --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 6 +++--- eng/common/sdl/packages.config | 4 ++++ global.json | 4 ++-- 4 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 eng/common/sdl/packages.config diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 581fbde9c0b7..259dd66fe21d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -376,26 +376,26 @@ https://github.com/dotnet/winforms abda8e3bfa78319363526b5a5f86863ec979940e - + https://github.com/dotnet/arcade - 4246a31e5de9de87f760218c4f588cebf4661f45 + 20ab70a74d52b68f4271bd946884e24049b14f83 - + https://github.com/dotnet/arcade - 4246a31e5de9de87f760218c4f588cebf4661f45 + 20ab70a74d52b68f4271bd946884e24049b14f83 - + https://github.com/dotnet/arcade - 4246a31e5de9de87f760218c4f588cebf4661f45 + 20ab70a74d52b68f4271bd946884e24049b14f83 - + https://github.com/dotnet/arcade - 4246a31e5de9de87f760218c4f588cebf4661f45 + 20ab70a74d52b68f4271bd946884e24049b14f83 - + https://github.com/dotnet/arcade - 4246a31e5de9de87f760218c4f588cebf4661f45 + 20ab70a74d52b68f4271bd946884e24049b14f83 https://github.com/dotnet/extensions diff --git a/eng/Versions.props b/eng/Versions.props index 90e8358fa2a2..f817b14d06a2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -162,9 +162,9 @@ 6.2.4 6.2.4 - 8.0.0-beta.25230.1 - 8.0.0-beta.25230.1 - 8.0.0-beta.25230.1 + 8.0.0-beta.25263.4 + 8.0.0-beta.25263.4 + 8.0.0-beta.25263.4 8.0.0-alpha.1.25202.2 diff --git a/eng/common/sdl/packages.config b/eng/common/sdl/packages.config new file mode 100644 index 000000000000..e5f543ea68c2 --- /dev/null +++ b/eng/common/sdl/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/global.json b/global.json index c77c161a20d5..57e6e337a5e4 100644 --- a/global.json +++ b/global.json @@ -25,8 +25,8 @@ }, "msbuild-sdks": { "Yarn.MSBuild": "1.22.19", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25230.1", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25230.1" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25263.4", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25263.4" }, "native-tools": { "jdk": "latest" From b668e440ee96ce6a0f92b6b27a4484942aeed54e Mon Sep 17 00:00:00 2001 From: Brennan Conroy Date: Fri, 6 Jun 2025 21:27:47 +0000 Subject: [PATCH 36/76] Merged PR 50638: Harden Cookie parsing Harden Cookie parsing ---- #### AI description (iteration 1) #### PR Classification Bug fix focused on enforcing stricter cookie parsing rules in accordance with RFC 6265. #### PR Summary This pull request refines cookie parsing by updating test datasets and parser logic to reject improperly formatted cookie headers. The changes include: - **`src/Http/Headers/test/CookieHeaderValueTest.cs`**: Renamed and modified test datasets to use strict parsing (e.g., renaming to ListOfStrictCookieHeaderDataSet) and update expected results for invalid cookie combinations. - **`src/Http/Http/test/RequestCookiesCollectionTests.cs`**: Revised inline test cases to expect null outcomes for malformed cookies and added new cases for additional invalid formats. - **`src/Http/Shared/CookieHeaderParserShared.cs`**: Enhanced parsing logic to skip invalid cookie segments by enforcing semicolon delimiters and incorporating detailed RFC comment documentation. --- .../Headers/test/CookieHeaderValueTest.cs | 36 +++++++++++------ .../test/RequestCookiesCollectionTests.cs | 15 +++++-- src/Http/Shared/CookieHeaderParserShared.cs | 40 +++++++++++++++++-- 3 files changed, 72 insertions(+), 19 deletions(-) diff --git a/src/Http/Headers/test/CookieHeaderValueTest.cs b/src/Http/Headers/test/CookieHeaderValueTest.cs index 6623a8ed13dd..6ad2e962d005 100644 --- a/src/Http/Headers/test/CookieHeaderValueTest.cs +++ b/src/Http/Headers/test/CookieHeaderValueTest.cs @@ -75,7 +75,7 @@ public static TheoryData InvalidCookieValues } } - public static TheoryData, string?[]> ListOfCookieHeaderDataSet + public static TheoryData, string?[]> ListOfStrictCookieHeaderDataSet { get { @@ -94,19 +94,30 @@ public static TheoryData InvalidCookieValues dataset.Add(new[] { header1 }.ToList(), new[] { string1 }); dataset.Add(new[] { header1, header1 }.ToList(), new[] { string1, string1 }); - dataset.Add(new[] { header1, header1 }.ToList(), new[] { string1, null, "", " ", ";", " , ", string1 }); dataset.Add(new[] { header2 }.ToList(), new[] { string2 }); dataset.Add(new[] { header1, header2 }.ToList(), new[] { string1, string2 }); - dataset.Add(new[] { header1, header2 }.ToList(), new[] { string1 + ", " + string2 }); dataset.Add(new[] { header2, header1 }.ToList(), new[] { string2 + "; " + string1 }); dataset.Add(new[] { header1, header2, header3, header4 }.ToList(), new[] { string1, string2, string3, string4 }); - dataset.Add(new[] { header1, header2, header3, header4 }.ToList(), new[] { string.Join(",", string1, string2, string3, string4) }); dataset.Add(new[] { header1, header2, header3, header4 }.ToList(), new[] { string.Join(";", string1, string2, string3, string4) }); return dataset; } } + public static TheoryData, string?[]> ListOfCookieHeaderDataSet + { + get + { + var header1 = new CookieHeaderValue("name1", "n1=v1&n2=v2&n3=v3"); + var string1 = "name1=n1=v1&n2=v2&n3=v3"; + + var dataset = new TheoryData, string?[]>(); + dataset.Concat(ListOfStrictCookieHeaderDataSet); + dataset.Add(new[] { header1, header1 }.ToList(), new[] { string1, null, "", " ", ";", " , ", string1 }); + return dataset; + } + } + public static TheoryData?, string?[]> ListWithInvalidCookieHeaderDataSet { get @@ -127,18 +138,19 @@ public static TheoryData InvalidCookieValues dataset.Add(new[] { header1 }.ToList(), new[] { validString1, invalidString1 }); dataset.Add(new[] { header1 }.ToList(), new[] { validString1, null, "", " ", ";", " , ", invalidString1 }); dataset.Add(new[] { header1 }.ToList(), new[] { invalidString1, null, "", " ", ";", " , ", validString1 }); - dataset.Add(new[] { header1 }.ToList(), new[] { validString1 + ", " + invalidString1 }); - dataset.Add(new[] { header2 }.ToList(), new[] { invalidString1 + ", " + validString2 }); + dataset.Add(null, new[] { validString1 + ", " }); + dataset.Add(null, new[] { invalidString1 + ", " + validString2 }); dataset.Add(new[] { header1 }.ToList(), new[] { invalidString1 + "; " + validString1 }); dataset.Add(new[] { header2 }.ToList(), new[] { validString2 + "; " + invalidString1 }); dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { invalidString1, validString1, validString2, validString3 }); dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { validString1, invalidString1, validString2, validString3 }); dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { validString1, validString2, invalidString1, validString3 }); dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { validString1, validString2, validString3, invalidString1 }); - dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(",", invalidString1, validString1, validString2, validString3) }); - dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(",", validString1, invalidString1, validString2, validString3) }); - dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(",", validString1, validString2, invalidString1, validString3) }); - dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(",", validString1, validString2, validString3, invalidString1) }); + dataset.Add(null, new[] { string.Join(",", invalidString1, validString1, validString2, validString3) }); + dataset.Add(null, new[] { string.Join(",", validString1, invalidString1, validString2, validString3) }); + dataset.Add(null, new[] { string.Join(",", validString1, validString2, invalidString1, validString3) }); + dataset.Add(null, new[] { string.Join(",", validString1, validString2, validString3, invalidString1) }); + dataset.Add(null, new[] { string.Join(",", validString1, validString2, validString3) }); dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(";", invalidString1, validString1, validString2, validString3) }); dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(";", validString1, invalidString1, validString2, validString3) }); dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(";", validString1, validString2, invalidString1, validString3) }); @@ -248,7 +260,7 @@ public void CookieHeaderValue_ParseList_AcceptsValidValues(IList cookies, string[] input) { var results = CookieHeaderValue.ParseStrictList(input); @@ -267,7 +279,7 @@ public void CookieHeaderValue_TryParseList_AcceptsValidValues(IList cookies, string[] input) { var result = CookieHeaderValue.TryParseStrictList(input, out var results); diff --git a/src/Http/Http/test/RequestCookiesCollectionTests.cs b/src/Http/Http/test/RequestCookiesCollectionTests.cs index fa3fb6d67f74..4efca2c3c2d6 100644 --- a/src/Http/Http/test/RequestCookiesCollectionTests.cs +++ b/src/Http/Http/test/RequestCookiesCollectionTests.cs @@ -33,15 +33,22 @@ public void ParseManyCookies() [Theory] [InlineData(",", null)] [InlineData(";", null)] - [InlineData("er=dd,cc,bb", new[] { "dd" })] - [InlineData("er=dd,err=cc,errr=bb", new[] { "dd", "cc", "bb" })] - [InlineData("errorcookie=dd,:(\"sa;", new[] { "dd" })] + [InlineData("er=dd,cc,bb", null)] + [InlineData("er=dd,err=cc,errr=bb", null)] + [InlineData("errorcookie=dd,:(\"sa;", null)] [InlineData("s;", null)] + [InlineData("a@a=a;", null)] + [InlineData("a@ a=a;", null)] + [InlineData("a a=a;", null)] + [InlineData(",a=a;", null)] + [InlineData(",a=a", null)] + [InlineData("a=a;,b=b", new []{ "a" })] // valid cookie followed by invalid cookie + [InlineData(",a=a;b=b", new[] { "b" })] // invalid cookie followed by valid cookie public void ParseInvalidCookies(string cookieToParse, string[] expectedCookieValues) { var cookies = RequestCookieCollection.Parse(new StringValues(new[] { cookieToParse })); - if(expectedCookieValues == null) + if (expectedCookieValues == null) { Assert.Equal(0, cookies.Count); return; diff --git a/src/Http/Shared/CookieHeaderParserShared.cs b/src/Http/Shared/CookieHeaderParserShared.cs index e558ec1e4dc4..32f2e9b33b90 100644 --- a/src/Http/Shared/CookieHeaderParserShared.cs +++ b/src/Http/Shared/CookieHeaderParserShared.cs @@ -83,6 +83,17 @@ public static bool TryParseValue(StringSegment value, ref int index, bool suppor if (!TryGetCookieLength(value, ref current, out parsedName, out parsedValue)) { + var separatorIndex = value.IndexOf(';', current); + if (separatorIndex > 0) + { + // Skip the invalid values and keep trying. + index = separatorIndex; + } + else + { + // No more separators, so we're done. + index = value.Length; + } return false; } @@ -91,6 +102,17 @@ public static bool TryParseValue(StringSegment value, ref int index, bool suppor // If we support multiple values and we've not reached the end of the string, then we must have a separator. if ((separatorFound && !supportsMultipleValues) || (!separatorFound && (current < value.Length))) { + var separatorIndex = value.IndexOf(';', current); + if (separatorIndex > 0) + { + // Skip the invalid values and keep trying. + index = separatorIndex; + } + else + { + // No more separators, so we're done. + index = value.Length; + } return false; } @@ -106,7 +128,7 @@ private static int GetNextNonEmptyOrWhitespaceIndex(StringSegment input, int sta separatorFound = false; var current = startIndex + HttpRuleParser.GetWhitespaceLength(input, startIndex); - if ((current == input.Length) || (input[current] != ',' && input[current] != ';')) + if (current == input.Length || input[current] != ';') { return current; } @@ -119,8 +141,8 @@ private static int GetNextNonEmptyOrWhitespaceIndex(StringSegment input, int sta if (skipEmptyValues) { - // Most headers only split on ',', but cookies primarily split on ';' - while ((current < input.Length) && ((input[current] == ',') || (input[current] == ';'))) + // Cookies are split on ';' + while (current < input.Length && input[current] == ';') { current++; // skip delimiter. current = current + HttpRuleParser.GetWhitespaceLength(input, current); @@ -130,6 +152,18 @@ private static int GetNextNonEmptyOrWhitespaceIndex(StringSegment input, int sta return current; } + /* + * https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1 + * cookie-pair = cookie-name "=" cookie-value + * cookie-name = token + * token = 1* + separators = "(" | ")" | "<" | ">" | "@" + | "," | ";" | ":" | "\" | <"> + | "/" | "[" | "]" | "?" | "=" + | "{" | "}" | SP | HT + CTL = + */ // name=value; name="value" internal static bool TryGetCookieLength(StringSegment input, ref int offset, [NotNullWhen(true)] out StringSegment? parsedName, [NotNullWhen(true)] out StringSegment? parsedValue) { From 21dfe81cb2f3c8a26b3aff57626372982a744795 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Jun 2025 17:05:22 -0700 Subject: [PATCH 37/76] [release/8.0] Associate tagged keys with entries so replacements are not evicted (#62247) * Adding an entryId for taggedEntries so that replaced items in the cache do not have their tags removed on eviction. Fixes #61524 * Removing string allocation and refactoring to ValueTuple. * Code cleanup. * Using named ValueTuples * Adding assertion and deconstruction. * Refactoring tuple naming to PascalCase. Other code style changes. * Refactor tagged entries to use a record type. * Update src/Middleware/OutputCaching/test/MemoryOutputCacheStoreTests.cs Co-authored-by: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> * Update src/Middleware/OutputCaching/test/MemoryOutputCacheStoreTests.cs Co-authored-by: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> --------- Co-authored-by: Benjamin Grabkowitz Co-authored-by: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> --- .../src/Memory/MemoryOutputCacheStore.cs | 36 +++++++++++------- .../test/MemoryOutputCacheStoreTests.cs | 37 +++++++++++++++++++ 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/src/Middleware/OutputCaching/src/Memory/MemoryOutputCacheStore.cs b/src/Middleware/OutputCaching/src/Memory/MemoryOutputCacheStore.cs index a75546b6793f..38a38069b32c 100644 --- a/src/Middleware/OutputCaching/src/Memory/MemoryOutputCacheStore.cs +++ b/src/Middleware/OutputCaching/src/Memory/MemoryOutputCacheStore.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Linq; using Microsoft.Extensions.Caching.Memory; namespace Microsoft.AspNetCore.OutputCaching.Memory; @@ -9,7 +10,7 @@ namespace Microsoft.AspNetCore.OutputCaching.Memory; internal sealed class MemoryOutputCacheStore : IOutputCacheStore { private readonly MemoryCache _cache; - private readonly Dictionary> _taggedEntries = new(); + private readonly Dictionary> _taggedEntries = []; private readonly object _tagsLock = new(); internal MemoryOutputCacheStore(MemoryCache cache) @@ -20,7 +21,7 @@ internal MemoryOutputCacheStore(MemoryCache cache) } // For testing - internal Dictionary> TaggedEntries => _taggedEntries; + internal Dictionary> TaggedEntries => _taggedEntries.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Select(t => t.Key).ToHashSet()); public ValueTask EvictByTagAsync(string tag, CancellationToken cancellationToken) { @@ -30,7 +31,7 @@ public ValueTask EvictByTagAsync(string tag, CancellationToken cancellationToken { if (_taggedEntries.TryGetValue(tag, out var keys)) { - if (keys != null && keys.Count > 0) + if (keys is { Count: > 0 }) { // If MemoryCache changed to run eviction callbacks inline in Remove, iterating over keys could throw // To prevent allocating a copy of the keys we check if the eviction callback ran, @@ -40,7 +41,7 @@ public ValueTask EvictByTagAsync(string tag, CancellationToken cancellationToken while (i > 0) { var oldCount = keys.Count; - foreach (var key in keys) + foreach (var (key, _) in keys) { _cache.Remove(key); i--; @@ -74,6 +75,8 @@ public ValueTask SetAsync(string key, byte[] value, string[]? tags, TimeSpan val ArgumentNullException.ThrowIfNull(key); ArgumentNullException.ThrowIfNull(value); + var entryId = Guid.NewGuid(); + if (tags != null) { // Lock with SetEntry() to prevent EvictByTagAsync() from trying to remove a tag whose entry hasn't been added yet. @@ -90,27 +93,27 @@ public ValueTask SetAsync(string key, byte[] value, string[]? tags, TimeSpan val if (!_taggedEntries.TryGetValue(tag, out var keys)) { - keys = new HashSet(); + keys = new HashSet(); _taggedEntries[tag] = keys; } Debug.Assert(keys != null); - keys.Add(key); + keys.Add(new TaggedEntry(key, entryId)); } - SetEntry(key, value, tags, validFor); + SetEntry(key, value, tags, validFor, entryId); } } else { - SetEntry(key, value, tags, validFor); + SetEntry(key, value, tags, validFor, entryId); } return ValueTask.CompletedTask; } - void SetEntry(string key, byte[] value, string[]? tags, TimeSpan validFor) + private void SetEntry(string key, byte[] value, string[]? tags, TimeSpan validFor, Guid entryId) { Debug.Assert(key != null); @@ -120,22 +123,25 @@ void SetEntry(string key, byte[] value, string[]? tags, TimeSpan validFor) Size = value.Length }; - if (tags != null && tags.Length > 0) + if (tags is { Length: > 0 }) { // Remove cache keys from tag lists when the entry is evicted - options.RegisterPostEvictionCallback(RemoveFromTags, tags); + options.RegisterPostEvictionCallback(RemoveFromTags, (tags, entryId)); } _cache.Set(key, value, options); } - void RemoveFromTags(object key, object? value, EvictionReason reason, object? state) + private void RemoveFromTags(object key, object? value, EvictionReason reason, object? state) { - var tags = state as string[]; + Debug.Assert(state != null); + + var (tags, entryId) = ((string[] Tags, Guid EntryId))state; Debug.Assert(tags != null); Debug.Assert(tags.Length > 0); Debug.Assert(key is string); + Debug.Assert(entryId != Guid.Empty); lock (_tagsLock) { @@ -143,7 +149,7 @@ void RemoveFromTags(object key, object? value, EvictionReason reason, object? st { if (_taggedEntries.TryGetValue(tag, out var tagged)) { - tagged.Remove((string)key); + tagged.Remove(new TaggedEntry((string)key, entryId)); // Remove the collection if there is no more keys in it if (tagged.Count == 0) @@ -154,4 +160,6 @@ void RemoveFromTags(object key, object? value, EvictionReason reason, object? st } } } + + private record TaggedEntry(string Key, Guid EntryId); } diff --git a/src/Middleware/OutputCaching/test/MemoryOutputCacheStoreTests.cs b/src/Middleware/OutputCaching/test/MemoryOutputCacheStoreTests.cs index e8c809911add..c1ad1d708f4b 100644 --- a/src/Middleware/OutputCaching/test/MemoryOutputCacheStoreTests.cs +++ b/src/Middleware/OutputCaching/test/MemoryOutputCacheStoreTests.cs @@ -197,6 +197,43 @@ public async Task ExpiredEntries_AreRemovedFromTags() Assert.Single(tag2s); } + [Fact] + public async Task ReplacedEntries_AreNotRemovedFromTags() + { + var testClock = new TestMemoryOptionsClock { UtcNow = DateTimeOffset.UtcNow }; + var cache = new MemoryCache(new MemoryCacheOptions { SizeLimit = 1000, Clock = testClock, ExpirationScanFrequency = TimeSpan.FromMilliseconds(1) }); + var store = new MemoryOutputCacheStore(cache); + var value = "abc"u8.ToArray(); + + await store.SetAsync("a", value, new[] { "tag1", "tag2" }, TimeSpan.FromMilliseconds(5), default); + await store.SetAsync("a", value, new[] { "tag1" }, TimeSpan.FromMilliseconds(20), default); + + testClock.Advance(TimeSpan.FromMilliseconds(10)); + + // Trigger background expiration by accessing the cache. + _ = cache.Get("a"); + + var resulta = await store.GetAsync("a", default); + + Assert.NotNull(resulta); + + HashSet tag1s, tag2s; + + // Wait for the tag2 HashSet to be removed by the background expiration thread. + + using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + + while (store.TaggedEntries.TryGetValue("tag2", out tag2s) && !cts.IsCancellationRequested) + { + await Task.Yield(); + } + + store.TaggedEntries.TryGetValue("tag1", out tag1s); + + Assert.Null(tag2s); + Assert.Single(tag1s); + } + [Theory] [InlineData(null)] public async Task Store_Throws_OnInvalidTag(string tag) From 7dd498bf0280373348c39ffb7b49c4b8833b769a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:09:04 -0700 Subject: [PATCH 38/76] [release/8.0] Block test that is failing after switching to latest-chrome (#62284) * Block test failing after switching to latest-chrome version. * Update issue number --------- Co-authored-by: Ilona Tomkowicz --- .../FormHandlingTests/FormWithParentBindingContextTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs index 83592f562e1b..b8171c827e41 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs @@ -1287,7 +1287,7 @@ public void CanBindToFormWithFiles() } [Theory] - [InlineData(true)] + // [InlineData(true)] QuarantinedTest: https://github.com/dotnet/aspnetcore/issues/61882 [InlineData(false)] public void CanUseFormWithMethodGet(bool suppressEnhancedNavigation) { From 9e8ebbf2329d38ce79c1a0426371ec731d61f2dc Mon Sep 17 00:00:00 2001 From: Korolev Dmitry Date: Wed, 11 Jun 2025 12:03:41 -0700 Subject: [PATCH 39/76] backport(net8.0): http.sys on-demand TLS client hello retrieval (#62290) * feat(HTTP.SYS): on-demand TLS client hello retrieval (#62209) * fix cherry-pick * setup sample * provide example * fix build error --- .../samples/TlsFeaturesObserve/Program.cs | 14 +++-- .../samples/TlsFeaturesObserve/Startup.cs | 46 +++++++++++++++- .../TlsFeaturesObserve.csproj | 1 + .../src/IHttpSysRequestPropertyFeature.cs | 38 +++++++++++++ .../RequestContext.FeatureCollection.cs | 6 +++ .../src/RequestProcessing/RequestContext.cs | 54 +++++++++++++++++++ .../HttpSys/src/StandardFeatureCollection.cs | 1 + .../test/FunctionalTests/HttpsTests.cs | 22 ++++++++ 8 files changed, 175 insertions(+), 7 deletions(-) create mode 100644 src/Servers/HttpSys/src/IHttpSysRequestPropertyFeature.cs diff --git a/src/Servers/HttpSys/samples/TlsFeaturesObserve/Program.cs b/src/Servers/HttpSys/samples/TlsFeaturesObserve/Program.cs index 9551965ac398..13a31cb59b23 100644 --- a/src/Servers/HttpSys/samples/TlsFeaturesObserve/Program.cs +++ b/src/Servers/HttpSys/samples/TlsFeaturesObserve/Program.cs @@ -26,13 +26,17 @@ static IHostBuilder CreateHostBuilder(string[] args) => options.Authentication.Schemes = AuthenticationSchemes.None; options.Authentication.AllowAnonymous = true; - var property = typeof(HttpSysOptions).GetProperty("TlsClientHelloBytesCallback", BindingFlags.NonPublic | BindingFlags.Instance); - var delegateType = property.PropertyType; // Get the exact delegate type + // If you want to resolve a callback API, uncomment. + // Recommended approach is to use the on-demand API to fetch TLS client hello bytes, + // look into Startup.cs for details. - // Create a delegate of the correct type - var callbackDelegate = Delegate.CreateDelegate(delegateType, typeof(Holder).GetMethod(nameof(Holder.ProcessTlsClientHello), BindingFlags.Static | BindingFlags.Public)); + //var property = typeof(HttpSysOptions).GetProperty("TlsClientHelloBytesCallback", BindingFlags.NonPublic | BindingFlags.Instance); + //var delegateType = property.PropertyType; // Get the exact delegate type - property?.SetValue(options, callbackDelegate); + //// Create a delegate of the correct type + //var callbackDelegate = Delegate.CreateDelegate(delegateType, typeof(Holder).GetMethod(nameof(Holder.ProcessTlsClientHello), BindingFlags.Static | BindingFlags.Public)); + + //property?.SetValue(options, callbackDelegate); }); }); diff --git a/src/Servers/HttpSys/samples/TlsFeaturesObserve/Startup.cs b/src/Servers/HttpSys/samples/TlsFeaturesObserve/Startup.cs index 8ba6d27aef98..4440149c3552 100644 --- a/src/Servers/HttpSys/samples/TlsFeaturesObserve/Startup.cs +++ b/src/Servers/HttpSys/samples/TlsFeaturesObserve/Startup.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Buffers; +using System.Reflection; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Connections.Features; using Microsoft.AspNetCore.Hosting; @@ -17,12 +19,52 @@ public class Startup { public void Configure(IApplicationBuilder app) { + // recommended approach to fetch TLS client hello bytes + // is via on-demand API per request or by building own connection-lifecycle manager app.Run(async (HttpContext context) => { context.Response.ContentType = "text/plain"; - var tlsFeature = context.Features.Get(); - await context.Response.WriteAsync("TlsClientHello data: " + $"connectionId={tlsFeature?.ConnectionId}; length={tlsFeature?.TlsClientHelloLength}"); + var httpSysAssembly = typeof(Microsoft.AspNetCore.Server.HttpSys.HttpSysOptions).Assembly; + var httpSysPropertyFeatureType = httpSysAssembly.GetType("Microsoft.AspNetCore.Server.HttpSys.IHttpSysRequestPropertyFeature"); + var httpSysPropertyFeature = context.Features[httpSysPropertyFeatureType]!; + + var method = httpSysPropertyFeature.GetType().GetMethod( + "TryGetTlsClientHello", + BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic + ); + + // invoke first time to get required size + byte[] bytes = Array.Empty(); + var parameters = new object[] { bytes, 0 }; + var res = (bool)method.Invoke(httpSysPropertyFeature, parameters); + + // fetching out parameter only works by looking into parameters array of objects + var bytesReturned = (int)parameters[1]; + bytes = ArrayPool.Shared.Rent(bytesReturned); + parameters = [bytes, 0]; // correct input now + res = (bool)method.Invoke(httpSysPropertyFeature, parameters); + + // to avoid CS4012 use a method which accepts a byte[] and length, where you can do Span slicing + // error CS4012: Parameters or locals of type 'Span' cannot be declared in async methods or async lambda expressions. + var message = ReadTlsClientHello(bytes, bytesReturned); + await context.Response.WriteAsync(message); + ArrayPool.Shared.Return(bytes); }); + + static string ReadTlsClientHello(byte[] bytes, int bytesReturned) + { + var tlsClientHelloBytes = bytes.AsSpan(0, bytesReturned); + return $"TlsClientHello bytes: {string.Join(" ", tlsClientHelloBytes.ToArray())}, length={bytesReturned}"; + } + + // middleware compatible with callback API + //app.Run(async (HttpContext context) => + //{ + // context.Response.ContentType = "text/plain"; + + // var tlsFeature = context.Features.Get(); + // await context.Response.WriteAsync("TlsClientHello` data: " + $"connectionId={tlsFeature?.ConnectionId}; length={tlsFeature?.TlsClientHelloLength}"); + //}); } } diff --git a/src/Servers/HttpSys/samples/TlsFeaturesObserve/TlsFeaturesObserve.csproj b/src/Servers/HttpSys/samples/TlsFeaturesObserve/TlsFeaturesObserve.csproj index f65f8a98a72a..57b6cef72608 100644 --- a/src/Servers/HttpSys/samples/TlsFeaturesObserve/TlsFeaturesObserve.csproj +++ b/src/Servers/HttpSys/samples/TlsFeaturesObserve/TlsFeaturesObserve.csproj @@ -4,6 +4,7 @@ $(DefaultNetCoreTargetFramework) Exe true + latest diff --git a/src/Servers/HttpSys/src/IHttpSysRequestPropertyFeature.cs b/src/Servers/HttpSys/src/IHttpSysRequestPropertyFeature.cs new file mode 100644 index 000000000000..16a20abaea8d --- /dev/null +++ b/src/Servers/HttpSys/src/IHttpSysRequestPropertyFeature.cs @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Microsoft.AspNetCore.Server.HttpSys; + +/// +/// Provides API to read HTTP_REQUEST_PROPERTY value from the HTTP.SYS request. +/// +/// +// internal for backport +internal interface IHttpSysRequestPropertyFeature +{ + /// + /// Reads the TLS client hello from HTTP.SYS + /// + /// Where the raw bytes of the TLS Client Hello message are written. + /// + /// Returns the number of bytes written to . + /// Or can return the size of the buffer needed if wasn't large enough. + /// + /// + /// Works only if HTTP_SERVICE_CONFIG_SSL_FLAG_ENABLE_CACHE_CLIENT_HELLO flag is set on http.sys service configuration. + /// See + /// and + ///

+ /// If you don't want to guess the required size before first invocation, + /// you should first call with set to empty size, so that you can retrieve the required buffer size from , + /// then allocate that amount of memory and retry the query. + ///
+ /// + /// True, if fetching TLS client hello was successful, false if size is not large enough. + /// If unsuccessful for other reason throws an exception. + /// + /// Any HttpSys error except for ERROR_INSUFFICIENT_BUFFER or ERROR_MORE_DATA. + /// If HttpSys does not support querying the TLS Client Hello. + // has byte[] (not Span) for reflection-based invocation + bool TryGetTlsClientHello(byte[] tlsClientHelloBytesDestination, out int bytesReturned); +} diff --git a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs index e1931dc0fc6b..337afcb09451 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs @@ -36,6 +36,7 @@ internal partial class RequestContext : IHttpResponseTrailersFeature, IHttpResetFeature, IHttpSysRequestDelegationFeature, + IHttpSysRequestPropertyFeature, IConnectionLifetimeNotificationFeature { private IFeatureCollection? _features; @@ -751,4 +752,9 @@ void IConnectionLifetimeNotificationFeature.RequestClose() Response.Headers[HeaderNames.Connection] = "close"; } } + + public bool TryGetTlsClientHello(byte[] tlsClientHelloBytesDestination, out int bytesReturned) + { + return TryGetTlsClientHelloMessageBytes(tlsClientHelloBytesDestination.AsSpan(), out bytesReturned); + } } diff --git a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs index 5c45db813880..124a9e8dcd02 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs @@ -239,6 +239,60 @@ internal void ForceCancelRequest() } } + /// + /// Attempts to get the client hello message bytes from the http.sys. + /// If successful writes the bytes into , and shows how many bytes were written in . + /// If not successful because is not large enough, returns false and shows a size of required in . + /// If not successful for other reason - throws exception with message/errorCode. + /// + internal unsafe bool TryGetTlsClientHelloMessageBytes( + Span destination, + out int bytesReturned) + { + bytesReturned = default; + if (!HttpApi.SupportsClientHello) + { + // not supported, so we just return and don't invoke the callback + throw new InvalidOperationException("Windows HTTP Server API does not support HTTP_FEATURE_ID.HttpFeatureCacheTlsClientHello or HttpQueryRequestProperty. See HTTP_FEATURE_ID for details."); + } + + uint statusCode; + var requestId = PinsReleased ? Request.RequestId : RequestId; + + uint bytesReturnedValue = 0; + uint* bytesReturnedPointer = &bytesReturnedValue; + + fixed (byte* pBuffer = destination) + { + statusCode = HttpApi.HttpGetRequestProperty( + requestQueueHandle: Server.RequestQueue.Handle, + requestId, + propertyId: (HTTP_REQUEST_PROPERTY)11 /* HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsClientHello */, + qualifier: null, + qualifierSize: 0, + output: pBuffer, + outputSize: (uint)destination.Length, + bytesReturned: bytesReturnedPointer, + overlapped: IntPtr.Zero); + + bytesReturned = checked((int)bytesReturnedValue); + + if (statusCode is ErrorCodes.ERROR_SUCCESS) + { + return true; + } + + // if buffer supplied is too small, `bytesReturned` has proper size + if (statusCode is ErrorCodes.ERROR_MORE_DATA or ErrorCodes.ERROR_INSUFFICIENT_BUFFER) + { + return false; + } + } + + Log.TlsClientHelloRetrieveError(Logger, requestId, statusCode); + throw new HttpSysException((int)statusCode); + } + /// /// Attempts to get the client hello message bytes from HTTP.sys and calls the user provided callback. /// If not successful, will return false. diff --git a/src/Servers/HttpSys/src/StandardFeatureCollection.cs b/src/Servers/HttpSys/src/StandardFeatureCollection.cs index dda57166921e..1c7d078d8253 100644 --- a/src/Servers/HttpSys/src/StandardFeatureCollection.cs +++ b/src/Servers/HttpSys/src/StandardFeatureCollection.cs @@ -27,6 +27,7 @@ internal sealed class StandardFeatureCollection : IFeatureCollection { typeof(IHttpBodyControlFeature), _identityFunc }, { typeof(IHttpSysRequestInfoFeature), _identityFunc }, { typeof(IHttpSysRequestTimingFeature), _identityFunc }, + { typeof(IHttpSysRequestPropertyFeature), _identityFunc }, { typeof(IHttpResponseTrailersFeature), ctx => ctx.GetResponseTrailersFeature() }, { typeof(IHttpResetFeature), ctx => ctx.GetResetFeature() }, { typeof(IConnectionLifetimeNotificationFeature), ctx => ctx.GetConnectionLifetimeNotificationFeature() }, diff --git a/src/Servers/HttpSys/test/FunctionalTests/HttpsTests.cs b/src/Servers/HttpSys/test/FunctionalTests/HttpsTests.cs index 0ccb71964b74..91af51fd8b56 100644 --- a/src/Servers/HttpSys/test/FunctionalTests/HttpsTests.cs +++ b/src/Servers/HttpSys/test/FunctionalTests/HttpsTests.cs @@ -234,6 +234,28 @@ public async Task Https_ITlsHandshakeFeature_MatchesIHttpSysExtensionInfoFeature } } + [ConditionalFact] + [MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2)] + public async Task Https_SetsIHttpSysRequestPropertyFeature() + { + using (Utilities.CreateDynamicHttpsServer(out var address, async httpContext => + { + try + { + var requestPropertyFeature = httpContext.Features.Get(); + Assert.NotNull(requestPropertyFeature); + } + catch (Exception ex) + { + await httpContext.Response.WriteAsync(ex.ToString()); + } + }, LoggerFactory)) + { + string response = await SendRequestAsync(address); + Assert.Equal(string.Empty, response); + } + } + [ConditionalFact] [MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2)] public async Task Https_SetsIHttpSysRequestTimingFeature() From 5994d666b6c94ae46b51d41c579b81208b4c0fa9 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 11 Jun 2025 13:51:40 -0700 Subject: [PATCH 40/76] Update baseline, SDK --- eng/Baseline.Designer.props | 428 ++++++++++++++++++------------------ eng/Baseline.xml | 212 +++++++++--------- eng/Versions.props | 2 +- global.json | 4 +- 4 files changed, 323 insertions(+), 323 deletions(-) diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props index 3769c18a21cb..43668cf078ae 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -2,117 +2,117 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - + - + - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 @@ -120,138 +120,138 @@ - 8.0.16 + 8.0.17 - + - + - + - 8.0.16 + 8.0.17 - + - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - + - 8.0.16 + 8.0.17 - - + + - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - - + + - 8.0.16 + 8.0.17 - + - 8.0.16 + 8.0.17 - + - 8.0.16 + 8.0.17 - + - 8.0.16 + 8.0.17 - - + + - 8.0.16 + 8.0.17 - - - + + + - 8.0.16 + 8.0.17 - - + + - 8.0.16 + 8.0.17 - - + + - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - - + + @@ -259,7 +259,7 @@ - 8.0.16 + 8.0.17 @@ -268,51 +268,51 @@ - 8.0.16 + 8.0.17 - + - + - + - + - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - + - + - + - 8.0.16 + 8.0.17 - - + + @@ -322,8 +322,8 @@ - - + + @@ -331,8 +331,8 @@ - - + + @@ -343,58 +343,58 @@ - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - - + + - 8.0.16 + 8.0.17 - + - + - + - 8.0.16 + 8.0.17 - + - + - + - 8.0.16 + 8.0.17 - + - 8.0.16 + 8.0.17 @@ -403,7 +403,7 @@ - 8.0.16 + 8.0.17 @@ -411,71 +411,71 @@ - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - + - + - + - + - 8.0.16 + 8.0.17 - + - + - + - 8.0.16 + 8.0.17 - - + + - 8.0.16 + 8.0.17 - - + + - 8.0.16 + 8.0.17 @@ -491,27 +491,27 @@ - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - + - 8.0.16 + 8.0.17 @@ -520,23 +520,23 @@ - 8.0.16 + 8.0.17 - + - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 @@ -545,54 +545,54 @@ - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - - + + - - + + - - + + - 8.0.16 + 8.0.17 - - + + - - + + - - + + - - + + @@ -600,83 +600,83 @@ - 8.0.16 + 8.0.17 - + - + - + - 8.0.16 + 8.0.17 - + - + - + - 8.0.16 + 8.0.17 - + - + - + - 8.0.16 + 8.0.17 - + - + - + - 8.0.16 + 8.0.17 - - - - + + + + - 8.0.16 + 8.0.17 @@ -685,64 +685,64 @@ - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - + - 8.0.16 + 8.0.17 - + - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 @@ -764,7 +764,7 @@ - 8.0.16 + 8.0.17 @@ -786,7 +786,7 @@ - 8.0.16 + 8.0.17 @@ -802,23 +802,23 @@ - 8.0.16 + 8.0.17 - + - + - + @@ -826,24 +826,24 @@ - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - - - + + + - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 @@ -853,7 +853,7 @@ - 8.0.16 + 8.0.17 @@ -862,73 +862,73 @@ - 8.0.16 + 8.0.17 - + - + - + - 8.0.16 + 8.0.17 - + - + - + - 8.0.16 + 8.0.17 - + - + - + - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 @@ -957,11 +957,11 @@ - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 @@ -979,18 +979,18 @@ - 8.0.16 + 8.0.17 - 8.0.16 + 8.0.17 - + - 8.0.16 + 8.0.17 diff --git a/eng/Baseline.xml b/eng/Baseline.xml index a1df454eacdf..250913c6d7b5 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -4,110 +4,110 @@ This file contains a list of all the packages and their versions which were rele Update this list when preparing for a new patch. --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eng/Versions.props b/eng/Versions.props index 7cde2c2ae36f..4d3c6c4940bc 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -11,7 +11,7 @@ 18 - false + true 7.1.2 7.* + + + + + + + @@ -30,10 +37,17 @@ + + + + + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index cd1125ef92a9..0f8a870df9c9 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -121,9 +121,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 77545d6fd5ca79bc08198fd6d8037c14843f14ad + ef853a71052646a42abf17e888ec6d9a69614ad9 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -185,9 +185,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 77545d6fd5ca79bc08198fd6d8037c14843f14ad + ef853a71052646a42abf17e888ec6d9a69614ad9 https://github.com/dotnet/source-build-externals @@ -255,9 +255,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 81cabf2857a01351e5ab578947c7403a5b128ad1 + ef853a71052646a42abf17e888ec6d9a69614ad9 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -275,17 +275,17 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 81cabf2857a01351e5ab578947c7403a5b128ad1 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 77545d6fd5ca79bc08198fd6d8037c14843f14ad + ef853a71052646a42abf17e888ec6d9a69614ad9 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 77545d6fd5ca79bc08198fd6d8037c14843f14ad + ef853a71052646a42abf17e888ec6d9a69614ad9 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 77545d6fd5ca79bc08198fd6d8037c14843f14ad + ef853a71052646a42abf17e888ec6d9a69614ad9 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -316,22 +316,22 @@ Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime. All Runtime.$rid packages should have the same version. --> - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 77545d6fd5ca79bc08198fd6d8037c14843f14ad + ef853a71052646a42abf17e888ec6d9a69614ad9 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 77545d6fd5ca79bc08198fd6d8037c14843f14ad + ef853a71052646a42abf17e888ec6d9a69614ad9 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 77545d6fd5ca79bc08198fd6d8037c14843f14ad + ef853a71052646a42abf17e888ec6d9a69614ad9 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 77545d6fd5ca79bc08198fd6d8037c14843f14ad + ef853a71052646a42abf17e888ec6d9a69614ad9 https://github.com/dotnet/xdt @@ -368,9 +368,9 @@ - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 77545d6fd5ca79bc08198fd6d8037c14843f14ad + ef853a71052646a42abf17e888ec6d9a69614ad9 https://github.com/dotnet/winforms diff --git a/eng/Versions.props b/eng/Versions.props index 4d3c6c4940bc..e56ec90d010b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -67,12 +67,12 @@ 8.0.2 - 8.0.17 - 8.0.17 - 8.0.17 - 8.0.17 - 8.0.17 - 8.0.17-servicing.25266.2 + 8.0.18 + 8.0.18 + 8.0.18 + 8.0.18 + 8.0.18 + 8.0.18-servicing.25311.17 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.17-servicing.25266.2 + 8.0.18-servicing.25311.17 8.0.1 8.0.1 8.0.1 @@ -109,7 +109,7 @@ 8.0.0 8.0.2 8.0.0 - 8.0.17-servicing.25266.2 + 8.0.18-servicing.25311.17 8.0.1 8.0.1 8.0.2 @@ -125,13 +125,13 @@ 8.0.0 8.0.1 8.0.0 - 8.0.5 + 8.0.6 8.0.0 8.0.0 8.0.0 - 8.0.17-servicing.25266.2 + 8.0.18-servicing.25311.17 - 8.0.17-servicing.25266.2 + 8.0.18-servicing.25311.17 8.0.0 8.0.1 From 2b43128a0c82da4d249a24edc89bf55eb26299b3 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Thu, 12 Jun 2025 12:06:17 +0000 Subject: [PATCH 42/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250611.8 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.17 -> To Version 8.0.18 --- NuGet.config | 10 ++-------- eng/Version.Details.xml | 32 ++++++++++++++++---------------- eng/Versions.props | 16 ++++++++-------- 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/NuGet.config b/NuGet.config index 077c821f43b2..b8e3d657c692 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,10 +6,7 @@ - - - - + @@ -37,10 +34,7 @@ - - - - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0f8a870df9c9..70d84d5c792f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -9,37 +9,37 @@ --> - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - f7b16ef09831139dd1b087f281910e2446129bef + 76582c579cc4de7faa4b59e6620f81ba142d6969 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - f7b16ef09831139dd1b087f281910e2446129bef + 76582c579cc4de7faa4b59e6620f81ba142d6969 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - f7b16ef09831139dd1b087f281910e2446129bef + 76582c579cc4de7faa4b59e6620f81ba142d6969 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - f7b16ef09831139dd1b087f281910e2446129bef + 76582c579cc4de7faa4b59e6620f81ba142d6969 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - f7b16ef09831139dd1b087f281910e2446129bef + 76582c579cc4de7faa4b59e6620f81ba142d6969 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - f7b16ef09831139dd1b087f281910e2446129bef + 76582c579cc4de7faa4b59e6620f81ba142d6969 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - f7b16ef09831139dd1b087f281910e2446129bef + 76582c579cc4de7faa4b59e6620f81ba142d6969 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - f7b16ef09831139dd1b087f281910e2446129bef + 76582c579cc4de7faa4b59e6620f81ba142d6969 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index e56ec90d010b..78df222241a1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -143,14 +143,14 @@ 8.1.0-preview.23604.1 8.1.0-preview.23604.1 - 8.0.17 - 8.0.17 - 8.0.17 - 8.0.17 - 8.0.17 - 8.0.17 - 8.0.17 - 8.0.17 + 8.0.18 + 8.0.18 + 8.0.18 + 8.0.18 + 8.0.18 + 8.0.18 + 8.0.18 + 8.0.18 4.8.0-7.24574.2 4.8.0-7.24574.2 From a6557df3e94d4382513969f06e1b7a4348d3fb88 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Mon, 16 Jun 2025 21:29:10 +0000 Subject: [PATCH 43/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250612.3 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.18 -> To Version 8.0.18 --- NuGet.config | 12 ++---------- eng/Version.Details.xml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/NuGet.config b/NuGet.config index b8e3d657c692..7c9e9e42b9b4 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,14 +6,10 @@ - + - - - - @@ -34,13 +30,9 @@ - + - - - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 70d84d5c792f..19f79509732c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,35 +11,35 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 76582c579cc4de7faa4b59e6620f81ba142d6969 + 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 76582c579cc4de7faa4b59e6620f81ba142d6969 + 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 76582c579cc4de7faa4b59e6620f81ba142d6969 + 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 76582c579cc4de7faa4b59e6620f81ba142d6969 + 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 76582c579cc4de7faa4b59e6620f81ba142d6969 + 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 76582c579cc4de7faa4b59e6620f81ba142d6969 + 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 76582c579cc4de7faa4b59e6620f81ba142d6969 + 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 76582c579cc4de7faa4b59e6620f81ba142d6969 + 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f https://dev.azure.com/dnceng/internal/_git/dotnet-runtime From 68610df92b63a2434536716632f65945712764a7 Mon Sep 17 00:00:00 2001 From: Will Godbe Date: Tue, 17 Jun 2025 18:06:03 +0000 Subject: [PATCH 44/76] Use live version of S.T.J in analyzers --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 78df222241a1..954d32aa1620 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -200,7 +200,7 @@ 15.9.3032 6.0.1 - 8.0.5 + $(SystemTextJsonVersion) 4.7.0 5.0.0 From 29cd592c6b5577691eb0d6163b6827ff33f27041 Mon Sep 17 00:00:00 2001 From: vseanreesermsft <78103370+vseanreesermsft@users.noreply.github.com> Date: Thu, 3 Jul 2025 21:31:34 -0700 Subject: [PATCH 45/76] Update branding to 8.0.19 (#62560) --- eng/Versions.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 4d3c6c4940bc..cd82be4c850d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -8,10 +8,10 @@ 8 0 - 18 + 19 - true + false 7.1.2 7.* + + + + - + @@ -30,10 +34,14 @@ + + + + - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 19f79509732c..32035203b9b8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -121,9 +121,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - ef853a71052646a42abf17e888ec6d9a69614ad9 + 7c9521188181c4d0b182a3358cb1e856b59e8e77 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -185,9 +185,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - ef853a71052646a42abf17e888ec6d9a69614ad9 + 7c9521188181c4d0b182a3358cb1e856b59e8e77 https://github.com/dotnet/source-build-externals @@ -257,7 +257,7 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - ef853a71052646a42abf17e888ec6d9a69614ad9 + 7c9521188181c4d0b182a3358cb1e856b59e8e77 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -275,17 +275,17 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 81cabf2857a01351e5ab578947c7403a5b128ad1 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - ef853a71052646a42abf17e888ec6d9a69614ad9 + 7c9521188181c4d0b182a3358cb1e856b59e8e77 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - ef853a71052646a42abf17e888ec6d9a69614ad9 + 7c9521188181c4d0b182a3358cb1e856b59e8e77 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - ef853a71052646a42abf17e888ec6d9a69614ad9 + 7c9521188181c4d0b182a3358cb1e856b59e8e77 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -316,22 +316,22 @@ Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime. All Runtime.$rid packages should have the same version. --> - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - ef853a71052646a42abf17e888ec6d9a69614ad9 + 7c9521188181c4d0b182a3358cb1e856b59e8e77 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - ef853a71052646a42abf17e888ec6d9a69614ad9 + 7c9521188181c4d0b182a3358cb1e856b59e8e77 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - ef853a71052646a42abf17e888ec6d9a69614ad9 + 7c9521188181c4d0b182a3358cb1e856b59e8e77 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - ef853a71052646a42abf17e888ec6d9a69614ad9 + 7c9521188181c4d0b182a3358cb1e856b59e8e77 https://github.com/dotnet/xdt @@ -368,9 +368,9 @@ - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - ef853a71052646a42abf17e888ec6d9a69614ad9 + 7c9521188181c4d0b182a3358cb1e856b59e8e77 https://github.com/dotnet/winforms diff --git a/eng/Versions.props b/eng/Versions.props index 52046defb2a2..ae80e5cab29c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -67,12 +67,12 @@ 8.0.2 - 8.0.18 - 8.0.18 - 8.0.18 - 8.0.18 - 8.0.18 - 8.0.18-servicing.25311.17 + 8.0.19 + 8.0.19 + 8.0.19 + 8.0.19 + 8.0.19 + 8.0.19-servicing.25354.3 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.18-servicing.25311.17 + 8.0.19-servicing.25354.3 8.0.1 8.0.1 8.0.1 @@ -109,7 +109,7 @@ 8.0.0 8.0.2 8.0.0 - 8.0.18-servicing.25311.17 + 8.0.19-servicing.25354.3 8.0.1 8.0.1 8.0.2 @@ -129,9 +129,9 @@ 8.0.0 8.0.0 8.0.0 - 8.0.18-servicing.25311.17 + 8.0.19-servicing.25354.3 - 8.0.18-servicing.25311.17 + 8.0.19-servicing.25354.3 8.0.0 8.0.1 From c710836d978e6b7152963d8586f76aad41226064 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Mon, 7 Jul 2025 14:31:51 +0000 Subject: [PATCH 47/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250707.6 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.18 -> To Version 8.0.19 --- NuGet.config | 12 ++---------- eng/Version.Details.xml | 32 ++++++++++++++++---------------- eng/Versions.props | 16 ++++++++-------- 3 files changed, 26 insertions(+), 34 deletions(-) diff --git a/NuGet.config b/NuGet.config index 0a2f5ababe8f..5c5f2066f102 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,11 +6,7 @@ - - - - - + @@ -34,11 +30,7 @@ - - - - - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 32035203b9b8..fc22de834c95 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -9,37 +9,37 @@ --> - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f + 04671d7f026a920b810db3006bfc519a78f72b37 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f + 04671d7f026a920b810db3006bfc519a78f72b37 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f + 04671d7f026a920b810db3006bfc519a78f72b37 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f + 04671d7f026a920b810db3006bfc519a78f72b37 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f + 04671d7f026a920b810db3006bfc519a78f72b37 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f + 04671d7f026a920b810db3006bfc519a78f72b37 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f + 04671d7f026a920b810db3006bfc519a78f72b37 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f + 04671d7f026a920b810db3006bfc519a78f72b37 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index ae80e5cab29c..364cd14e93d3 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -143,14 +143,14 @@ 8.1.0-preview.23604.1 8.1.0-preview.23604.1 - 8.0.18 - 8.0.18 - 8.0.18 - 8.0.18 - 8.0.18 - 8.0.18 - 8.0.18 - 8.0.18 + 8.0.19 + 8.0.19 + 8.0.19 + 8.0.19 + 8.0.19 + 8.0.19 + 8.0.19 + 8.0.19 4.8.0-7.24574.2 4.8.0-7.24574.2 From 5bbd508f469522fcb84db2cd4ffb2b22aec2c7de Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 8 Jul 2025 15:23:54 -0700 Subject: [PATCH 48/76] Update baseline, SDK --- eng/Baseline.Designer.props | 436 ++++++++++++++++++------------------ eng/Baseline.xml | 212 +++++++++--------- eng/Versions.props | 2 +- global.json | 4 +- 4 files changed, 327 insertions(+), 327 deletions(-) diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props index 43668cf078ae..5095e569515d 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -2,117 +2,117 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - + - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 @@ -120,138 +120,138 @@ - 8.0.17 + 8.0.18 - + - + - + - 8.0.17 + 8.0.18 - + - + - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - + - 8.0.17 + 8.0.18 - - + + - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - - + + - 8.0.17 + 8.0.18 - + - 8.0.17 + 8.0.18 - + - 8.0.17 + 8.0.18 - + - 8.0.17 + 8.0.18 - - + + - 8.0.17 + 8.0.18 - - - + + + - 8.0.17 + 8.0.18 - - + + - 8.0.17 + 8.0.18 - - + + - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - - + + @@ -259,7 +259,7 @@ - 8.0.17 + 8.0.18 @@ -268,51 +268,51 @@ - 8.0.17 + 8.0.18 - + - + - + - + - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - + - + - + - 8.0.17 + 8.0.18 - - + + @@ -322,8 +322,8 @@ - - + + @@ -331,8 +331,8 @@ - - + + @@ -343,58 +343,58 @@ - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - - + + - 8.0.17 + 8.0.18 - + - + - + - 8.0.17 + 8.0.18 - + - + - + - 8.0.17 + 8.0.18 - + - 8.0.17 + 8.0.18 @@ -403,7 +403,7 @@ - 8.0.17 + 8.0.18 @@ -411,71 +411,71 @@ - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - + - + - + - + - 8.0.17 + 8.0.18 - - + + - + - - + + - 8.0.17 + 8.0.18 - - + + - 8.0.17 + 8.0.18 - - + + - 8.0.17 + 8.0.18 @@ -491,27 +491,27 @@ - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - + - 8.0.17 + 8.0.18 @@ -520,23 +520,23 @@ - 8.0.17 + 8.0.18 - + - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 @@ -545,54 +545,54 @@ - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - - + + - - + + - - + + - 8.0.17 + 8.0.18 - - + + - - + + - - + + - - + + @@ -600,83 +600,83 @@ - 8.0.17 + 8.0.18 - + - + - + - + - + - 8.0.17 + 8.0.18 - + - + - + - 8.0.17 + 8.0.18 - + - + - + - 8.0.17 + 8.0.18 - + - + - + - 8.0.17 + 8.0.18 - - - - + + + + - 8.0.17 + 8.0.18 @@ -685,64 +685,64 @@ - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - + - 8.0.17 + 8.0.18 - + - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 @@ -764,7 +764,7 @@ - 8.0.17 + 8.0.18 @@ -786,7 +786,7 @@ - 8.0.17 + 8.0.18 @@ -802,23 +802,23 @@ - 8.0.17 + 8.0.18 - + - + - + @@ -826,24 +826,24 @@ - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - - - + + + - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 @@ -853,7 +853,7 @@ - 8.0.17 + 8.0.18 @@ -862,73 +862,73 @@ - 8.0.17 + 8.0.18 - + - + - + - 8.0.17 + 8.0.18 - + - + - + - 8.0.17 + 8.0.18 - + - + - + - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 @@ -957,11 +957,11 @@ - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 @@ -979,18 +979,18 @@ - 8.0.17 + 8.0.18 - 8.0.17 + 8.0.18 - + - 8.0.17 + 8.0.18 diff --git a/eng/Baseline.xml b/eng/Baseline.xml index 250913c6d7b5..779ed1f014e8 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -4,110 +4,110 @@ This file contains a list of all the packages and their versions which were rele Update this list when preparing for a new patch. --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eng/Versions.props b/eng/Versions.props index 52046defb2a2..a03a8b2445ba 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -11,7 +11,7 @@ 19 - false + true 7.1.2 7.* - - @@ -30,10 +28,8 @@ - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index cd1125ef92a9..f8b2acbf01a8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -376,26 +376,26 @@ https://github.com/dotnet/winforms abda8e3bfa78319363526b5a5f86863ec979940e - + https://github.com/dotnet/arcade - 20ab70a74d52b68f4271bd946884e24049b14f83 + 2ce3f8c7b2614c2b19985b669ffcd934bc39ffd1 - + https://github.com/dotnet/arcade - 20ab70a74d52b68f4271bd946884e24049b14f83 + 2ce3f8c7b2614c2b19985b669ffcd934bc39ffd1 - + https://github.com/dotnet/arcade - 20ab70a74d52b68f4271bd946884e24049b14f83 + 2ce3f8c7b2614c2b19985b669ffcd934bc39ffd1 - + https://github.com/dotnet/arcade - 20ab70a74d52b68f4271bd946884e24049b14f83 + 2ce3f8c7b2614c2b19985b669ffcd934bc39ffd1 - + https://github.com/dotnet/arcade - 20ab70a74d52b68f4271bd946884e24049b14f83 + 2ce3f8c7b2614c2b19985b669ffcd934bc39ffd1 https://github.com/dotnet/extensions diff --git a/eng/Versions.props b/eng/Versions.props index cd82be4c850d..14a8fcfe6c47 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -162,9 +162,9 @@ 6.2.4 6.2.4 - 8.0.0-beta.25263.4 - 8.0.0-beta.25263.4 - 8.0.0-beta.25263.4 + 8.0.0-beta.25310.3 + 8.0.0-beta.25310.3 + 8.0.0-beta.25310.3 8.0.0-alpha.1.25202.2 diff --git a/global.json b/global.json index 2c5a2e02a392..d06b451abcc6 100644 --- a/global.json +++ b/global.json @@ -25,8 +25,8 @@ }, "msbuild-sdks": { "Yarn.MSBuild": "1.22.19", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25263.4", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25263.4" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25310.3", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25310.3" }, "native-tools": { "jdk": "latest" From 906ea6125974df1d834b3748b18c0258309ec0de Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 16:27:30 -0700 Subject: [PATCH 52/76] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250616.2 (#62365) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 8.0.0-alpha.1.25269.2 -> To Version 8.0.0-alpha.1.25316.2 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f8b2acbf01a8..04a4ca8534d5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -338,9 +338,9 @@ 9a1c3e1b7f0c8763d4c96e593961a61a72679a7b - + https://github.com/dotnet/source-build-reference-packages - cee2d057118e3ad3c58a72a23271ad88b87d4d4d + 3827e68e002064268d4be4b2d1d96048f9794808 diff --git a/eng/Versions.props b/eng/Versions.props index 14a8fcfe6c47..96fe6bb48d8f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -168,7 +168,7 @@ 8.0.0-alpha.1.25202.2 - 8.0.0-alpha.1.25269.2 + 8.0.0-alpha.1.25316.2 2.0.0-beta-23228-03 From bf7724bdbf426961a6079c3c72a0491e02af9580 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Wed, 9 Jul 2025 02:52:08 +0000 Subject: [PATCH 53/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250708.8 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.18 -> To Version 8.0.19 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/NuGet.config b/NuGet.config index 5c5f2066f102..7d27f74b46ae 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,7 +6,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index fc22de834c95..fa4de1fbe5e8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,35 +11,35 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 04671d7f026a920b810db3006bfc519a78f72b37 + 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 04671d7f026a920b810db3006bfc519a78f72b37 + 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 04671d7f026a920b810db3006bfc519a78f72b37 + 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 04671d7f026a920b810db3006bfc519a78f72b37 + 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 04671d7f026a920b810db3006bfc519a78f72b37 + 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 04671d7f026a920b810db3006bfc519a78f72b37 + 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 04671d7f026a920b810db3006bfc519a78f72b37 + 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 04671d7f026a920b810db3006bfc519a78f72b37 + 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime From 3ec694c0578fc77e95a961fd7df6efa801cb3199 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Thu, 10 Jul 2025 04:40:26 +0000 Subject: [PATCH 54/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-runtime build 20250709.23 Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Text.Json , Microsoft.SourceBuild.Intermediate.runtime.linux-x64 From Version 8.0.18-servicing.25311.17 -> To Version 8.0.19-servicing.25359.23 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 32 ++++++++++++++++---------------- eng/Versions.props | 10 +++++----- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/NuGet.config b/NuGet.config index 7d27f74b46ae..d5b404defc81 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index fa4de1fbe5e8..b17d5d847253 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -121,9 +121,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 7c9521188181c4d0b182a3358cb1e856b59e8e77 + 5d9419d7cc870d0c199a8e61c947fd1c63487623 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -185,9 +185,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 7c9521188181c4d0b182a3358cb1e856b59e8e77 + 5d9419d7cc870d0c199a8e61c947fd1c63487623 https://github.com/dotnet/source-build-externals @@ -257,7 +257,7 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 7c9521188181c4d0b182a3358cb1e856b59e8e77 + 5d9419d7cc870d0c199a8e61c947fd1c63487623 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -277,15 +277,15 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 7c9521188181c4d0b182a3358cb1e856b59e8e77 + 5d9419d7cc870d0c199a8e61c947fd1c63487623 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 7c9521188181c4d0b182a3358cb1e856b59e8e77 + 5d9419d7cc870d0c199a8e61c947fd1c63487623 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 7c9521188181c4d0b182a3358cb1e856b59e8e77 + 5d9419d7cc870d0c199a8e61c947fd1c63487623 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -318,20 +318,20 @@ --> https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 7c9521188181c4d0b182a3358cb1e856b59e8e77 + 5d9419d7cc870d0c199a8e61c947fd1c63487623 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 7c9521188181c4d0b182a3358cb1e856b59e8e77 + 5d9419d7cc870d0c199a8e61c947fd1c63487623 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 7c9521188181c4d0b182a3358cb1e856b59e8e77 + 5d9419d7cc870d0c199a8e61c947fd1c63487623 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 7c9521188181c4d0b182a3358cb1e856b59e8e77 + 5d9419d7cc870d0c199a8e61c947fd1c63487623 https://github.com/dotnet/xdt @@ -368,9 +368,9 @@ - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 7c9521188181c4d0b182a3358cb1e856b59e8e77 + 5d9419d7cc870d0c199a8e61c947fd1c63487623 https://github.com/dotnet/winforms diff --git a/eng/Versions.props b/eng/Versions.props index 364cd14e93d3..badbe5ccfaf0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -72,7 +72,7 @@ 8.0.19 8.0.19 8.0.19 - 8.0.19-servicing.25354.3 + 8.0.19-servicing.25359.23 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.19-servicing.25354.3 + 8.0.19-servicing.25359.23 8.0.1 8.0.1 8.0.1 @@ -109,7 +109,7 @@ 8.0.0 8.0.2 8.0.0 - 8.0.19-servicing.25354.3 + 8.0.19-servicing.25359.23 8.0.1 8.0.1 8.0.2 @@ -129,9 +129,9 @@ 8.0.0 8.0.0 8.0.0 - 8.0.19-servicing.25354.3 + 8.0.19-servicing.25359.23 - 8.0.19-servicing.25354.3 + 8.0.19-servicing.25359.23 8.0.0 8.0.1 From 8819920319aed9b2df3e318e4be64e9768aa8f25 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Thu, 10 Jul 2025 18:13:13 +0000 Subject: [PATCH 55/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250710.5 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.18 -> To Version 8.0.19 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/NuGet.config b/NuGet.config index d5b404defc81..1643c4465813 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,7 +6,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b17d5d847253..776c61a49112 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,35 +11,35 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 + 0a6f930ff53d42d38ae371c2443311c83f6c57cc https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 + 0a6f930ff53d42d38ae371c2443311c83f6c57cc https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 + 0a6f930ff53d42d38ae371c2443311c83f6c57cc https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 + 0a6f930ff53d42d38ae371c2443311c83f6c57cc https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 + 0a6f930ff53d42d38ae371c2443311c83f6c57cc https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 + 0a6f930ff53d42d38ae371c2443311c83f6c57cc https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 + 0a6f930ff53d42d38ae371c2443311c83f6c57cc https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 8b9f4f31d716208b5ad9137f366c8053cdb3c1a6 + 0a6f930ff53d42d38ae371c2443311c83f6c57cc https://dev.azure.com/dnceng/internal/_git/dotnet-runtime From 0b0f7ac0dc1d65a3b91dfa414e86925023c9cdaa Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Thu, 10 Jul 2025 21:31:37 +0000 Subject: [PATCH 56/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-runtime build 20250710.7 Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Text.Json , Microsoft.SourceBuild.Intermediate.runtime.linux-x64 From Version 8.0.19-servicing.25359.23 -> To Version 8.0.19-servicing.25360.7 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 32 ++++++++++++++++---------------- eng/Versions.props | 10 +++++----- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/NuGet.config b/NuGet.config index 1643c4465813..3a748fe45a7a 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9f91c9cfa4d4..08b8e833bb73 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -121,9 +121,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 5d9419d7cc870d0c199a8e61c947fd1c63487623 + 653dfdfd75c3e98989361b4154703d13649be4cb https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -185,9 +185,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 5d9419d7cc870d0c199a8e61c947fd1c63487623 + 653dfdfd75c3e98989361b4154703d13649be4cb https://github.com/dotnet/source-build-externals @@ -257,7 +257,7 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 5d9419d7cc870d0c199a8e61c947fd1c63487623 + 653dfdfd75c3e98989361b4154703d13649be4cb https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -277,15 +277,15 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 5d9419d7cc870d0c199a8e61c947fd1c63487623 + 653dfdfd75c3e98989361b4154703d13649be4cb https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 5d9419d7cc870d0c199a8e61c947fd1c63487623 + 653dfdfd75c3e98989361b4154703d13649be4cb https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 5d9419d7cc870d0c199a8e61c947fd1c63487623 + 653dfdfd75c3e98989361b4154703d13649be4cb https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -318,20 +318,20 @@ --> https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 5d9419d7cc870d0c199a8e61c947fd1c63487623 + 653dfdfd75c3e98989361b4154703d13649be4cb - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 5d9419d7cc870d0c199a8e61c947fd1c63487623 + 653dfdfd75c3e98989361b4154703d13649be4cb https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 5d9419d7cc870d0c199a8e61c947fd1c63487623 + 653dfdfd75c3e98989361b4154703d13649be4cb - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 5d9419d7cc870d0c199a8e61c947fd1c63487623 + 653dfdfd75c3e98989361b4154703d13649be4cb https://github.com/dotnet/xdt @@ -368,9 +368,9 @@ - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 5d9419d7cc870d0c199a8e61c947fd1c63487623 + 653dfdfd75c3e98989361b4154703d13649be4cb https://github.com/dotnet/winforms diff --git a/eng/Versions.props b/eng/Versions.props index c34ef7434388..5ad2daccc74e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -72,7 +72,7 @@ 8.0.19 8.0.19 8.0.19 - 8.0.19-servicing.25359.23 + 8.0.19-servicing.25360.7 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.19-servicing.25359.23 + 8.0.19-servicing.25360.7 8.0.1 8.0.1 8.0.1 @@ -109,7 +109,7 @@ 8.0.0 8.0.2 8.0.0 - 8.0.19-servicing.25359.23 + 8.0.19-servicing.25360.7 8.0.1 8.0.1 8.0.2 @@ -129,9 +129,9 @@ 8.0.0 8.0.0 8.0.0 - 8.0.19-servicing.25359.23 + 8.0.19-servicing.25360.7 - 8.0.19-servicing.25359.23 + 8.0.19-servicing.25360.7 8.0.0 8.0.1 From f15f72f3a5b404728412f0eae5c98d679a22890b Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Fri, 11 Jul 2025 01:14:52 +0000 Subject: [PATCH 57/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250710.8 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.19 -> To Version 8.0.19 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/NuGet.config b/NuGet.config index 3a748fe45a7a..4e8b6e80fcb5 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,7 +6,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 08b8e833bb73..9b709873db4a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,35 +11,35 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0a6f930ff53d42d38ae371c2443311c83f6c57cc + 47ff285f3801d7f66a4bff257201c6175d96f26f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0a6f930ff53d42d38ae371c2443311c83f6c57cc + 47ff285f3801d7f66a4bff257201c6175d96f26f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0a6f930ff53d42d38ae371c2443311c83f6c57cc + 47ff285f3801d7f66a4bff257201c6175d96f26f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0a6f930ff53d42d38ae371c2443311c83f6c57cc + 47ff285f3801d7f66a4bff257201c6175d96f26f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0a6f930ff53d42d38ae371c2443311c83f6c57cc + 47ff285f3801d7f66a4bff257201c6175d96f26f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0a6f930ff53d42d38ae371c2443311c83f6c57cc + 47ff285f3801d7f66a4bff257201c6175d96f26f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0a6f930ff53d42d38ae371c2443311c83f6c57cc + 47ff285f3801d7f66a4bff257201c6175d96f26f https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 0a6f930ff53d42d38ae371c2443311c83f6c57cc + 47ff285f3801d7f66a4bff257201c6175d96f26f https://dev.azure.com/dnceng/internal/_git/dotnet-runtime From 185a3b690aab34859e2b8e29f498751dc8d5783e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 16:11:25 -0700 Subject: [PATCH 58/76] [release/8.0] Add AppContext switch in patch release to opt-out of breaking behavior change in ForwardedHeaders middleware. (#62688) * Add AppContext switch in patch release to opt-out of breaking behavior change in ForwardedHeaders middleware. * env --------- Co-authored-by: Brennan --- .../src/ForwardedHeadersMiddleware.cs | 30 ++++- .../test/ForwardedHeadersMiddlewareTest.cs | 123 ++++++++++++++++++ 2 files changed, 147 insertions(+), 6 deletions(-) diff --git a/src/Middleware/HttpOverrides/src/ForwardedHeadersMiddleware.cs b/src/Middleware/HttpOverrides/src/ForwardedHeadersMiddleware.cs index b2738f32d33c..be5e4da152bd 100644 --- a/src/Middleware/HttpOverrides/src/ForwardedHeadersMiddleware.cs +++ b/src/Middleware/HttpOverrides/src/ForwardedHeadersMiddleware.cs @@ -21,6 +21,7 @@ public class ForwardedHeadersMiddleware private readonly ForwardedHeadersOptions _options; private readonly RequestDelegate _next; private readonly ILogger _logger; + private readonly bool _ignoreUnknownProxiesWithoutFor; private bool _allowAllHosts; private IList? _allowedHosts; @@ -63,6 +64,18 @@ public ForwardedHeadersMiddleware(RequestDelegate next, ILoggerFactory loggerFac _logger = loggerFactory.CreateLogger(); _next = next; + if (AppContext.TryGetSwitch("Microsoft.AspNetCore.HttpOverrides.IgnoreUnknownProxiesWithoutFor", out var enabled) + && enabled) + { + _ignoreUnknownProxiesWithoutFor = true; + } + + if (Environment.GetEnvironmentVariable("MICROSOFT_ASPNETCORE_HTTPOVERRIDES_IGNORE_UNKNOWN_PROXIES_WITHOUT_FOR") is string env + && (env.Equals("true", StringComparison.OrdinalIgnoreCase) || env.Equals("1"))) + { + _ignoreUnknownProxiesWithoutFor = true; + } + PreProcessHosts(); static void EnsureOptionNotNullorWhitespace(string value, string propertyName) @@ -228,15 +241,20 @@ public void ApplyForwarders(HttpContext context) for (; entriesConsumed < sets.Length; entriesConsumed++) { var set = sets[entriesConsumed]; - // For the first instance, allow remoteIp to be null for servers that don't support it natively. - if (currentValues.RemoteIpAndPort != null && checkKnownIps && !CheckKnownAddress(currentValues.RemoteIpAndPort.Address)) + // Opt-out of breaking change behavior where we now always check KnownProxies and KnownNetworks + // It used to be guarded by the ForwardedHeaders.XForwardedFor flag, but now we always check it. + if (!_ignoreUnknownProxiesWithoutFor || checkFor) { - // Stop at the first unknown remote IP, but still apply changes processed so far. - if (_logger.IsEnabled(LogLevel.Debug)) + // For the first instance, allow remoteIp to be null for servers that don't support it natively. + if (currentValues.RemoteIpAndPort != null && checkKnownIps && !CheckKnownAddress(currentValues.RemoteIpAndPort.Address)) { - _logger.LogDebug(1, "Unknown proxy: {RemoteIpAndPort}", currentValues.RemoteIpAndPort); + // Stop at the first unknown remote IP, but still apply changes processed so far. + if (_logger.IsEnabled(LogLevel.Warning)) + { + _logger.LogWarning(1, "Unknown proxy: {RemoteIpAndPort}", currentValues.RemoteIpAndPort); + } + break; } - break; } if (checkFor) diff --git a/src/Middleware/HttpOverrides/test/ForwardedHeadersMiddlewareTest.cs b/src/Middleware/HttpOverrides/test/ForwardedHeadersMiddlewareTest.cs index 4fd1341acc45..627ad96a3cd6 100644 --- a/src/Middleware/HttpOverrides/test/ForwardedHeadersMiddlewareTest.cs +++ b/src/Middleware/HttpOverrides/test/ForwardedHeadersMiddlewareTest.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.TestHost; +using Microsoft.DotNet.RemoteExecutor; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -1035,6 +1036,128 @@ public async Task IgnoreXForwardedHeadersFromUnknownProxy(ForwardedHeaders forwa } } + [Theory] + [InlineData(ForwardedHeaders.XForwardedFor)] + [InlineData(ForwardedHeaders.XForwardedHost)] + [InlineData(ForwardedHeaders.XForwardedProto)] + [InlineData(ForwardedHeaders.XForwardedPrefix)] + public void AppContextDoesNotValidateUnknownProxyWithoutForwardedFor(ForwardedHeaders forwardedHeaders) + { + RemoteExecutor.Invoke(static async (forwardedHeadersName) => + { + Assert.True(Enum.TryParse(forwardedHeadersName, out var forwardedHeaders)); + AppContext.SetSwitch("Microsoft.AspNetCore.HttpOverrides.IgnoreUnknownProxiesWithoutFor", true); + using var host = new HostBuilder() + .ConfigureWebHost(webHostBuilder => + { + webHostBuilder + .UseTestServer() + .Configure(app => + { + var options = new ForwardedHeadersOptions + { + ForwardedHeaders = forwardedHeaders + }; + app.UseForwardedHeaders(options); + }); + }).Build(); + + await host.StartAsync(); + + var server = host.GetTestServer(); + + var context = await server.SendAsync(c => + { + c.Request.Headers["X-Forwarded-For"] = "11.111.111.11"; + c.Request.Headers["X-Forwarded-Host"] = "testhost"; + c.Request.Headers["X-Forwarded-Proto"] = "Protocol"; + c.Request.Headers["X-Forwarded-Prefix"] = "/pathbase"; + c.Connection.RemoteIpAddress = IPAddress.Parse("10.0.0.1"); + c.Connection.RemotePort = 99; + }); + + if (forwardedHeaders.HasFlag(ForwardedHeaders.XForwardedFor)) + { + // X-Forwarded-For ignored since 10.0.0.1 isn't in KnownProxies + Assert.Equal("10.0.0.1", context.Connection.RemoteIpAddress.ToString()); + } + if (forwardedHeaders.HasFlag(ForwardedHeaders.XForwardedHost)) + { + Assert.Equal("testhost", context.Request.Host.ToString()); + } + if (forwardedHeaders.HasFlag(ForwardedHeaders.XForwardedProto)) + { + Assert.Equal("Protocol", context.Request.Scheme); + } + if (forwardedHeaders.HasFlag(ForwardedHeaders.XForwardedPrefix)) + { + Assert.Equal("/pathbase", context.Request.PathBase); + } + return RemoteExecutor.SuccessExitCode; + }, forwardedHeaders.ToString()).Dispose(); + } + + [Theory] + [InlineData(ForwardedHeaders.XForwardedFor)] + [InlineData(ForwardedHeaders.XForwardedHost)] + [InlineData(ForwardedHeaders.XForwardedProto)] + [InlineData(ForwardedHeaders.XForwardedPrefix)] + public void EnvVariableDoesNotValidateUnknownProxyWithoutForwardedFor(ForwardedHeaders forwardedHeaders) + { + RemoteExecutor.Invoke(static async (forwardedHeadersName) => + { + Assert.True(Enum.TryParse(forwardedHeadersName, out var forwardedHeaders)); + Environment.SetEnvironmentVariable("MICROSOFT_ASPNETCORE_HTTPOVERRIDES_IGNORE_UNKNOWN_PROXIES_WITHOUT_FOR", "true"); + using var host = new HostBuilder() + .ConfigureWebHost(webHostBuilder => + { + webHostBuilder + .UseTestServer() + .Configure(app => + { + var options = new ForwardedHeadersOptions + { + ForwardedHeaders = forwardedHeaders + }; + app.UseForwardedHeaders(options); + }); + }).Build(); + + await host.StartAsync(); + + var server = host.GetTestServer(); + + var context = await server.SendAsync(c => + { + c.Request.Headers["X-Forwarded-For"] = "11.111.111.11"; + c.Request.Headers["X-Forwarded-Host"] = "testhost"; + c.Request.Headers["X-Forwarded-Proto"] = "Protocol"; + c.Request.Headers["X-Forwarded-Prefix"] = "/pathbase"; + c.Connection.RemoteIpAddress = IPAddress.Parse("10.0.0.1"); + c.Connection.RemotePort = 99; + }); + + if (forwardedHeaders.HasFlag(ForwardedHeaders.XForwardedFor)) + { + // X-Forwarded-For ignored since 10.0.0.1 isn't in KnownProxies + Assert.Equal("10.0.0.1", context.Connection.RemoteIpAddress.ToString()); + } + if (forwardedHeaders.HasFlag(ForwardedHeaders.XForwardedHost)) + { + Assert.Equal("testhost", context.Request.Host.ToString()); + } + if (forwardedHeaders.HasFlag(ForwardedHeaders.XForwardedProto)) + { + Assert.Equal("Protocol", context.Request.Scheme); + } + if (forwardedHeaders.HasFlag(ForwardedHeaders.XForwardedPrefix)) + { + Assert.Equal("/pathbase", context.Request.PathBase); + } + return RemoteExecutor.SuccessExitCode; + }, forwardedHeaders.ToString()).Dispose(); + } + [Fact] public async Task PartiallyEnabledForwardsPartiallyChangesRequest() { From f07d68fcd895354f6712c07f2e5e333237c0192f Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Tue, 15 Jul 2025 22:44:11 +0000 Subject: [PATCH 59/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-runtime build 20250715.14 Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , Microsoft.SourceBuild.Intermediate.runtime.linux-x64 From Version 8.0.19-servicing.25360.7 -> To Version 8.0.19-servicing.25365.14 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 30 +++++++++++++++--------------- eng/Versions.props | 10 +++++----- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/NuGet.config b/NuGet.config index 4e8b6e80fcb5..c24d02a43ecc 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9b709873db4a..de66ca3e695f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -121,9 +121,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 653dfdfd75c3e98989361b4154703d13649be4cb + fce8ed90dc43047eabec2b32c04ee46b789ad5d1 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -185,9 +185,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 653dfdfd75c3e98989361b4154703d13649be4cb + fce8ed90dc43047eabec2b32c04ee46b789ad5d1 https://github.com/dotnet/source-build-externals @@ -277,15 +277,15 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 653dfdfd75c3e98989361b4154703d13649be4cb + fce8ed90dc43047eabec2b32c04ee46b789ad5d1 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 653dfdfd75c3e98989361b4154703d13649be4cb + fce8ed90dc43047eabec2b32c04ee46b789ad5d1 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 653dfdfd75c3e98989361b4154703d13649be4cb + fce8ed90dc43047eabec2b32c04ee46b789ad5d1 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -318,20 +318,20 @@ --> https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 653dfdfd75c3e98989361b4154703d13649be4cb + fce8ed90dc43047eabec2b32c04ee46b789ad5d1 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 653dfdfd75c3e98989361b4154703d13649be4cb + fce8ed90dc43047eabec2b32c04ee46b789ad5d1 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 653dfdfd75c3e98989361b4154703d13649be4cb + fce8ed90dc43047eabec2b32c04ee46b789ad5d1 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 653dfdfd75c3e98989361b4154703d13649be4cb + fce8ed90dc43047eabec2b32c04ee46b789ad5d1 https://github.com/dotnet/xdt @@ -368,9 +368,9 @@ - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 653dfdfd75c3e98989361b4154703d13649be4cb + fce8ed90dc43047eabec2b32c04ee46b789ad5d1 https://github.com/dotnet/winforms diff --git a/eng/Versions.props b/eng/Versions.props index 5ad2daccc74e..61efb3018ad8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -72,7 +72,7 @@ 8.0.19 8.0.19 8.0.19 - 8.0.19-servicing.25360.7 + 8.0.19-servicing.25365.14 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.19-servicing.25360.7 + 8.0.19-servicing.25365.14 8.0.1 8.0.1 8.0.1 @@ -109,7 +109,7 @@ 8.0.0 8.0.2 8.0.0 - 8.0.19-servicing.25360.7 + 8.0.19-servicing.25365.14 8.0.1 8.0.1 8.0.2 @@ -129,9 +129,9 @@ 8.0.0 8.0.0 8.0.0 - 8.0.19-servicing.25360.7 + 8.0.19-servicing.25365.14 - 8.0.19-servicing.25360.7 + 8.0.19-servicing.25365.14 8.0.0 8.0.1 From d6fac35ae6afb21dc86541315fec83ff8da85878 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Wed, 16 Jul 2025 17:43:58 +0000 Subject: [PATCH 60/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250716.2 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.19 -> To Version 8.0.19 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/NuGet.config b/NuGet.config index c24d02a43ecc..ff21f1721cf8 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,7 +6,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index de66ca3e695f..30a7de601be8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,35 +11,35 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 47ff285f3801d7f66a4bff257201c6175d96f26f + 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 47ff285f3801d7f66a4bff257201c6175d96f26f + 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 47ff285f3801d7f66a4bff257201c6175d96f26f + 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 47ff285f3801d7f66a4bff257201c6175d96f26f + 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 47ff285f3801d7f66a4bff257201c6175d96f26f + 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 47ff285f3801d7f66a4bff257201c6175d96f26f + 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 47ff285f3801d7f66a4bff257201c6175d96f26f + 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 47ff285f3801d7f66a4bff257201c6175d96f26f + 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime From f3e59ac37610d7b77eb8f69656f8828d3a46d288 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Tue, 22 Jul 2025 01:08:04 +0000 Subject: [PATCH 61/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250719.3 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.19 -> To Version 8.0.19 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/NuGet.config b/NuGet.config index ff21f1721cf8..f88be834fcc1 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,7 +6,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 30a7de601be8..5c3c6152b9a0 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,35 +11,35 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 + 24e93fcb4900536922554fc215429cf954016ed1 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 + 24e93fcb4900536922554fc215429cf954016ed1 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 + 24e93fcb4900536922554fc215429cf954016ed1 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 + 24e93fcb4900536922554fc215429cf954016ed1 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 + 24e93fcb4900536922554fc215429cf954016ed1 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 + 24e93fcb4900536922554fc215429cf954016ed1 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 + 24e93fcb4900536922554fc215429cf954016ed1 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 34b4e7bbb53e1ce1e7cb0742931df5213d0d28a0 + 24e93fcb4900536922554fc215429cf954016ed1 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime From 326d35ed91eecd800df94d11e4184cf19db3d75f Mon Sep 17 00:00:00 2001 From: "Sean Reeser (CSI Interfusion Inc)" Date: Tue, 22 Jul 2025 17:15:49 +0000 Subject: [PATCH 62/76] Commit 3d4840db: Updated Version.Details.xml - Revert 8.0.6 system.text.json sha to released version. --- eng/Version.Details.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5c3c6152b9a0..2ddbab98bdbd 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -257,7 +257,7 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 653dfdfd75c3e98989361b4154703d13649be4cb + ef853a71052646a42abf17e888ec6d9a69614ad9 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime From 347079b7774e131748e5b64675074b815051c1fb Mon Sep 17 00:00:00 2001 From: vseanreesermsft <78103370+vseanreesermsft@users.noreply.github.com> Date: Mon, 4 Aug 2025 12:03:21 -0700 Subject: [PATCH 63/76] Update branding to 8.0.20 (#63106) --- eng/Versions.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 692e6f2c4712..7605c8760d1e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -8,10 +8,10 @@ 8 0 - 19 + 20 - true + false 7.1.2 7.* - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - + - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 @@ -120,138 +120,138 @@ - 8.0.18 + 8.0.19 - + - + - + - 8.0.18 + 8.0.19 - + - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - + - 8.0.18 + 8.0.19 - - + + - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - - + + - 8.0.18 + 8.0.19 - + - 8.0.18 + 8.0.19 - + - 8.0.18 + 8.0.19 - + - 8.0.18 + 8.0.19 - - + + - 8.0.18 + 8.0.19 - - - + + + - 8.0.18 + 8.0.19 - - + + - 8.0.18 + 8.0.19 - - + + - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - - + + @@ -259,7 +259,7 @@ - 8.0.18 + 8.0.19 @@ -268,51 +268,51 @@ - 8.0.18 + 8.0.19 - + - + - + - + - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - + - + - + - 8.0.18 + 8.0.19 - - + + @@ -322,8 +322,8 @@ - - + + @@ -331,8 +331,8 @@ - - + + @@ -343,58 +343,58 @@ - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - - + + - 8.0.18 + 8.0.19 - + - + - + - 8.0.18 + 8.0.19 - + - + - + - 8.0.18 + 8.0.19 - + - 8.0.18 + 8.0.19 @@ -403,7 +403,7 @@ - 8.0.18 + 8.0.19 @@ -411,71 +411,71 @@ - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - + - + - + - + - 8.0.18 + 8.0.19 - + - + - + - 8.0.18 + 8.0.19 - - + + - 8.0.18 + 8.0.19 - - + + - 8.0.18 + 8.0.19 @@ -491,27 +491,27 @@ - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - + - 8.0.18 + 8.0.19 @@ -520,23 +520,23 @@ - 8.0.18 + 8.0.19 - + - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 @@ -545,54 +545,54 @@ - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - - + + - - + + - - + + - 8.0.18 + 8.0.19 - - + + - - + + - - + + - - + + @@ -600,83 +600,83 @@ - 8.0.18 + 8.0.19 - + - + - + - 8.0.18 + 8.0.19 - + - + - + - 8.0.18 + 8.0.19 - + - + - + - 8.0.18 + 8.0.19 - + - + - + - 8.0.18 + 8.0.19 - - - - + + + + - 8.0.18 + 8.0.19 @@ -685,64 +685,64 @@ - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - + - 8.0.18 + 8.0.19 - + - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 @@ -764,7 +764,7 @@ - 8.0.18 + 8.0.19 @@ -786,7 +786,7 @@ - 8.0.18 + 8.0.19 @@ -802,23 +802,23 @@ - 8.0.18 + 8.0.19 - + - + - + @@ -826,24 +826,24 @@ - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - - - + + + - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 @@ -853,7 +853,7 @@ - 8.0.18 + 8.0.19 @@ -862,73 +862,73 @@ - 8.0.18 + 8.0.19 - + - + - + - 8.0.18 + 8.0.19 - + - + - + - 8.0.18 + 8.0.19 - + - + - + - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 @@ -957,11 +957,11 @@ - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 @@ -979,18 +979,18 @@ - 8.0.18 + 8.0.19 - 8.0.18 + 8.0.19 - + - 8.0.18 + 8.0.19 diff --git a/eng/Baseline.xml b/eng/Baseline.xml index 779ed1f014e8..5e40f13f2eca 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -4,110 +4,110 @@ This file contains a list of all the packages and their versions which were rele Update this list when preparing for a new patch. --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eng/Versions.props b/eng/Versions.props index e2571546db2d..1ddf1910adf1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -11,7 +11,7 @@ 20 - false + true 7.1.2 7.* + + + + @@ -30,9 +34,13 @@ + + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2ddbab98bdbd..4935482e8d3f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -397,13 +397,13 @@ https://github.com/dotnet/arcade 2ce3f8c7b2614c2b19985b669ffcd934bc39ffd1 - + https://github.com/dotnet/extensions - ca03b0c72858567f9b668d90fee32ef2d5d8dd74 + eafdf6e9c40bcd561f38979617405fd2801a46e3 - + https://github.com/dotnet/extensions - ca03b0c72858567f9b668d90fee32ef2d5d8dd74 + eafdf6e9c40bcd561f38979617405fd2801a46e3 https://github.com/nuget/nuget.client diff --git a/eng/Versions.props b/eng/Versions.props index 1ddf1910adf1..f59ab7fa5ddf 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -140,8 +140,8 @@ 8.0.0 8.0.1 - 8.1.0-preview.23604.1 - 8.1.0-preview.23604.1 + 9.0.0-preview.9.24518.1 + 9.0.0-preview.9.24518.1 8.0.19 8.0.19 From 491c8678de34794b7ecf9f72c7a87d9722765227 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 13:09:41 -0700 Subject: [PATCH 70/76] Update dependencies from https://github.com/dotnet/arcade build 20250807.1 (#63189) Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor From Version 8.0.0-beta.25310.3 -> To Version 8.0.0-beta.25407.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 6 +++--- eng/common/templates-official/job/job.yml | 6 ++++++ eng/common/templates/job/job.yml | 4 ++++ eng/common/tools.ps1 | 2 +- global.json | 4 ++-- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 4935482e8d3f..6220e76abee8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -376,26 +376,26 @@ https://github.com/dotnet/winforms abda8e3bfa78319363526b5a5f86863ec979940e - + https://github.com/dotnet/arcade - 2ce3f8c7b2614c2b19985b669ffcd934bc39ffd1 + a5ec3fab69ac440afe6764b2e046af6e8fcafa74 - + https://github.com/dotnet/arcade - 2ce3f8c7b2614c2b19985b669ffcd934bc39ffd1 + a5ec3fab69ac440afe6764b2e046af6e8fcafa74 - + https://github.com/dotnet/arcade - 2ce3f8c7b2614c2b19985b669ffcd934bc39ffd1 + a5ec3fab69ac440afe6764b2e046af6e8fcafa74 - + https://github.com/dotnet/arcade - 2ce3f8c7b2614c2b19985b669ffcd934bc39ffd1 + a5ec3fab69ac440afe6764b2e046af6e8fcafa74 - + https://github.com/dotnet/arcade - 2ce3f8c7b2614c2b19985b669ffcd934bc39ffd1 + a5ec3fab69ac440afe6764b2e046af6e8fcafa74 https://github.com/dotnet/extensions diff --git a/eng/Versions.props b/eng/Versions.props index f59ab7fa5ddf..f229f2c31cc6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -162,9 +162,9 @@ 6.2.4 6.2.4 - 8.0.0-beta.25310.3 - 8.0.0-beta.25310.3 - 8.0.0-beta.25310.3 + 8.0.0-beta.25407.1 + 8.0.0-beta.25407.1 + 8.0.0-beta.25407.1 8.0.0-alpha.1.25202.2 diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml index 98ccbd7a9c16..b98f6a6505d3 100644 --- a/eng/common/templates-official/job/job.yml +++ b/eng/common/templates-official/job/job.yml @@ -21,6 +21,7 @@ parameters: # See schema documentation - https://github.com/dotnet/arcade/blob/master/Documentation/AzureDevOps/TemplateSchema.md artifacts: '' enableMicrobuild: false + microbuildUseESRP: true enablePublishBuildArtifacts: false enablePublishBuildAssets: false enablePublishTestResults: false @@ -135,6 +136,11 @@ jobs: signType: $(_SignType) zipSources: false feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + ${{ if eq(parameters.microbuildUseESRP, true) }}: + ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: + ConnectedPMEServiceName: 6cc74545-d7b9-4050-9dfa-ebefcc8961ea + ${{ else }}: + ConnectedPMEServiceName: 248d384a-b39b-46e3-8ad5-c2c210d5e7ca env: TeamName: $(_TeamName) MicroBuildOutputFolderOverride: '$(Agent.TempDirectory)' diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index e295031c0985..2856f7de1061 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -134,6 +134,10 @@ jobs: signType: $(_SignType) zipSources: false feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: + ConnectedPMEServiceName: 6cc74545-d7b9-4050-9dfa-ebefcc8961ea + ${{ else }}: + ConnectedPMEServiceName: 248d384a-b39b-46e3-8ad5-c2c210d5e7ca env: TeamName: $(_TeamName) continueOnError: ${{ parameters.continueOnError }} diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 82b2798ba307..bb048ad125a8 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -417,7 +417,7 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = # Locate Visual Studio installation or download x-copy msbuild. $vsInfo = LocateVisualStudio $vsRequirements - if ($vsInfo -ne $null) { + if ($vsInfo -ne $null -and $env:ForceUseXCopyMSBuild -eq $null) { # Ensure vsInstallDir has a trailing slash $vsInstallDir = Join-Path $vsInfo.installationPath "\" $vsMajorVersion = $vsInfo.installationVersion.Split('.')[0] diff --git a/global.json b/global.json index 7f1b9fb614c9..eb59ddf5a90c 100644 --- a/global.json +++ b/global.json @@ -25,8 +25,8 @@ }, "msbuild-sdks": { "Yarn.MSBuild": "1.22.19", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25310.3", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25310.3" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25407.1", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.25407.1" }, "native-tools": { "jdk": "latest" From 9dc3f65fb2d00286c5bdccb89b58ca889d810aa1 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Wed, 13 Aug 2025 04:13:15 +0000 Subject: [PATCH 71/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-runtime build 20250812.10 Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , Microsoft.SourceBuild.Intermediate.runtime.linux-x64 From Version 8.0.19-servicing.25365.14 -> To Version 8.0.20-servicing.25412.10 --- NuGet.config | 14 ++------------ eng/Version.Details.xml | 40 ++++++++++++++++++++-------------------- eng/Versions.props | 20 ++++++++++---------- 3 files changed, 32 insertions(+), 42 deletions(-) diff --git a/NuGet.config b/NuGet.config index 5f1d6aeaf486..842f009f7d3f 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,14 +6,9 @@ - - - - - - + @@ -34,14 +29,9 @@ - - - - - - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6220e76abee8..fd50b85b76f4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -121,9 +121,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - fce8ed90dc43047eabec2b32c04ee46b789ad5d1 + 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -185,9 +185,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - fce8ed90dc43047eabec2b32c04ee46b789ad5d1 + 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f https://github.com/dotnet/source-build-externals @@ -275,17 +275,17 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 81cabf2857a01351e5ab578947c7403a5b128ad1 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - fce8ed90dc43047eabec2b32c04ee46b789ad5d1 + 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - fce8ed90dc43047eabec2b32c04ee46b789ad5d1 + 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - fce8ed90dc43047eabec2b32c04ee46b789ad5d1 + 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -316,22 +316,22 @@ Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime. All Runtime.$rid packages should have the same version. --> - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - fce8ed90dc43047eabec2b32c04ee46b789ad5d1 + 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - fce8ed90dc43047eabec2b32c04ee46b789ad5d1 + 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - fce8ed90dc43047eabec2b32c04ee46b789ad5d1 + 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - fce8ed90dc43047eabec2b32c04ee46b789ad5d1 + 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f https://github.com/dotnet/xdt @@ -368,9 +368,9 @@ - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - fce8ed90dc43047eabec2b32c04ee46b789ad5d1 + 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f https://github.com/dotnet/winforms diff --git a/eng/Versions.props b/eng/Versions.props index f229f2c31cc6..615ef59b91bd 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -67,12 +67,12 @@ 8.0.2 - 8.0.19 - 8.0.19 - 8.0.19 - 8.0.19 - 8.0.19 - 8.0.19-servicing.25365.14 + 8.0.20 + 8.0.20 + 8.0.20 + 8.0.20 + 8.0.20 + 8.0.20-servicing.25412.10 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.19-servicing.25365.14 + 8.0.20-servicing.25412.10 8.0.1 8.0.1 8.0.1 @@ -109,7 +109,7 @@ 8.0.0 8.0.2 8.0.0 - 8.0.19-servicing.25365.14 + 8.0.20-servicing.25412.10 8.0.1 8.0.1 8.0.2 @@ -129,9 +129,9 @@ 8.0.0 8.0.0 8.0.0 - 8.0.19-servicing.25365.14 + 8.0.20-servicing.25412.10 - 8.0.19-servicing.25365.14 + 8.0.20-servicing.25412.10 8.0.0 8.0.1 From 166ad020f3204878b256a0f6f9d9673067524730 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Wed, 13 Aug 2025 05:04:26 +0000 Subject: [PATCH 72/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250812.4 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.19 -> To Version 8.0.20 --- NuGet.config | 2 ++ eng/Version.Details.xml | 32 ++++++++++++++++---------------- eng/Versions.props | 16 ++++++++-------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/NuGet.config b/NuGet.config index 842f009f7d3f..825f4622cb09 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,6 +6,7 @@ + @@ -29,6 +30,7 @@ + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index fd50b85b76f4..131a0a4f6aed 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -9,37 +9,37 @@ --> - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24e93fcb4900536922554fc215429cf954016ed1 + 1e55361e641259e5851dd089ef57fac25f03cb50 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24e93fcb4900536922554fc215429cf954016ed1 + 1e55361e641259e5851dd089ef57fac25f03cb50 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24e93fcb4900536922554fc215429cf954016ed1 + 1e55361e641259e5851dd089ef57fac25f03cb50 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24e93fcb4900536922554fc215429cf954016ed1 + 1e55361e641259e5851dd089ef57fac25f03cb50 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24e93fcb4900536922554fc215429cf954016ed1 + 1e55361e641259e5851dd089ef57fac25f03cb50 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24e93fcb4900536922554fc215429cf954016ed1 + 1e55361e641259e5851dd089ef57fac25f03cb50 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24e93fcb4900536922554fc215429cf954016ed1 + 1e55361e641259e5851dd089ef57fac25f03cb50 - + https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 24e93fcb4900536922554fc215429cf954016ed1 + 1e55361e641259e5851dd089ef57fac25f03cb50 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 615ef59b91bd..45241aadb628 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -143,14 +143,14 @@ 9.0.0-preview.9.24518.1 9.0.0-preview.9.24518.1 - 8.0.19 - 8.0.19 - 8.0.19 - 8.0.19 - 8.0.19 - 8.0.19 - 8.0.19 - 8.0.19 + 8.0.20 + 8.0.20 + 8.0.20 + 8.0.20 + 8.0.20 + 8.0.20 + 8.0.20 + 8.0.20 4.8.0-7.24574.2 4.8.0-7.24574.2 From fff574a542a75fafde249176b30bc8fbe311bae9 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Fri, 15 Aug 2025 23:04:59 +0000 Subject: [PATCH 73/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-runtime build 20250815.11 Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , Microsoft.SourceBuild.Intermediate.runtime.linux-x64 From Version 8.0.20-servicing.25412.10 -> To Version 8.0.20-servicing.25415.11 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 30 +++++++++++++++--------------- eng/Versions.props | 10 +++++----- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/NuGet.config b/NuGet.config index 825f4622cb09..245751e0f6c3 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 131a0a4f6aed..20750425c571 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -121,9 +121,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f + dd6010a8a425962e7793cc741e1f79f8681e4882 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -185,9 +185,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f + dd6010a8a425962e7793cc741e1f79f8681e4882 https://github.com/dotnet/source-build-externals @@ -277,15 +277,15 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f + dd6010a8a425962e7793cc741e1f79f8681e4882 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f + dd6010a8a425962e7793cc741e1f79f8681e4882 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f + dd6010a8a425962e7793cc741e1f79f8681e4882 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -318,20 +318,20 @@ --> https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f + dd6010a8a425962e7793cc741e1f79f8681e4882 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f + dd6010a8a425962e7793cc741e1f79f8681e4882 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f + dd6010a8a425962e7793cc741e1f79f8681e4882 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f + dd6010a8a425962e7793cc741e1f79f8681e4882 https://github.com/dotnet/xdt @@ -368,9 +368,9 @@ - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - 6b12df1a810008460d16ef9bfd2cecb1a9a8c29f + dd6010a8a425962e7793cc741e1f79f8681e4882 https://github.com/dotnet/winforms diff --git a/eng/Versions.props b/eng/Versions.props index 45241aadb628..e0e889926c2b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -72,7 +72,7 @@ 8.0.20 8.0.20 8.0.20 - 8.0.20-servicing.25412.10 + 8.0.20-servicing.25415.11 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.20-servicing.25412.10 + 8.0.20-servicing.25415.11 8.0.1 8.0.1 8.0.1 @@ -109,7 +109,7 @@ 8.0.0 8.0.2 8.0.0 - 8.0.20-servicing.25412.10 + 8.0.20-servicing.25415.11 8.0.1 8.0.1 8.0.2 @@ -129,9 +129,9 @@ 8.0.0 8.0.0 8.0.0 - 8.0.20-servicing.25412.10 + 8.0.20-servicing.25415.11 - 8.0.20-servicing.25412.10 + 8.0.20-servicing.25415.11 8.0.0 8.0.1 From c30f413fe3a19b164731c89028685f45364f23f1 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Sat, 16 Aug 2025 00:45:47 +0000 Subject: [PATCH 74/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250815.10 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.20 -> To Version 8.0.20 --- NuGet.config | 4 ++-- eng/Version.Details.xml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/NuGet.config b/NuGet.config index 245751e0f6c3..90fb5ccb8c69 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,7 +6,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 20750425c571..1235b34a18b4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,35 +11,35 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 1e55361e641259e5851dd089ef57fac25f03cb50 + 449121f9669869d7432957f638aa14eb9f666849 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 1e55361e641259e5851dd089ef57fac25f03cb50 + 449121f9669869d7432957f638aa14eb9f666849 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 1e55361e641259e5851dd089ef57fac25f03cb50 + 449121f9669869d7432957f638aa14eb9f666849 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 1e55361e641259e5851dd089ef57fac25f03cb50 + 449121f9669869d7432957f638aa14eb9f666849 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 1e55361e641259e5851dd089ef57fac25f03cb50 + 449121f9669869d7432957f638aa14eb9f666849 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 1e55361e641259e5851dd089ef57fac25f03cb50 + 449121f9669869d7432957f638aa14eb9f666849 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 1e55361e641259e5851dd089ef57fac25f03cb50 + 449121f9669869d7432957f638aa14eb9f666849 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 1e55361e641259e5851dd089ef57fac25f03cb50 + 449121f9669869d7432957f638aa14eb9f666849 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime From 762446fd82089552d4149dd7e1fbd78d59309ea3 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Wed, 20 Aug 2025 03:16:37 +0000 Subject: [PATCH 75/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-runtime build 20250819.14 Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , Microsoft.SourceBuild.Intermediate.runtime.linux-x64 From Version 8.0.20-servicing.25415.11 -> To Version 8.0.20-servicing.25419.14 --- NuGet.config | 6 ++++-- eng/Version.Details.xml | 30 +++++++++++++++--------------- eng/Versions.props | 10 +++++----- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/NuGet.config b/NuGet.config index 90fb5ccb8c69..2f99e6c50003 100644 --- a/NuGet.config +++ b/NuGet.config @@ -7,9 +7,10 @@ + - + @@ -30,10 +31,11 @@ + - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1235b34a18b4..c49a1b5f941a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -121,9 +121,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - dd6010a8a425962e7793cc741e1f79f8681e4882 + 574100b692e71fa3426931adf4c1ba42e4ee5213 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -185,9 +185,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 5535e31a712343a63f5d7d796cd874e563e5ac14 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - dd6010a8a425962e7793cc741e1f79f8681e4882 + 574100b692e71fa3426931adf4c1ba42e4ee5213 https://github.com/dotnet/source-build-externals @@ -277,15 +277,15 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - dd6010a8a425962e7793cc741e1f79f8681e4882 + 574100b692e71fa3426931adf4c1ba42e4ee5213 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - dd6010a8a425962e7793cc741e1f79f8681e4882 + 574100b692e71fa3426931adf4c1ba42e4ee5213 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - dd6010a8a425962e7793cc741e1f79f8681e4882 + 574100b692e71fa3426931adf4c1ba42e4ee5213 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -318,20 +318,20 @@ --> https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - dd6010a8a425962e7793cc741e1f79f8681e4882 + 574100b692e71fa3426931adf4c1ba42e4ee5213 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - dd6010a8a425962e7793cc741e1f79f8681e4882 + 574100b692e71fa3426931adf4c1ba42e4ee5213 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - dd6010a8a425962e7793cc741e1f79f8681e4882 + 574100b692e71fa3426931adf4c1ba42e4ee5213 - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - dd6010a8a425962e7793cc741e1f79f8681e4882 + 574100b692e71fa3426931adf4c1ba42e4ee5213 https://github.com/dotnet/xdt @@ -368,9 +368,9 @@ - + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - dd6010a8a425962e7793cc741e1f79f8681e4882 + 574100b692e71fa3426931adf4c1ba42e4ee5213 https://github.com/dotnet/winforms diff --git a/eng/Versions.props b/eng/Versions.props index e0e889926c2b..dfc636c88f04 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -72,7 +72,7 @@ 8.0.20 8.0.20 8.0.20 - 8.0.20-servicing.25415.11 + 8.0.20-servicing.25419.14 8.0.0 8.0.1 8.0.0 @@ -93,7 +93,7 @@ 8.0.0 8.0.0 8.0.0 - 8.0.20-servicing.25415.11 + 8.0.20-servicing.25419.14 8.0.1 8.0.1 8.0.1 @@ -109,7 +109,7 @@ 8.0.0 8.0.2 8.0.0 - 8.0.20-servicing.25415.11 + 8.0.20-servicing.25419.14 8.0.1 8.0.1 8.0.2 @@ -129,9 +129,9 @@ 8.0.0 8.0.0 8.0.0 - 8.0.20-servicing.25415.11 + 8.0.20-servicing.25419.14 - 8.0.20-servicing.25415.11 + 8.0.20-servicing.25419.14 8.0.0 8.0.1 From 2e031fc11dcde0d2f803f8712dd8339907a10ec7 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Wed, 20 Aug 2025 08:04:21 +0000 Subject: [PATCH 76/76] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-efcore build 20250819.10 dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools From Version 8.0.20 -> To Version 8.0.20 --- NuGet.config | 6 ++---- eng/Version.Details.xml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/NuGet.config b/NuGet.config index 2f99e6c50003..05d6d50db75d 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,8 +6,7 @@ - - + @@ -31,8 +30,7 @@ - - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c49a1b5f941a..346a9afd7c06 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,35 +11,35 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 449121f9669869d7432957f638aa14eb9f666849 + a947fe22902f3f0b921f5dafed9f059eaa4d18c6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 449121f9669869d7432957f638aa14eb9f666849 + a947fe22902f3f0b921f5dafed9f059eaa4d18c6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 449121f9669869d7432957f638aa14eb9f666849 + a947fe22902f3f0b921f5dafed9f059eaa4d18c6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 449121f9669869d7432957f638aa14eb9f666849 + a947fe22902f3f0b921f5dafed9f059eaa4d18c6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 449121f9669869d7432957f638aa14eb9f666849 + a947fe22902f3f0b921f5dafed9f059eaa4d18c6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 449121f9669869d7432957f638aa14eb9f666849 + a947fe22902f3f0b921f5dafed9f059eaa4d18c6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 449121f9669869d7432957f638aa14eb9f666849 + a947fe22902f3f0b921f5dafed9f059eaa4d18c6 https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - 449121f9669869d7432957f638aa14eb9f666849 + a947fe22902f3f0b921f5dafed9f059eaa4d18c6 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime