From 94e3a905bdf3e447a8f714012cb6307d8f4e0993 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 18 Mar 2016 12:22:00 -0700 Subject: [PATCH 1/5] Add VS Code launch and task files This enables building PowerShell through VS Code. The build task launches the installed version of PowerShell and runs `Start-PSBuild` (after importing the module). This enables a `launch` debug task to immediately debug the `powershell` process, without having to attach to an external process. The defaults of `justMyCode` and `stopAtEntry` have been reversed, so that all code is debugged, and the process is stopped at entry for easier debugging. Note that an interactive PowerShell process requires access to `stdin`, which the debug console does not provide, so once it requests access, `System.Console` will throw a (correct) exception. --- .vscode/launch.json | 16 ++++++++++++++++ .vscode/tasks.json | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000..cb340619b2 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "powershell", + "type": "coreclr", + "request": "launch", + "justMyCode": false, + "stopAtEntry": true, + "program": "${workspaceRoot}/bin/powershell", + "args": [ ], + "preLaunchTask": "build", + "cwd": "${workspaceRoot}" + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000000..b204ecfc90 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,16 @@ +{ + "version": "0.1.0", + "command": "powershell", + "isShellCommand": true, + "showOutput": "verbose", + "args": [ "--command" ], + + "tasks": [ + { + "taskName": "build", + "args": [ "Import-Module ${workspaceRoot}/PowerShellGitHubDev.psm1; Start-PSBuild" ], + "isBuildCommand": true, + "problemMatcher": "$msCompile" + } + ] +} From c7124578ed23cc6befabcf4c8a2d29f8922d6240 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 25 Mar 2016 13:03:07 -0700 Subject: [PATCH 2/5] Bump packages back to rc3 The primary reason to do this is that the VS Code debugger is not compatible with rc2. Secondarily, we want to continue tracking CoreCLR/FX master branch, which means to continue with the latest release candidates. Since we are releasing in August, we will be able to pick up the converged RTM version before release. The only advantage of rc2 is that it is frozen; but we have this anyway because we snap to particular builds. --- .../project.json | 2 +- .../project.json | 4 +- .../project.json | 4 +- .../project.json | 4 +- .../project.json | 6 +- .../project.json | 2 +- src/System.Management.Automation/project.json | 60 +++++++++---------- src/System.Security.SecureString/project.json | 2 +- 8 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/Microsoft.Management.Infrastructure.Native/project.json b/src/Microsoft.Management.Infrastructure.Native/project.json index 316ae3d639..b786f027a7 100644 --- a/src/Microsoft.Management.Infrastructure.Native/project.json +++ b/src/Microsoft.Management.Infrastructure.Native/project.json @@ -11,7 +11,7 @@ "warningsAsErrors": true }, "dependencies": { - "NETStandard.Library": "1.5.0-rc2-23922", + "NETStandard.Library": "1.5.0-rc3-23922", "System.Security.SecureString": "1.0.0-*" } }, diff --git a/src/Microsoft.Management.Infrastructure/project.json b/src/Microsoft.Management.Infrastructure/project.json index 88c99f9c34..878b6e3926 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-rc2-23922", - "System.Threading.ThreadPool": "4.0.10-rc2-23922" + "System.Runtime.Serialization.Xml": "4.1.1-rc3-23922", + "System.Threading.ThreadPool": "4.0.10-rc3-23922" } }, "net451": { diff --git a/src/Microsoft.PowerShell.Commands.Management/project.json b/src/Microsoft.PowerShell.Commands.Management/project.json index ecb77274e8..6dded2746c 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-rc2-23922", - "System.Net.NameResolution": "4.0.0-rc2-23922" + "System.ServiceProcess.ServiceController": "4.1.0-rc3-23922", + "System.Net.NameResolution": "4.0.0-rc3-23922" } }, "net451": { diff --git a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json index 239bac4265..1a0418d383 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-rc2-23922", - "System.Runtime.Loader": "4.0.0-rc2-23922" + "NETStandard.Library": "1.5.0-rc3-23922", + "System.Runtime.Loader": "4.0.0-rc3-23922" } } }, diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json b/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json index cea9c53a7b..c852f2611a 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-rc2-23922", - "System.Security.Principal.Windows": "4.0.0-rc2-23922", - "System.Diagnostics.TraceSource": "4.0.0-rc2-23922", + "System.Security.Principal": "4.0.1-rc3-23922", + "System.Security.Principal.Windows": "4.0.0-rc3-23922", + "System.Diagnostics.TraceSource": "4.0.0-rc3-23922", "System.Security.SecureString": "1.0.0-*" } } diff --git a/src/Microsoft.PowerShell.Linux.Host/project.json b/src/Microsoft.PowerShell.Linux.Host/project.json index 353b52c9eb..2b1c498641 100644 --- a/src/Microsoft.PowerShell.Linux.Host/project.json +++ b/src/Microsoft.PowerShell.Linux.Host/project.json @@ -11,7 +11,7 @@ "dependencies": { "Newtonsoft.Json": "8.0.2", - "System.Xml.XDocument": "4.0.11-rc2-23922", + "System.Xml.XDocument": "4.0.11-rc3-23922", "Microsoft.PowerShell.Commands.Management": "1.0.0-*", "Microsoft.PowerShell.Commands.Utility": "1.0.0-*" }, diff --git a/src/System.Management.Automation/project.json b/src/System.Management.Automation/project.json index 8569d4a6e4..adc6fb72e9 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-rc2-23922", - "Microsoft.Win32.Registry.AccessControl": "4.0.0-rc2-23922", - "System.Collections.Specialized": "4.0.1-rc2-23922", - "System.Collections.NonGeneric": "4.0.1-rc2-23922", - "System.ComponentModel.EventBasedAsync": "4.0.11-rc2-23922", - "System.ComponentModel.TypeConverter": "4.0.1-rc2-23922", - "System.Data.Common": "4.0.1-rc2-23922", - "System.Diagnostics.Contracts": "4.0.1-rc2-23922", - "System.Diagnostics.FileVersionInfo": "4.0.0-rc2-23922", - "System.Diagnostics.Process": "4.1.0-rc2-23922", - "System.Diagnostics.StackTrace": "4.0.1-rc2-23922", - "System.Diagnostics.TraceSource": "4.0.0-rc2-23922", - "System.Dynamic.Runtime": "4.0.11-rc2-23922", - "System.IO.FileSystem.AccessControl": "4.0.0-rc2-23922", - "System.IO.FileSystem.DriveInfo": "4.0.0-rc2-23922", - "System.IO.FileSystem.Watcher": "4.0.0-rc2-23922", - "System.IO.Pipes": "4.0.0-rc2-23922", - "System.Linq.Expressions": "4.0.11-rc2-23922", - "System.Net.Http": "4.0.1-rc2-23922", - "System.Net.NetworkInformation": "4.1.0-rc2-23922", - "System.Reflection.Emit": "4.0.1-rc2-23922", - "System.Reflection.Emit.Lightweight": "4.0.1-rc2-23922", - "System.Security.AccessControl": "4.0.0-rc2-23922", - "System.Security.Cryptography.Algorithms": "4.1.0-rc2-23922", - "System.Security.Cryptography.X509Certificates": "4.1.0-rc2-23922", - "System.Threading.Thread": "4.0.0-rc2-23922", - "System.Threading.Tasks.Parallel": "4.0.1-rc2-23922", - "System.Xml.XPath.XmlDocument": "4.0.1-rc2-23922", - "System.Xml.XmlDocument": "4.0.1-rc2-23922", - "System.Xml.XmlSerializer": "4.0.11-rc2-23922" + "Microsoft.CSharp": "4.0.1-rc3-23922", + "Microsoft.Win32.Registry.AccessControl": "4.0.0-rc3-23922", + "System.Collections.Specialized": "4.0.1-rc3-23922", + "System.Collections.NonGeneric": "4.0.1-rc3-23922", + "System.ComponentModel.EventBasedAsync": "4.0.11-rc3-23922", + "System.ComponentModel.TypeConverter": "4.0.1-rc3-23922", + "System.Data.Common": "4.0.1-rc3-23922", + "System.Diagnostics.Contracts": "4.0.1-rc3-23922", + "System.Diagnostics.FileVersionInfo": "4.0.0-rc3-23922", + "System.Diagnostics.Process": "4.1.0-rc3-23922", + "System.Diagnostics.StackTrace": "4.0.1-rc3-23922", + "System.Diagnostics.TraceSource": "4.0.0-rc3-23922", + "System.Dynamic.Runtime": "4.0.11-rc3-23922", + "System.IO.FileSystem.AccessControl": "4.0.0-rc3-23922", + "System.IO.FileSystem.DriveInfo": "4.0.0-rc3-23922", + "System.IO.FileSystem.Watcher": "4.0.0-rc3-23922", + "System.IO.Pipes": "4.0.0-rc3-23922", + "System.Linq.Expressions": "4.0.11-rc3-23922", + "System.Net.Http": "4.0.1-rc3-23922", + "System.Net.NetworkInformation": "4.1.0-rc3-23922", + "System.Reflection.Emit": "4.0.1-rc3-23922", + "System.Reflection.Emit.Lightweight": "4.0.1-rc3-23922", + "System.Security.AccessControl": "4.0.0-rc3-23922", + "System.Security.Cryptography.Algorithms": "4.1.0-rc3-23922", + "System.Security.Cryptography.X509Certificates": "4.1.0-rc3-23922", + "System.Threading.Thread": "4.0.0-rc3-23922", + "System.Threading.Tasks.Parallel": "4.0.1-rc3-23922", + "System.Xml.XPath.XmlDocument": "4.0.1-rc3-23922", + "System.Xml.XmlDocument": "4.0.1-rc3-23922", + "System.Xml.XmlSerializer": "4.0.11-rc3-23922" } }, "net451": { diff --git a/src/System.Security.SecureString/project.json b/src/System.Security.SecureString/project.json index b8ed6e8144..2e90bd3043 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-rc2-23922" + "NETStandard.Library": "1.5.0-rc3-23922" }, "imports": [ "dnxcore50" ] } From 840d14e6df838bc410ee7893e156ca3c965a9196 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 25 Mar 2016 14:16:38 -0700 Subject: [PATCH 3/5] Add attach configuration --- .vscode/launch.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index cb340619b2..850d235c3c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,7 +2,7 @@ "version": "0.2.0", "configurations": [ { - "name": "powershell", + "name": ".NET Core Launch", "type": "coreclr", "request": "launch", "justMyCode": false, @@ -11,6 +11,13 @@ "args": [ ], "preLaunchTask": "build", "cwd": "${workspaceRoot}" + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "justMyCode": false, + "program": "powershell" } ] } From 47fd1a45bc40095bf2c31d7c1bbdacac504d65bc Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 25 Mar 2016 14:23:06 -0700 Subject: [PATCH 4/5] Remove runtimes sections from projects No longer necessary to restore/build. Removing them allows NuGet to restore only the packages necessary for the current platform, vastly reducing cache sizes and restore time. My `~/.nuget/packages` directory was almost 1GB smaller with this change. --- src/Microsoft.PowerShell.Linux.Host/project.json | 9 --------- src/TypeCatalogParser/project.json | 9 --------- 2 files changed, 18 deletions(-) diff --git a/src/Microsoft.PowerShell.Linux.Host/project.json b/src/Microsoft.PowerShell.Linux.Host/project.json index 2b1c498641..be3adce597 100644 --- a/src/Microsoft.PowerShell.Linux.Host/project.json +++ b/src/Microsoft.PowerShell.Linux.Host/project.json @@ -25,14 +25,5 @@ "netstandardapp1.5": { "imports": [ "dnxcore50", "portable-net45+win8" ] } - }, - - "runtimes": { - "ubuntu.14.04-x64": { }, - "centos.7.1-x64": { }, - "win7-x64": { }, - "win10-x64": { }, - "osx.10.10-x64": { }, - "osx.10.11-x64": { } } } diff --git a/src/TypeCatalogParser/project.json b/src/TypeCatalogParser/project.json index ed52514f47..f3e2050da0 100644 --- a/src/TypeCatalogParser/project.json +++ b/src/TypeCatalogParser/project.json @@ -13,14 +13,5 @@ "netstandardapp1.5": { "imports": [ "dnxcore50", "portable-net45+win8" ] } - }, - - "runtimes": { - "ubuntu.14.04-x64": { }, - "centos.7.1-x64": { }, - "win7-x64": { }, - "win10-x64": { }, - "osx.10.10-x64": { }, - "osx.10.11-x64": { } } } From f9e7e6c89cbb126a798a7c731a1108dd7c6ae5c1 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 25 Mar 2016 14:58:09 -0700 Subject: [PATCH 5/5] Handle `Start-PSBuild -Restore -Runtime ...` If a runtime is given, we need to restore for that particular runtime as well. This also enables `Warning` `dotnet restore` output, and increases the verbosity to `Info` if `-Verbose` is used. --- PowerShellGitHubDev.psm1 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index 1d7e2dc989..555f14e007 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -119,16 +119,16 @@ function Start-PSBuild # handle Restore if ($Restore -Or -Not (Test-Path "$Top/project.lock.json")) { log "Run dotnet restore" - # restore is genuinely verbose. - # we don't show it by default to keep CI build log size small - if ($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent) - { - dotnet restore $PSScriptRoot - } - else - { - dotnet restore $PSScriptRoot > $null - } + + $Arguments = @("--verbosity") + if ($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent) { + $Arguments += "Info" } else { $Arguments += "Warning" } + + if ($Runtime) { $Arguments += "--runtime", $Runtime } + + $Arguments += "$PSScriptRoot" + + dotnet restore $Arguments } # Build native components