From ea5d5c3d0567c2d669da2451e8835adc6f395e15 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 18 Apr 2016 20:22:20 -0700 Subject: [PATCH] Switch to netcoreapp1.0 Instead of using `dotnet publish`, we can use `dotnet build` and the new `netcoreapp1.0` framework with a new dependency on `Microsoft.NETCore.App` to generate output that does not include the runtime, but can be run anywhere (given the installation of the runtime). While we cannot yet adopt a dependency on the shared host until .NET Core RTM, we are forced to switch to this system anyway because the latest RC3 packages and CLI do not support `netstandardapp1.5`. See dotnet/cli#2482. Thus we're in an in-between state where we have to use `netcoreapp1.0`, but cannot use `"Microsoft.NETCore.App": { "type": "platform" }` to utilize the shared host, as we need to continue to ship our host. Without specifying "platform", we retain the status quo with respect to build steps and outputs. Additionally, there is no longer a good reason to use the RC3 packages, and it has been advised we switch to RC2 since the `Microsoft.NETCore.App` is only available for RC2. We must update packages because our current version can no longer be debugged. --- PowerShellGitHubDev.psm1 | 8 ++- appveyor.yml | 2 +- docs/building/linux.md | 4 +- docs/building/osx.md | 2 +- docs/building/windows-core.md | 4 +- docs/building/windows-full.md | 4 +- .../project.json | 1 - .../project.json | 4 +- .../project.json | 4 +- .../project.json | 4 +- .../project.json | 6 +- .../project.json | 11 ++-- src/System.Management.Automation/project.json | 60 +++++++++---------- src/System.Security.SecureString/project.json | 2 +- src/TypeCatalogParser/Main.cs | 2 +- src/TypeCatalogParser/project.json | 2 +- test/csharp/project.json | 2 +- 17 files changed, 63 insertions(+), 59 deletions(-) diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index 1e76fb3f0..cd553dc69 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -190,7 +190,7 @@ function New-PSOptions { [ValidateSet("Linux", "Debug", "Release")] [string]$Configuration, - [ValidateSet("netstandardapp1.5", "net451")] + [ValidateSet("netcoreapp1.0", "net451")] [string]$Framework, # These are duplicated from Start-PSBuild @@ -229,7 +229,7 @@ function New-PSOptions { $Framework = if ($FullCLR) { "net451" } else { - "netstandardapp1.5" + "netcoreapp1.0" } log "Using framework '$Framework'" } @@ -321,9 +321,11 @@ function Start-PSxUnit { $Arguments = "--configuration", "Linux" try { Push-Location $PSScriptRoot/test/csharp + Start-NativeExecution { dotnet build $Arguments } - Copy-Item -ErrorAction SilentlyContinue -Recurse -Path $Content/* -Include Modules,libpsl-native* -Destination "./bin/Linux/netstandardapp1.5/ubuntu.14.04-x64" + Copy-Item -ErrorAction SilentlyContinue -Recurse -Path $Content/* -Include Modules,libpsl-native* -Destination "./bin/Linux/netcoreapp1.0/ubuntu.14.04-x64" Start-NativeExecution { dotnet test $Arguments } + if ($LASTEXITCODE -ne 0) { throw "$LASTEXITCODE xUnit tests failed" } diff --git a/appveyor.yml b/appveyor.yml index ab0366493..bd4fdbcf8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -33,7 +33,7 @@ test_script: $ErrorActionPreference = 'Stop' # # CoreCLR - $env:CoreOutput = "$pwd\src\Microsoft.PowerShell.CoreConsoleHost\bin\Debug\netstandardapp1.5\win81-x64\publish" + $env:CoreOutput = "$pwd\src\Microsoft.PowerShell.CoreConsoleHost\bin\Debug\netcoreapp1.0\win81-x64\publish" Write-Host -Foreground Green 'Run CoreCLR tests' $testResultsFile = "$pwd\TestsResults.xml" & ("$env:CoreOutput\powershell.exe") -c "Invoke-Pester test/powershell -OutputFormat NUnitXml -OutputFile $testResultsFile" diff --git a/docs/building/linux.md b/docs/building/linux.md index aec949b8b..4ecc1678b 100644 --- a/docs/building/linux.md +++ b/docs/building/linux.md @@ -114,7 +114,7 @@ Start-PSBuild Congratulations! If everything went right, PowerShell is now built. The `Start-PSBuild` script will output the location of the executable: -`./src/Microsoft.PowerShell.CoreConsoleHost/bin/Linux/netstandardapp1.5/ubuntu.14.04-x64/powershell`. +`./src/Microsoft.PowerShell.CoreConsoleHost/bin/Linux/netcoreapp1.0/ubuntu.14.04-x64/powershell`. You can run our cross-platform Pester tests with `Start-PSPester`, and our xUnit tests with `Start-PSxUnit`. @@ -160,7 +160,7 @@ dotnet build --configuration Linux The executable will be in `./bin/[configuration]/[framework]/[rid]/[binary name]`, where our -configuration is `Linux`, framework is `netstandardapp1.5`, runtime +configuration is `Linux`, framework is `netcoreapp1.0`, runtime identifier is `ubuntu.14.04-x64`, and binary name is `powershell`. The function `Get-PSOutput` will return the path to the executable; thus you can execute the development copy via `& (Get-PSOutput)`. diff --git a/docs/building/osx.md b/docs/building/osx.md index d1c151ee2..9f108b04b 100644 --- a/docs/building/osx.md +++ b/docs/building/osx.md @@ -49,7 +49,7 @@ module. The output directory will be slightly different because your runtime identifier is different. PowerShell will be at -`./src/Microsoft.PowerShell.CoreConsoleHost/bin/Linux/netstandardapp1.5/osx.10.11-x64/powershell`, +`./src/Microsoft.PowerShell.CoreConsoleHost/bin/Linux/netcoreapp1.0/osx.10.11-x64/powershell`, or `osx.10.10` depending on your operating system version. Note that configration is still `Linux` because it would be silly to make yet another separate configuration when it's used soley to work-around a diff --git a/docs/building/windows-core.md b/docs/building/windows-core.md index 8a609acf7..41502f5a9 100644 --- a/docs/building/windows-core.md +++ b/docs/building/windows-core.md @@ -71,12 +71,12 @@ Start-PSBuild ``` Congratulations! If everything went right, PowerShell is now built and -executable as `./src/Microsoft.PowerShell.CoreConsoleHost/bin/Debug/netstandardapp1.5/win10-x64/powershell`. +executable as `./src/Microsoft.PowerShell.CoreConsoleHost/bin/Debug/netcoreapp1.0/win10-x64/powershell`. This location is of the form `./[project]/bin/[configuration]/[framework]/[rid]/[binary name]`, and our project is `Microsoft.PowerShell.CoreConsoleHost`, configuration is `Debug` -by default, framework is `netstandardapp1.5`, runtime identifier is +by default, framework is `netcoreapp1.0`, runtime identifier is **probably** `win10-x64` (but will depend on your operating system; don't worry, `dotnet --info` will tell you what it was), and binary name is `powershell`. The function `Get-PSOutput` will return the path diff --git a/docs/building/windows-full.md b/docs/building/windows-full.md index 806dc1594..00bc13094 100644 --- a/docs/building/windows-full.md +++ b/docs/building/windows-full.md @@ -51,11 +51,11 @@ module. Because the `ConsoleHost` project (*not* the `Host` project) is a library and not an application (in the sense that .NET CLI does not emit a native executable using .NET Core's `corehost`), it targets the -framework `netstandard1.5`, *not* `netstandardapp1.5`, and the build +framework `netstandard1.5`, *not* `netcoreapp1.0`, and the build output will *not* have a runtime identifier in the path. Thus the output location of `powershell.exe` will be -`./src/Microsoft.PowerShell.ConsoleHost/bin/Debug/netstandardapp1.5/powershell.exe` +`./src/Microsoft.PowerShell.ConsoleHost/bin/Debug/netcoreapp1.0/powershell.exe` While building is easy, running FullCLR version is not as simple as CoreCLR version. diff --git a/src/Microsoft.Management.Infrastructure.Native/project.json b/src/Microsoft.Management.Infrastructure.Native/project.json index ef7ce6fe8..390213c6f 100644 --- a/src/Microsoft.Management.Infrastructure.Native/project.json +++ b/src/Microsoft.Management.Infrastructure.Native/project.json @@ -11,7 +11,6 @@ "warningsAsErrors": true }, "dependencies": { - "NETStandard.Library": "1.5.0-rc3-24011-00", "System.Security.SecureString": "1.0.0-*" } }, diff --git a/src/Microsoft.Management.Infrastructure/project.json b/src/Microsoft.Management.Infrastructure/project.json index c0aae85a9..bc8605a8c 100644 --- a/src/Microsoft.Management.Infrastructure/project.json +++ b/src/Microsoft.Management.Infrastructure/project.json @@ -19,8 +19,8 @@ "define": [ "_CORECLR" ] }, "dependencies": { - "System.Runtime.Serialization.Xml": "4.1.1-rc3-24011-00", - "System.Threading.ThreadPool": "4.0.10-rc3-24011-00" + "System.Runtime.Serialization.Xml": "4.1.1-rc2-24022", + "System.Threading.ThreadPool": "4.0.10-rc2-24022" } }, "net451": { diff --git a/src/Microsoft.PowerShell.Commands.Management/project.json b/src/Microsoft.PowerShell.Commands.Management/project.json index 55d5a80b1..c09f6e377 100644 --- a/src/Microsoft.PowerShell.Commands.Management/project.json +++ b/src/Microsoft.PowerShell.Commands.Management/project.json @@ -19,8 +19,8 @@ "define": [ "CORECLR" ] }, "dependencies": { - "System.ServiceProcess.ServiceController": "4.1.0-rc3-24011-00", - "System.Net.NameResolution": "4.0.0-rc3-24011-00" + "System.ServiceProcess.ServiceController": "4.1.0-rc2-24022", + "System.Net.NameResolution": "4.0.0-rc2-24022" } }, "net451": { diff --git a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json index 7a3a53f93..9a0fb78f8 100644 --- a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json +++ b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json @@ -22,8 +22,8 @@ "define": [ "CORECLR" ] }, "dependencies": { - "NETStandard.Library": "1.5.0-rc3-24011-00", - "System.Runtime.Loader": "4.0.0-rc3-24011-00" + "NETStandard.Library": "1.5.0-rc2-24022", + "System.Runtime.Loader": "4.0.0-rc2-24022" } } } diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json b/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json index 30aec82bd..48a537408 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json @@ -23,9 +23,9 @@ "define": [ "CORECLR" ] }, "dependencies": { - "System.Security.Principal": "4.0.1-rc3-24011-00", - "System.Security.Principal.Windows": "4.0.0-rc3-24011-00", - "System.Diagnostics.TraceSource": "4.0.0-rc3-24011-00", + "System.Security.Principal": "4.0.1-rc2-24022", + "System.Security.Principal.Windows": "4.0.0-rc2-24022", + "System.Diagnostics.TraceSource": "4.0.0-rc2-24022", "System.Security.SecureString": "1.0.0-*" } } diff --git a/src/Microsoft.PowerShell.CoreConsoleHost/project.json b/src/Microsoft.PowerShell.CoreConsoleHost/project.json index 38d8a483a..62fc7a6c4 100644 --- a/src/Microsoft.PowerShell.CoreConsoleHost/project.json +++ b/src/Microsoft.PowerShell.CoreConsoleHost/project.json @@ -11,8 +11,8 @@ "dependencies": { "Newtonsoft.Json": "8.0.2", - "System.Xml.XDocument": "4.0.11-rc3-24011-00", - "System.IO.MemoryMappedFiles": "4.0.0-rc3-24011-00", + "System.Xml.XDocument": "4.0.11-rc2-24022", + "System.IO.MemoryMappedFiles": "4.0.0-rc2-24022", "Microsoft.PowerShell.Commands.Management": "1.0.0-*", "Microsoft.PowerShell.Commands.Utility": "1.0.0-*" }, @@ -26,8 +26,11 @@ ], "frameworks": { - "netstandardapp1.5": { - "imports": [ "dnxcore50", "portable-net45+win8" ] + "netcoreapp1.0": { + "imports": [ "dnxcore50", "portable-net45+win8" ], + "dependencies": { + "Microsoft.NETCore.App": "1.0.0-rc2-3002485" + } } }, diff --git a/src/System.Management.Automation/project.json b/src/System.Management.Automation/project.json index e58a4f1f0..8e8a684e2 100644 --- a/src/System.Management.Automation/project.json +++ b/src/System.Management.Automation/project.json @@ -30,36 +30,36 @@ "Microsoft.PowerShell.CoreCLR.AssemblyLoadContext": "1.0.0-*", "Microsoft.PowerShell.CoreCLR.Eventing": "1.0.0-*", - "Microsoft.CSharp": "4.0.1-rc3-24011-00", - "Microsoft.Win32.Registry.AccessControl": "4.0.0-rc3-24011-00", - "System.Collections.Specialized": "4.0.1-rc3-24011-00", - "System.Collections.NonGeneric": "4.0.1-rc3-24011-00", - "System.ComponentModel.EventBasedAsync": "4.0.11-rc3-24011-00", - "System.ComponentModel.TypeConverter": "4.0.1-rc3-24011-00", - "System.Data.Common": "4.0.1-rc3-24011-00", - "System.Diagnostics.Contracts": "4.0.1-rc3-24011-00", - "System.Diagnostics.FileVersionInfo": "4.0.0-rc3-24011-00", - "System.Diagnostics.Process": "4.1.0-rc3-24011-00", - "System.Diagnostics.StackTrace": "4.0.1-rc3-24011-00", - "System.Diagnostics.TraceSource": "4.0.0-rc3-24011-00", - "System.Dynamic.Runtime": "4.0.11-rc3-24011-00", - "System.IO.FileSystem.AccessControl": "4.0.0-rc3-24011-00", - "System.IO.FileSystem.DriveInfo": "4.0.0-rc3-24011-00", - "System.IO.FileSystem.Watcher": "4.0.0-rc3-24011-00", - "System.IO.Pipes": "4.0.0-rc3-24011-00", - "System.Linq.Expressions": "4.0.11-rc3-24011-00", - "System.Net.Http": "4.0.1-rc3-24011-00", - "System.Net.NetworkInformation": "4.1.0-rc3-24011-00", - "System.Reflection.Emit": "4.0.1-rc3-24011-00", - "System.Reflection.Emit.Lightweight": "4.0.1-rc3-24011-00", - "System.Security.AccessControl": "4.0.0-rc3-24011-00", - "System.Security.Cryptography.Algorithms": "4.1.0-rc3-24011-00", - "System.Security.Cryptography.X509Certificates": "4.1.0-rc3-24011-00", - "System.Threading.Thread": "4.0.0-rc3-24011-00", - "System.Threading.Tasks.Parallel": "4.0.1-rc3-24011-00", - "System.Xml.XPath.XmlDocument": "4.0.1-rc3-24011-00", - "System.Xml.XmlDocument": "4.0.1-rc3-24011-00", - "System.Xml.XmlSerializer": "4.0.11-rc3-24011-00" + "Microsoft.CSharp": "4.0.1-rc2-24022", + "Microsoft.Win32.Registry.AccessControl": "4.0.0-rc2-24022", + "System.Collections.Specialized": "4.0.1-rc2-24022", + "System.Collections.NonGeneric": "4.0.1-rc2-24022", + "System.ComponentModel.EventBasedAsync": "4.0.11-rc2-24022", + "System.ComponentModel.TypeConverter": "4.0.1-rc2-24022", + "System.Data.Common": "4.0.1-rc2-24022", + "System.Diagnostics.Contracts": "4.0.1-rc2-24022", + "System.Diagnostics.FileVersionInfo": "4.0.0-rc2-24022", + "System.Diagnostics.Process": "4.1.0-rc2-24022", + "System.Diagnostics.StackTrace": "4.0.1-rc2-24022", + "System.Diagnostics.TraceSource": "4.0.0-rc2-24022", + "System.Dynamic.Runtime": "4.0.11-rc2-24022", + "System.IO.FileSystem.AccessControl": "4.0.0-rc2-24022", + "System.IO.FileSystem.DriveInfo": "4.0.0-rc2-24022", + "System.IO.FileSystem.Watcher": "4.0.0-rc2-24022", + "System.IO.Pipes": "4.0.0-rc2-24022", + "System.Linq.Expressions": "4.0.11-rc2-24022", + "System.Net.Http": "4.0.1-rc2-24022", + "System.Net.NetworkInformation": "4.1.0-rc2-24022", + "System.Reflection.Emit": "4.0.1-rc2-24022", + "System.Reflection.Emit.Lightweight": "4.0.1-rc2-24022", + "System.Security.AccessControl": "4.0.0-rc2-24022", + "System.Security.Cryptography.Algorithms": "4.1.0-rc2-24022", + "System.Security.Cryptography.X509Certificates": "4.1.0-rc2-24022", + "System.Threading.Thread": "4.0.0-rc2-24022", + "System.Threading.Tasks.Parallel": "4.0.1-rc2-24022", + "System.Xml.XPath.XmlDocument": "4.0.1-rc2-24022", + "System.Xml.XmlDocument": "4.0.1-rc2-24022", + "System.Xml.XmlSerializer": "4.0.11-rc2-24022" } }, "net451": { diff --git a/src/System.Security.SecureString/project.json b/src/System.Security.SecureString/project.json index 5f8be8985..7161f5ed0 100644 --- a/src/System.Security.SecureString/project.json +++ b/src/System.Security.SecureString/project.json @@ -12,7 +12,7 @@ "frameworks": { "netstandard1.5": { "dependencies": { - "NETStandard.Library": "1.5.0-rc3-24011-00" + "NETStandard.Library": "1.5.0-rc2-24022" }, "imports": [ "dnxcore50" ] } diff --git a/src/TypeCatalogParser/Main.cs b/src/TypeCatalogParser/Main.cs index 9b38ac2b8..c4321e3eb 100644 --- a/src/TypeCatalogParser/Main.cs +++ b/src/TypeCatalogParser/Main.cs @@ -17,7 +17,7 @@ namespace ConsoleApplication var outputPath = "../TypeCatalogGen/powershell.inc"; // Get a context for our top level project - var context = ProjectContext.Create("../Microsoft.PowerShell.CoreConsoleHost", NuGetFramework.Parse("netstandardapp1.5")); + var context = ProjectContext.Create("../Microsoft.PowerShell.CoreConsoleHost", NuGetFramework.Parse("netcoreapp1.0")); System.IO.File.WriteAllLines(outputPath, // Get the target for the current runtime diff --git a/src/TypeCatalogParser/project.json b/src/TypeCatalogParser/project.json index 62ac3aa7f..bedefcc42 100644 --- a/src/TypeCatalogParser/project.json +++ b/src/TypeCatalogParser/project.json @@ -10,7 +10,7 @@ }, "frameworks": { - "netstandardapp1.5": { + "netcoreapp1.0": { "imports": [ "dnxcore50", "portable-net45+win8" ] } }, diff --git a/test/csharp/project.json b/test/csharp/project.json index 708f48a54..6d83c1c75 100644 --- a/test/csharp/project.json +++ b/test/csharp/project.json @@ -9,7 +9,7 @@ }, "frameworks": { - "netstandardapp1.5": { + "netcoreapp1.0": { "imports": [ "dnxcore50", "portable-net45+win8" ], "dependencies": { "xunit": "2.1.0",