From fd75dec5a18195e987ff9f4a915450499e27379e Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Mon, 7 Aug 2023 16:23:42 -0700 Subject: [PATCH 01/17] Update SDK to 8.0.100-rc.1.23407.2 --- global.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 818a239f25cb..fed4e666c75d 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "sdk": { - "version": "8.0.100-rc.1.23381.2" + "version": "8.0.100-rc.1.23407.2" }, "tools": { - "dotnet": "8.0.100-rc.1.23381.2", + "dotnet": "8.0.100-rc.1.23407.2", "runtimes": { "dotnet/x86": [ "$(MicrosoftNETCoreBrowserDebugHostTransportVersion)" From f0d399e27e4dc013eb4f76b2c65ae44a439503dc Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Tue, 8 Aug 2023 10:54:22 -0700 Subject: [PATCH 02/17] Condition IsTrimmable on TargetFramework --- Directory.Build.targets | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Directory.Build.targets b/Directory.Build.targets index fac926ffdb00..7d68a55cdb4a 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,7 @@ + + $([MSBuild]::ValueOrDefault($(IsTrimmable),'false')) $(EnableAOTAnalyzer) From 71bb235aec0f99954929b345fc1024be3cd36f9b Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Tue, 8 Aug 2023 17:23:54 -0700 Subject: [PATCH 03/17] Update CodeGen.proj to account for conditional IsTrimmable metadata --- eng/CodeGen.proj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/CodeGen.proj b/eng/CodeGen.proj index dccb26986b3b..d93565a209d7 100644 --- a/eng/CodeGen.proj +++ b/eng/CodeGen.proj @@ -24,7 +24,9 @@ <_RequiresDelayedBuild Include="@(_ProvidesReferenceOrRequiresDelay->WithMetadataValue('RequiresDelayedBuild','true')->Distinct())" /> <_SharedFrameworkAndPackageRef Include="@(_ProjectReferenceProvider->WithMetadataValue('IsAspNetCoreApp','true')->WithMetadataValue('IsPackable', 'true'))" /> <_SharedFrameworkRef Include="@(_ProjectReferenceProvider->WithMetadataValue('IsAspNetCoreApp','true')->WithMetadataValue('IsPackable', 'false'))" /> - <_TrimmableProject Include="@(_ProjectReferenceProvider->WithMetadataValue('IsTrimmable', 'true'))" /> + + + <_TrimmableProject Include="@(_ProvidesReferenceOrRequiresDelay->WithMetadataValue('IsTrimmable', 'true')->WithMetadataValue('IsProjectReferenceProvider','true')->Distinct())" /> From d3bea2408a43bb2d351c492ca37b0bcebe5f25bc Mon Sep 17 00:00:00 2001 From: William Godbe Date: Wed, 9 Aug 2023 09:49:53 -0700 Subject: [PATCH 04/17] Update default-build.yml --- .azure/pipelines/jobs/default-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index 9c9b41d2415e..fddbf945b1bc 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -124,11 +124,11 @@ jobs: ${{ if eq(parameters.agentOs, 'Windows') }}: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $(DncEngPublicBuildPool) - demands: ImageOverride -equals 1es-windows-2022-open + demands: ImageOverride -equals Windows.Amd64.VS2022.Pre.Open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: $(DncEngInternalBuildPool) # Visual Studio Enterprise - contains some stuff, like SQL Server and IIS Express, that we use for testing - demands: ImageOverride -equals 1es-windows-2022 + demands: ImageOverride -equals Windows.Amd64.VS2022.Pre ${{ if ne(parameters.container, '') }}: container: ${{ parameters.container }} ${{ if ne(parameters.disableComponentGovernance, '') }}: From e15561c320ebf2e1599bcef6eb5895857227baf3 Mon Sep 17 00:00:00 2001 From: William Godbe Date: Wed, 9 Aug 2023 09:53:10 -0700 Subject: [PATCH 05/17] Update default-build.yml --- .azure/pipelines/jobs/default-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index fddbf945b1bc..5e1b6f373c42 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -124,11 +124,11 @@ jobs: ${{ if eq(parameters.agentOs, 'Windows') }}: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $(DncEngPublicBuildPool) - demands: ImageOverride -equals Windows.Amd64.VS2022.Pre.Open + demands: ImageOverride -equals windows.vs2022preview.amd64.open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: $(DncEngInternalBuildPool) # Visual Studio Enterprise - contains some stuff, like SQL Server and IIS Express, that we use for testing - demands: ImageOverride -equals Windows.Amd64.VS2022.Pre + demands: ImageOverride -equals windows.vs2022preview.amd64 ${{ if ne(parameters.container, '') }}: container: ${{ parameters.container }} ${{ if ne(parameters.disableComponentGovernance, '') }}: From 43c3e688c0b185c44187941561f042dd39332f93 Mon Sep 17 00:00:00 2001 From: William Godbe Date: Wed, 9 Aug 2023 11:23:28 -0700 Subject: [PATCH 06/17] Update default-build.yml --- .azure/pipelines/jobs/default-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index 5e1b6f373c42..9a674b67b721 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -124,11 +124,11 @@ jobs: ${{ if eq(parameters.agentOs, 'Windows') }}: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $(DncEngPublicBuildPool) - demands: ImageOverride -equals windows.vs2022preview.amd64.open + demands: ImageOverride -equals windows.vs2022preview.scout.amd64.open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: $(DncEngInternalBuildPool) # Visual Studio Enterprise - contains some stuff, like SQL Server and IIS Express, that we use for testing - demands: ImageOverride -equals windows.vs2022preview.amd64 + demands: ImageOverride -equals windows.vs2022preview.scout.amd64 ${{ if ne(parameters.container, '') }}: container: ${{ parameters.container }} ${{ if ne(parameters.disableComponentGovernance, '') }}: From 329eaf33bf6220057ee6b74de6907be2ec68a4bd Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 16 Aug 2023 09:45:21 -0700 Subject: [PATCH 07/17] Try updating workload --- .azure/pipelines/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 22e33d0cf2c8..a68ae4183a4e 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -231,6 +231,11 @@ stages: - script: "echo ##vso[build.addbuildtag]daily-build" displayName: 'Set CI daily-build tag' + - task: DotNetCoreCLI@2 + inputs: + command: 'custom' + custom: 'dotnet workload update' + # !!! NOTE !!! Some of these steps have disabled code signing. # This is intentional to workaround https://github.com/dotnet/arcade/issues/1957 which always re-submits for code-signing, even # if they have already been signed. This results in slower builds due to re-submitting the same .nupkg many times for signing. From cf3580ec7dcdce240cba820e48540e667fc42b8b Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 16 Aug 2023 10:14:26 -0700 Subject: [PATCH 08/17] Try this --- .azure/pipelines/ci.yml | 5 ----- .azure/pipelines/jobs/default-build.yml | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index a68ae4183a4e..22e33d0cf2c8 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -231,11 +231,6 @@ stages: - script: "echo ##vso[build.addbuildtag]daily-build" displayName: 'Set CI daily-build tag' - - task: DotNetCoreCLI@2 - inputs: - command: 'custom' - custom: 'dotnet workload update' - # !!! NOTE !!! Some of these steps have disabled code signing. # This is intentional to workaround https://github.com/dotnet/arcade/issues/1957 which always re-submits for code-signing, even # if they have already been signed. This results in slower builds due to re-submitting the same .nupkg many times for signing. diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index 9a674b67b721..372fb9731915 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -213,6 +213,11 @@ jobs: - ${{ if eq(parameters.agentOs, 'Windows') }}: - powershell: Write-Host "##vso[task.prependpath]$(DOTNET_CLI_HOME)\.dotnet\tools" displayName: Add dotnet tools to path + - task: DotNetCoreCLI@2 + inputs: + command: 'custom' + custom: 'dotnet workload update' + displayName: Update workloads - ${{ if ne(parameters.agentOs, 'Windows') }}: - script: echo "##vso[task.prependpath]$(DOTNET_CLI_HOME)/.dotnet/tools" displayName: Add dotnet tools to path From efd0f864ce48f6c5e5e05e8db64378666eef2327 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 16 Aug 2023 12:18:30 -0700 Subject: [PATCH 09/17] Outside of working dir --- .azure/pipelines/jobs/default-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index 372fb9731915..49cccd18ad55 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -216,7 +216,8 @@ jobs: - task: DotNetCoreCLI@2 inputs: command: 'custom' - custom: 'dotnet workload update' + custom: 'dotnet workload update --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json' + workingDirectory: $(Agent.BuildDirectory) displayName: Update workloads - ${{ if ne(parameters.agentOs, 'Windows') }}: - script: echo "##vso[task.prependpath]$(DOTNET_CLI_HOME)/.dotnet/tools" From 5074d710427a82f29fd3b9ff2765e0dd9b026581 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 16 Aug 2023 12:36:00 -0700 Subject: [PATCH 10/17] Oops --- .azure/pipelines/jobs/default-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index 49cccd18ad55..41ef9b252fd2 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -216,7 +216,7 @@ jobs: - task: DotNetCoreCLI@2 inputs: command: 'custom' - custom: 'dotnet workload update --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json' + custom: 'workload update --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json' workingDirectory: $(Agent.BuildDirectory) displayName: Update workloads - ${{ if ne(parameters.agentOs, 'Windows') }}: From f372967ce3ad16b047155d51d9df954ba247ff2c Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 22 Aug 2023 09:44:28 -0700 Subject: [PATCH 11/17] Update to 9.0 SDK --- global.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 4cdf9ec97d6b..de12c94c08bd 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "sdk": { - "version": "8.0.100-rc.1.23407.2" + "version": "9.0.100-alpha.1.23421.9" }, "tools": { - "dotnet": "8.0.100-rc.1.23407.2", + "dotnet": "9.0.100-alpha.1.23421.9", "runtimes": { "dotnet/x86": [ "$(MicrosoftNETCoreBrowserDebugHostTransportVersion)" From 9221ef556475f2223ff04b1c913728ba79c457af Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 22 Aug 2023 10:29:03 -0700 Subject: [PATCH 12/17] Add nullability annotation to TemplatePart.Text --- src/Http/Routing/src/Template/TemplatePart.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Http/Routing/src/Template/TemplatePart.cs b/src/Http/Routing/src/Template/TemplatePart.cs index b0f1ef02b1ab..a58b43e3e9ce 100644 --- a/src/Http/Routing/src/Template/TemplatePart.cs +++ b/src/Http/Routing/src/Template/TemplatePart.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.AspNetCore.Routing.Patterns; @@ -104,6 +105,7 @@ public static TemplatePart CreateParameter( /// /// if the route part is represents a literal value. /// + [MemberNotNullWhen(true, nameof(Text))] public bool IsLiteral { get; private set; } /// /// if the route part represents a parameterized value. From 314d480c6b8ec161644e8e25f59aab9e12ce607a Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 22 Aug 2023 11:58:11 -0700 Subject: [PATCH 13/17] Remove update workload workaround --- .azure/pipelines/jobs/default-build.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index 41ef9b252fd2..9a674b67b721 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -213,12 +213,6 @@ jobs: - ${{ if eq(parameters.agentOs, 'Windows') }}: - powershell: Write-Host "##vso[task.prependpath]$(DOTNET_CLI_HOME)\.dotnet\tools" displayName: Add dotnet tools to path - - task: DotNetCoreCLI@2 - inputs: - command: 'custom' - custom: 'workload update --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json' - workingDirectory: $(Agent.BuildDirectory) - displayName: Update workloads - ${{ if ne(parameters.agentOs, 'Windows') }}: - script: echo "##vso[task.prependpath]$(DOTNET_CLI_HOME)/.dotnet/tools" displayName: Add dotnet tools to path From 7869c5418e819ce1e60445672e331ab1cbccf959 Mon Sep 17 00:00:00 2001 From: William Godbe Date: Tue, 29 Aug 2023 12:33:00 -0700 Subject: [PATCH 14/17] Update default-build.yml --- .azure/pipelines/jobs/default-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index 9a674b67b721..9c9b41d2415e 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -124,11 +124,11 @@ jobs: ${{ if eq(parameters.agentOs, 'Windows') }}: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $(DncEngPublicBuildPool) - demands: ImageOverride -equals windows.vs2022preview.scout.amd64.open + demands: ImageOverride -equals 1es-windows-2022-open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: $(DncEngInternalBuildPool) # Visual Studio Enterprise - contains some stuff, like SQL Server and IIS Express, that we use for testing - demands: ImageOverride -equals windows.vs2022preview.scout.amd64 + demands: ImageOverride -equals 1es-windows-2022 ${{ if ne(parameters.container, '') }}: container: ${{ parameters.container }} ${{ if ne(parameters.disableComponentGovernance, '') }}: From d1bc7a9a7003665822eb9629612d346f37bcc1b8 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 31 Aug 2023 07:48:45 +0800 Subject: [PATCH 15/17] More logging --- .../WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs b/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs index a9d48a344189..35ce3332158e 100644 --- a/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs +++ b/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Http.Timeouts; using Microsoft.AspNetCore.Testing; +using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.WebSockets.Test; @@ -543,6 +544,7 @@ public async Task WebSocket_Abort_Interrupts_Pending_ReceiveAsync() catch (Exception ex) { // Capture this exception so a test failure can give us more information. + Logger.LogError(ex, "Unexpected error."); receiveException = ex; } finally @@ -609,6 +611,11 @@ public async Task WebSocket_AllowsCancelling_Pending_ReceiveAsync_When_Cancellat operationWasCancelled.Set(); finishedWithOperationCancelled = true; } + catch (Exception ex) + { + Logger.LogError(ex, "Unexpected error."); + throw; + } finally { Assert.True(finishedWithOperationCancelled); From 2555a0cf77cf59f0344a644647fb9c8045d804d1 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 31 Aug 2023 08:49:07 +0800 Subject: [PATCH 16/17] Fix --- .../WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs b/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs index 35ce3332158e..95dfbcea5815 100644 --- a/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs +++ b/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs @@ -517,7 +517,7 @@ public async Task WebSocket_Abort_Interrupts_Pending_ReceiveAsync() serverSocket = await context.WebSockets.AcceptWebSocketAsync(); socketWasAccepted.Set(); - var serverBuffer = new byte[1024]; + var serverBuffer = new ArraySegment(new byte[1024]); try { @@ -594,7 +594,7 @@ public async Task WebSocket_AllowsCancelling_Pending_ReceiveAsync_When_Cancellat serverSocket = await context.WebSockets.AcceptWebSocketAsync(); socketWasAccepted.Set(); - var serverBuffer = new byte[1024]; + var serverBuffer = new ArraySegment(new byte[1024]); var finishedWithOperationCancelled = false; From 07836d8ea8740dcbcd2258c261c86cfe01c0be44 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 31 Aug 2023 09:25:28 +0800 Subject: [PATCH 17/17] Retry? --- .../test/UnitTests/WebSocketMiddlewareTests.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs b/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs index 95dfbcea5815..82b3f9cc1565 100644 --- a/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs +++ b/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs @@ -517,21 +517,19 @@ public async Task WebSocket_Abort_Interrupts_Pending_ReceiveAsync() serverSocket = await context.WebSockets.AcceptWebSocketAsync(); socketWasAccepted.Set(); - var serverBuffer = new ArraySegment(new byte[1024]); - try { while (serverSocket.State is WebSocketState.Open or WebSocketState.CloseSent) { if (firstReceiveOccured.IsSet) { - var pendingResponse = serverSocket.ReceiveAsync(serverBuffer, default); + var pendingResponse = serverSocket.ReceiveAsync(new ArraySegment(new byte[1024]), default); secondReceiveInitiated.Set(); var response = await pendingResponse; } else { - var response = await serverSocket.ReceiveAsync(serverBuffer, default); + var response = await serverSocket.ReceiveAsync(new ArraySegment(new byte[1024]), default); firstReceiveOccured.Set(); } } @@ -594,15 +592,13 @@ public async Task WebSocket_AllowsCancelling_Pending_ReceiveAsync_When_Cancellat serverSocket = await context.WebSockets.AcceptWebSocketAsync(); socketWasAccepted.Set(); - var serverBuffer = new ArraySegment(new byte[1024]); - var finishedWithOperationCancelled = false; try { while (serverSocket.State is WebSocketState.Open or WebSocketState.CloseSent) { - var response = await serverSocket.ReceiveAsync(serverBuffer, cts.Token); + var response = await serverSocket.ReceiveAsync(new ArraySegment(new byte[1024]), cts.Token); firstReceiveOccured.Set(); } }