From 68041e49b4e2b0812aae4839cf3ddeb5839c819a Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 12 Sep 2023 14:30:57 -0700 Subject: [PATCH 1/5] Update NET to version 8.0.100-rc.1.23455.8 --- DotnetRuntimeMetadata.json | 4 ++-- global.json | 2 +- ...rosoft.PowerShell.Commands.Diagnostics.csproj | 2 +- ...crosoft.PowerShell.Commands.Management.csproj | 2 +- .../Microsoft.PowerShell.Commands.Utility.csproj | 6 +++--- .../Microsoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 8 ++++---- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 16 ++++++++-------- .../BenchmarkDotNet.Extensions.csproj | 4 ++-- .../ResultsComparer/ResultsComparer.csproj | 2 +- ...crosoft.PowerShell.NamedPipeConnection.csproj | 2 +- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json index fa2b70fd18c..464ca8a6291 100644 --- a/DotnetRuntimeMetadata.json +++ b/DotnetRuntimeMetadata.json @@ -1,9 +1,9 @@ { "sdk": { - "channel": "8.0.1xx-preview7", + "channel": "8.0.1xx-rc1", "quality": "daily", "qualityFallback": "preview", - "packageVersionPattern": "8.0.0-preview.7", + "packageVersionPattern": "8.0.0-rc.1", "sdkImageVersion": "8.0.100", "nextChannel": "8.0.1xx-preview4", "azureFeed": "", diff --git a/global.json b/global.json index 4ba67068e2a..1c036716cc1 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100-preview.7.23376.3" + "version": "8.0.100-rc.1.23455.8" } } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj index e1bc0cf95e3..d85cf9797dc 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index 500e3e2fbf5..a76c7cd3dc9 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 7658d48c8f1..9e71d3ebd6c 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,9 +32,9 @@ - - - + + + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index 9d3f8e6cb61..2e0f4153b04 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index f87b369b668..16b011fc4ee 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -19,9 +19,9 @@ - - - + + + - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index 0aee6a78fed..bacaa026f30 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 281162df4c7..b33f4a8c045 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -34,16 +34,16 @@ - - - - + + + + - + - - - + + + diff --git a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj index f9b90d2ada6..0956c4122c7 100644 --- a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj +++ b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj b/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj index 7d9a355baf9..0fc80386919 100644 --- a/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj +++ b/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj @@ -9,7 +9,7 @@ - + diff --git a/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj b/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj index 01d397df9e0..6dcec1060f1 100644 --- a/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj +++ b/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj @@ -15,6 +15,6 @@ - + diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index 6db00b25e95..34a5da376ef 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 8d52ef0275d..6068ea71a65 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + From 4bf4d2adfb79328b622f52de87b9c79412627bc5 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 12 Sep 2023 15:02:21 -0700 Subject: [PATCH 2/5] Add workaround for win7-x64 not working --- build.psm1 | 5 +++++ src/ResGen/ResGen.csproj | 2 +- src/TypeCatalogGen/TypeCatalogGen.csproj | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.psm1 b/build.psm1 index a226bde5349..b483bede350 100644 --- a/build.psm1 +++ b/build.psm1 @@ -457,6 +457,10 @@ Fix steps: $Arguments += "--self-contained" } + if ($Options.Runtime -like 'win*') { + $Arguments += "/property:UseRidGraph=true" + } + if ($Options.Runtime -like 'win*' -or ($Options.Runtime -like 'fxdependent*' -and $environment.IsWindows)) { $Arguments += "/property:IsWindows=true" if(!$environment.IsWindows) { @@ -800,6 +804,7 @@ function Restore-PSPackage if ($Options.Runtime -like 'win*') { $RestoreArguments += "/property:EnableWindowsTargeting=True" + $RestoreArguments += "/property:UseRidGraph=True" } if ($InteractiveAuth) { diff --git a/src/ResGen/ResGen.csproj b/src/ResGen/ResGen.csproj index 5174826b96f..6fc2ebd22bf 100644 --- a/src/ResGen/ResGen.csproj +++ b/src/ResGen/ResGen.csproj @@ -7,7 +7,7 @@ Exe true true - win7-x86;win7-x64;osx-x64;linux-x64 + win-x86;win-x64;osx-x64;linux-x64 diff --git a/src/TypeCatalogGen/TypeCatalogGen.csproj b/src/TypeCatalogGen/TypeCatalogGen.csproj index 2ccfc7f45c1..f475ae83345 100644 --- a/src/TypeCatalogGen/TypeCatalogGen.csproj +++ b/src/TypeCatalogGen/TypeCatalogGen.csproj @@ -8,7 +8,7 @@ Exe true true - win7-x86;win7-x64;osx-x64;linux-x64 + win-x86;win-x64;osx-x64;linux-x64 From bd761686dc5238f872579450a65c17c03f014f3e Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 12 Sep 2023 15:15:41 -0700 Subject: [PATCH 3/5] Fix issues reported by CA2249 --- .../engine/parser/ast.cs | 3 +-- .../engine/remoting/commands/PSRemotingCmdlet.cs | 4 ++-- .../engine/remoting/commands/ReceivePSSession.cs | 4 ++-- .../namespaces/FileSystemProvider.cs | 12 +----------- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index 5222f2f53ba..e9eea85d2ce 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -8451,8 +8451,7 @@ public TypeName(IScriptExtent extent, string name) throw PSTraceSource.NewArgumentException(nameof(name)); } - int backtick = name.IndexOf('`'); - if (backtick != -1) + if (name.Contains('`')) { name = name.Replace("``", "`"); } diff --git a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs index 7c32733bb1f..258bd4f7095 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs @@ -3940,8 +3940,8 @@ internal Collection GetDisconnectedSessions(Collection From 4829b5d7f91a0bda00575ed098f4923c78af7737 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 20 Sep 2023 10:59:16 -0700 Subject: [PATCH 4/5] Update 'RuntimeIdentifiers' for some test projects --- build.psm1 | 7 +++++++ .../engine/remoting/commands/PSRemotingCmdlet.cs | 8 ++++---- .../engine/remoting/commands/ReceivePSSession.cs | 6 +++--- test/hosting/hosting.tests.csproj | 1 - test/tools/TestExe/TestExe.csproj | 2 +- test/tools/TestService/TestService.csproj | 2 +- test/tools/UnixSocket/UnixSocket.csproj | 2 +- test/xUnit/xUnit.tests.csproj | 2 +- 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/build.psm1 b/build.psm1 index b483bede350..255a0c6a131 100644 --- a/build.psm1 +++ b/build.psm1 @@ -458,6 +458,13 @@ Fix steps: } if ($Options.Runtime -like 'win*') { + # Starting in .NET 8, the .NET SDK won't recognize version-specific RIDs by default, such as win7-x64, + # see https://learn.microsoft.com/dotnet/core/compatibility/sdk/8.0/rid-graph for details. + # It will cause huge amount of changes in our build infrastructure because our building and packaging + # scripts have the 'win7-xx' assumption regarding the target runtime. + # + # As a workaround, we use the old full RID graph during the build so that we can continue to use the + # 'win7-x64' and 'win7-x86' RIDs. $Arguments += "/property:UseRidGraph=true" } diff --git a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs index 258bd4f7095..c633fd9fe5c 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs @@ -203,7 +203,7 @@ internal string GetMessage(string resourceString, params object[] args) /// /// Default shellname. /// - protected const string DefaultPowerShellRemoteShellName = System.Management.Automation.Remoting.Client.WSManNativeApi.ResourceURIPrefix + "Microsoft.PowerShell"; + protected const string DefaultPowerShellRemoteShellName = WSManNativeApi.ResourceURIPrefix + "Microsoft.PowerShell"; /// /// Default application name for the connection uri. @@ -3940,9 +3940,9 @@ internal Collection GetDisconnectedSessions(Collection PowerShell hosting SDK xUnit Tests powershell-hosting-tests - diff --git a/test/tools/TestExe/TestExe.csproj b/test/tools/TestExe/TestExe.csproj index 8eec2019df3..2e9ad01d104 100644 --- a/test/tools/TestExe/TestExe.csproj +++ b/test/tools/TestExe/TestExe.csproj @@ -8,7 +8,7 @@ Exe true true - win7-x86;win7-x64;osx-x64;linux-x64 + win-x86;win-x64;osx-x64;linux-x64 diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index 34a5da376ef..d1298eed38a 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -9,7 +9,7 @@ Exe true true - win7-x86;win7-x64 + win-x86;win-x64 diff --git a/test/tools/UnixSocket/UnixSocket.csproj b/test/tools/UnixSocket/UnixSocket.csproj index a4143270c8c..e8a177bd20f 100644 --- a/test/tools/UnixSocket/UnixSocket.csproj +++ b/test/tools/UnixSocket/UnixSocket.csproj @@ -8,7 +8,7 @@ Exe true true - win7-x86;win7-x64;osx-x64;linux-x64 + win-x86;win-x64;osx-x64;linux-x64 diff --git a/test/xUnit/xUnit.tests.csproj b/test/xUnit/xUnit.tests.csproj index b3daa34dd7c..acd7b1e0b3b 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -6,7 +6,7 @@ PowerShell xUnit Tests powershell-tests true - win7-x86;win7-x64;osx-x64;linux-x64 + win-x86;win-x64;osx-x64;linux-x64 From 85e4708541ed0d750efacff57c823fb9e7aa1423 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 20 Sep 2023 12:11:51 -0700 Subject: [PATCH 5/5] Fix the RID value used for building test tools --- build.psm1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.psm1 b/build.psm1 index 255a0c6a131..235d9aed3ea 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1209,6 +1209,10 @@ function Publish-PSTestTools { $runtime = $Options.Runtime } + # We are using non-version/distro specific RIDs for test tools, so we need to fix the runtime + # value here if it starts with 'win7'. + $runtime = $runtime -replace '^win7-', 'win-' + Write-Verbose -Verbose -Message "Starting dotnet publish for $toolPath with runtime $runtime" dotnet publish --output bin --configuration $Options.Configuration --framework $Options.Framework --runtime $runtime --self-contained | Out-String | Write-Verbose -Verbose