From 74e4a52eedbf63d7e8454534a78ed4bac5e25962 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 29 Jun 2017 11:11:30 -0700 Subject: [PATCH 1/4] Update build.psm1 and appveyor.yml --- appveyor.yml | 2 +- build.psm1 | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 3cbdb96bfac..2102cba90cf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,7 +2,7 @@ version: 6.0.0-beta.3-{build} image: Visual Studio 2015 -# cache version - netcoreapp.2.0.0-preview1-002106-00 +# cache version - netcoreapp.2.0.0-preview3-25426-01 cache: - '%LocalAppData%\Microsoft\dotnet -> appveyor.yml' - '%HOMEDRIVE%%HOMEPATH%\.nuget\packages -> appveyor.yml' diff --git a/build.psm1 b/build.psm1 index 364fea38c58..22523e138cc 100644 --- a/build.psm1 +++ b/build.psm1 @@ -20,7 +20,7 @@ try { } $dotnetCLIChannel = "preview" -$dotnetCLIRequiredVersion = "2.0.0-preview1-005952" +$dotnetCLIRequiredVersion = "2.0.0-preview2-006502" # On Unix paths is separated by colon # On Windows paths is separated by semicolon @@ -1049,7 +1049,15 @@ function Install-Dotnet { Remove-Item -ErrorAction SilentlyContinue -Recurse -Force ~\AppData\Local\Microsoft\dotnet $installScript = "dotnet-install.ps1" Invoke-WebRequest -Uri $obtainUrl/$installScript -OutFile $installScript - & ./$installScript -Channel $Channel -Version $Version + + if (-not $IsCoreCLR) { + & ./$installScript -Channel $Channel -Version $Version + } else { + # dotnet-install.ps1 uses APIs that are not supported in .NET Core, so we run it with Windows PowerShell + $fullPSPath = Join-Path -Path $env:windir -ChildPath "System32\WindowsPowerShell\v1.0\powershell.exe" + $fullDotnetInstallPath = Join-Path -Path $pwd.Path -ChildPath $installScript + Start-NativeExecution { & $fullPSPath -NoLogo -NoProfile -File $fullDotnetInstallPath -Channel $Channel -Version $Version } + } } } From 3b63716044fa5d82873b062e94e251f9e7c79b32 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 29 Jun 2017 12:46:35 -0700 Subject: [PATCH 2/4] Add test/Test.Common.props --- .../AssemblyInfo.cs | 20 ------------------- .../Microsoft.PowerShell.PSReadLine.csproj | 18 +++-------------- src/ResGen/ResGen.csproj | 6 ++++-- src/TypeCatalogGen/TypeCatalogGen.csproj | 6 ++++-- src/powershell-unix/powershell-unix.csproj | 2 +- test/PSReadLine/PSReadLine.tests.csproj | 14 +++---------- test/Test.Common.props | 11 ++++++++++ test/csharp/csharp.tests.csproj | 8 +++----- test/tools/TestExe/TestExe.csproj | 5 +++-- 9 files changed, 32 insertions(+), 58 deletions(-) create mode 100644 test/Test.Common.props diff --git a/src/Microsoft.PowerShell.PSReadLine/AssemblyInfo.cs b/src/Microsoft.PowerShell.PSReadLine/AssemblyInfo.cs index 2ad73298749..be77dec90f8 100644 --- a/src/Microsoft.PowerShell.PSReadLine/AssemblyInfo.cs +++ b/src/Microsoft.PowerShell.PSReadLine/AssemblyInfo.cs @@ -8,14 +8,7 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("PSReadLine")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PSReadLine")] -[assembly: AssemblyCopyright("Copyright © 2013")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -24,16 +17,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("36053fb0-0bd0-4a1c-951c-b2ec109deca3")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.2")] diff --git a/src/Microsoft.PowerShell.PSReadLine/Microsoft.PowerShell.PSReadLine.csproj b/src/Microsoft.PowerShell.PSReadLine/Microsoft.PowerShell.PSReadLine.csproj index 9b7ee605cf0..3b41270e0a6 100644 --- a/src/Microsoft.PowerShell.PSReadLine/Microsoft.PowerShell.PSReadLine.csproj +++ b/src/Microsoft.PowerShell.PSReadLine/Microsoft.PowerShell.PSReadLine.csproj @@ -1,22 +1,10 @@  + + - 6.0.0 - netcoreapp2.0 - true - true - true + PowerShell Core's Microsoft.PowerShell.PSReadLine project Microsoft.PowerShell.PSReadLine - ../signing/visualstudiopublic.snk - true - false - false - false - false - false - false - false - false diff --git a/src/ResGen/ResGen.csproj b/src/ResGen/ResGen.csproj index 3f1fd8ba923..445cb5a6f2c 100644 --- a/src/ResGen/ResGen.csproj +++ b/src/ResGen/ResGen.csproj @@ -1,11 +1,13 @@  + + Generates C# typed bindings for .resx files - netcoreapp2.0 + false resgen Exe - ubuntu.16.10-x64;ubuntu.16.04-x64;ubuntu.14.04-x64;debian.8-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win81-x64;win10-x64;osx.10.11-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 + ubuntu.16.10-x64;ubuntu.16.04-x64;ubuntu.14.04-x64;debian.8-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win81-x64;win10-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 diff --git a/src/TypeCatalogGen/TypeCatalogGen.csproj b/src/TypeCatalogGen/TypeCatalogGen.csproj index adcb3b13b6f..6814878a9b4 100644 --- a/src/TypeCatalogGen/TypeCatalogGen.csproj +++ b/src/TypeCatalogGen/TypeCatalogGen.csproj @@ -1,11 +1,13 @@  + + Generates CorePsTypeCatalog.cs given powershell.inc - netcoreapp2.0 + false TypeCatalogGen Exe - ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;debian.8-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win81-x64;win10-x64;osx.10.11-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 + ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;debian.8-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win81-x64;win10-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 diff --git a/src/powershell-unix/powershell-unix.csproj b/src/powershell-unix/powershell-unix.csproj index fe7705c5d4c..f46f6039324 100644 --- a/src/powershell-unix/powershell-unix.csproj +++ b/src/powershell-unix/powershell-unix.csproj @@ -6,7 +6,7 @@ PowerShell top-level project with .NET CLI host powershell Exe - ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;debian.8-x64;centos.7-x64;fedora.24-x64;osx.10.11-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 + ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;debian.8-x64;centos.7-x64;fedora.24-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 diff --git a/test/PSReadLine/PSReadLine.tests.csproj b/test/PSReadLine/PSReadLine.tests.csproj index 65adc7b6763..329a964bdae 100644 --- a/test/PSReadLine/PSReadLine.tests.csproj +++ b/test/PSReadLine/PSReadLine.tests.csproj @@ -1,20 +1,12 @@  + + PSReadLine basic tests - netcoreapp2.0 - true TestPSReadLine Exe - ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win10-x64;osx.10.11-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 - false - false - false - false - false - false - false - false + ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win10-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 diff --git a/test/Test.Common.props b/test/Test.Common.props new file mode 100644 index 00000000000..4bbb82d5a7a --- /dev/null +++ b/test/Test.Common.props @@ -0,0 +1,11 @@ + + + PowerShell Core Test + Microsoft Corporation + (c) Microsoft Corporation. All rights reserved. + + netcoreapp2.0 + true + true + + diff --git a/test/csharp/csharp.tests.csproj b/test/csharp/csharp.tests.csproj index 902437e1746..23da9190ef8 100644 --- a/test/csharp/csharp.tests.csproj +++ b/test/csharp/csharp.tests.csproj @@ -1,13 +1,11 @@  + + PowerShell On Linux xUnit Tests - netcoreapp2.0 - true powershell-tests - ../../src/signing/visualstudiopublic.snk - true - ubuntu.14.04-x64;ubuntu.16.04-x64;debian.8-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win81-x64;win10-x64;osx.10.11-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 + ubuntu.14.04-x64;ubuntu.16.04-x64;debian.8-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win81-x64;win10-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 diff --git a/test/tools/TestExe/TestExe.csproj b/test/tools/TestExe/TestExe.csproj index 9e5851e1b11..cb50ea40592 100644 --- a/test/tools/TestExe/TestExe.csproj +++ b/test/tools/TestExe/TestExe.csproj @@ -1,11 +1,12 @@  + + Very simple little console class that you can use to for testing PowerShell interaction with native commands - netcoreapp2.0 testexe Exe - ubuntu.16.04-x64;ubuntu.14.04-x64;debian.8-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win81-x64;win10-x64;osx.10.11-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 + ubuntu.16.04-x64;ubuntu.14.04-x64;debian.8-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win81-x64;win10-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 From f6ade31cada2e9ddedb57d3bc18e7ef67cfcbdb8 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 29 Jun 2017 14:51:54 -0700 Subject: [PATCH 3/4] Update to use Framework 2.0.0-preview3-25426-01 --- PowerShell.Common.props | 6 ++--- ...soft.PowerShell.Commands.Management.csproj | 2 +- .../CoreCLR/WebRequestPSCmdlet.CoreClr.cs | 2 +- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 22 +++++++++---------- src/ResGen/ResGen.csproj | 4 +--- .../System.Management.Automation.csproj | 10 ++++----- src/TypeCatalogGen/TypeCatalogGen.csproj | 4 +--- test/Test.Common.props | 2 ++ .../NativeCommandProcessor.Tests.ps1 | 4 +--- .../WebCmdlets.Tests.ps1 | 8 ++----- test/tools/TestExe/TestExe.csproj | 3 +-- 12 files changed, 30 insertions(+), 39 deletions(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index de748e09cbd..bb55bac74cf 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -5,13 +5,13 @@ (c) Microsoft Corporation. All rights reserved. 6.0.0 - - en-US - netcoreapp2.0 + 2.0.0-preview3-25426-01 + true true true + en-US true ../signing/visualstudiopublic.snk 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 a9fb9090269..feb8b95fb4a 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -70,7 +70,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebRequestPSCmdlet.CoreClr.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebRequestPSCmdlet.CoreClr.cs index 30cc837933b..23d35548774 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebRequestPSCmdlet.CoreClr.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebRequestPSCmdlet.CoreClr.cs @@ -165,7 +165,7 @@ internal virtual HttpClient GetHttpClient(bool handleRedirect) if (SkipCertificateCheck) { - handler.ServerCertificateCustomValidationCallback = delegate { return true; }; + handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; } // This indicates GetResponse will handle redirects. 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 ea9f1eac824..a7913ecc4bc 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -25,7 +25,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 060120a5537..b40b14c4f29 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -17,17 +17,17 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/src/ResGen/ResGen.csproj b/src/ResGen/ResGen.csproj index 445cb5a6f2c..b06fd0d1817 100644 --- a/src/ResGen/ResGen.csproj +++ b/src/ResGen/ResGen.csproj @@ -1,10 +1,8 @@  - - Generates C# typed bindings for .resx files - false + netcoreapp2.0 resgen Exe ubuntu.16.10-x64;ubuntu.16.04-x64;ubuntu.14.04-x64;debian.8-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win81-x64;win10-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 2ff7cf2ff4e..a50e17332d0 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -11,12 +11,12 @@ - + - - - - + + + + diff --git a/src/TypeCatalogGen/TypeCatalogGen.csproj b/src/TypeCatalogGen/TypeCatalogGen.csproj index 6814878a9b4..7ab1404d639 100644 --- a/src/TypeCatalogGen/TypeCatalogGen.csproj +++ b/src/TypeCatalogGen/TypeCatalogGen.csproj @@ -1,10 +1,8 @@  - - Generates CorePsTypeCatalog.cs given powershell.inc - false + netcoreapp2.0 TypeCatalogGen Exe ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;debian.8-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win81-x64;win10-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 diff --git a/test/Test.Common.props b/test/Test.Common.props index 4bbb82d5a7a..0534a8ee24c 100644 --- a/test/Test.Common.props +++ b/test/Test.Common.props @@ -5,6 +5,8 @@ (c) Microsoft Corporation. All rights reserved. netcoreapp2.0 + 2.0.0-preview3-25426-01 + true true diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 index 08b3c8d887a..5fe1afab68b 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 @@ -24,9 +24,7 @@ Describe 'native commands with pipeline' -tags 'Feature' { $rs.ResetRunspaceState() } - # Make this test pending because of too many regressions in the latest .NET Core - # and thus we have to get back to an older .NET Core. - It "native | native | native should work fine" -Pending { + It "native | native | native should work fine" { if ($IsWindows) { $result = @(ping.exe | findstr.exe count | findstr.exe ping) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index 2774c9402e4..d694b76241a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -507,9 +507,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { $jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell" } - ## 'HttpClientHandler.ServerCertificateCustomValidationCallback' currently doesn't work in netcoreapp2.0 on Mac at all. - ## This is tracked by powershell issue #3648. - It "Validate Invoke-WebRequest -SkipCertificateCheck" -Pending:$IsOSX { + It "Validate Invoke-WebRequest -SkipCertificateCheck" { # validate that exception is thrown for URI with expired certificate $command = "Invoke-WebRequest -Uri 'https://expired.badssl.com'" @@ -954,9 +952,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { $jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell" } - ## 'HttpClientHandler.ServerCertificateCustomValidationCallback' currently doesn't work in netcoreapp2.0 on Mac at all. - ## This is tracked by powershell issue #3648. - It "Validate Invoke-RestMethod -SkipCertificateCheck" -Pending:$IsOSX { + It "Validate Invoke-RestMethod -SkipCertificateCheck" { # HTTP method HEAD must be used to not retrieve an unparsable HTTP body # validate that exception is thrown for URI with expired certificate diff --git a/test/tools/TestExe/TestExe.csproj b/test/tools/TestExe/TestExe.csproj index cb50ea40592..9cd9ac354fb 100644 --- a/test/tools/TestExe/TestExe.csproj +++ b/test/tools/TestExe/TestExe.csproj @@ -1,9 +1,8 @@  - - Very simple little console class that you can use to for testing PowerShell interaction with native commands + netcoreapp2.0 testexe Exe ubuntu.16.04-x64;ubuntu.14.04-x64;debian.8-x64;centos.7-x64;fedora.24-x64;win7-x86;win7-x64;win81-x64;win10-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64 From 7653c12bde4dd1f150bb58d05d1da8f9cae49d5c Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 29 Jun 2017 16:15:40 -0700 Subject: [PATCH 4/4] Make 2 test pending due to behavior change in .NET Core --- .../Get-ChildItem.Tests.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 index b9d6ccb1c9f..c634bf6a178 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 @@ -66,7 +66,9 @@ Describe "Get-ChildItem" -Tags "CI" { $file.Count | Should be 1 $file.Name | Should be $item_F } - It "Should continue enumerating a directory when a contained item is deleted" { + # Test is pending on Unix platforms because of a behavior change in the latest .NET Core. + # See https://github.com/dotnet/corefx/issues/20456 for more information. + It "Should continue enumerating a directory when a contained item is deleted" -Pending:(!$IsWindows) { $Error.Clear() [System.Management.Automation.Internal.InternalTestHooks]::SetTestHook("GciEnumerationActionDelete", $true) $result = Get-ChildItem -Path $TestDrive -ErrorAction SilentlyContinue @@ -84,7 +86,9 @@ Describe "Get-ChildItem" -Tags "CI" { $result.Count | Should BeExactly 4 } } - It "Should continue enumerating a directory when a contained item is renamed" { + # Test is pending on Unix platforms because of a behavior change in the latest .NET Core. + # See https://github.com/dotnet/corefx/issues/20456 for more information. + It "Should continue enumerating a directory when a contained item is renamed" -Pending:(!$IsWindows) { $Error.Clear() [System.Management.Automation.Internal.InternalTestHooks]::SetTestHook("GciEnumerationActionRename", $true) $result = Get-ChildItem -Path $TestDrive -ErrorAction SilentlyContinue