From eb92b289651df579a6df272d18d8f9dbde8f2323 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 6 May 2016 10:28:45 -0700 Subject: [PATCH 1/6] Add Start-PSBuild -Output switch When specified, it will join the given path relative to the PowerShell repository. This is useful to choose where the built artifacts will end-up, which is necessary to fix VS Code tasks. --- PowerShellGitHubDev.psm1 | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index 3dde4e7468..db6a39f783 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -25,6 +25,7 @@ function Start-PSBuild { param( [switch]$NoPath, [switch]$Restore, + [string]$Output, [Parameter(ParameterSetName='CoreCLR')] [switch]$Publish, @@ -105,7 +106,7 @@ function Start-PSBuild { } # set output options - $OptionsArguments = @{Publish=$Publish; FullCLR=$FullCLR; Runtime=$Runtime} + $OptionsArguments = @{Publish=$Publish; Output=$Output; FullCLR=$FullCLR; Runtime=$Runtime} $script:Options = New-PSOptions @OptionsArguments # setup arguments @@ -115,6 +116,9 @@ function Start-PSBuild { } else { $Arguments += "build" } + if ($Output) { + $Arguments += "--output", (Join-Path $PSScriptRoot $Output) + } $Arguments += "--configuration", $Options.Configuration $Arguments += "--framework", $Options.Framework $Arguments += "--runtime", $Options.Runtime @@ -212,6 +216,7 @@ function New-PSOptions { [string]$Runtime, [switch]$Publish, + [string]$Output, [switch]$FullCLR ) @@ -261,21 +266,25 @@ function New-PSOptions { "powershell.exe" } - # Build the Output path in script scope - $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework) + # Build the Output path + if ($Output) { + $Output = Join-Path $PSScriptRoot $Output + } else { + $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework) - # FullCLR only builds a library, so there is no runtime component - if (-not $FullCLR) { - $Output = [IO.Path]::Combine($Output, $Runtime) + # FullCLR only builds a library, so there is no runtime component + if (-not $FullCLR) { + $Output = [IO.Path]::Combine($Output, $Runtime) + } + + # Publish injects the publish directory + if ($Publish) { + $Output = [IO.Path]::Combine($Output, "publish") + } + + $Output = [IO.Path]::Combine($Output, $Executable) } - # Publish injects the publish directory - if ($Publish) { - $Output = [IO.Path]::Combine($Output, "publish") - } - - $Output = [IO.Path]::Combine($Output, $Executable) - return @{ Top = $Top; Configuration = $Configuration; Framework = $Framework; From 403ba4f735fd8006d192ef7e53e07623a9bcd4f8 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 6 May 2016 10:30:48 -0700 Subject: [PATCH 2/6] Use -Output switch to fix VS Code debugging story --- .vscode/launch.json | 2 +- .vscode/tasks.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 59b831f29c..e40f0062f7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,7 +7,7 @@ "request": "launch", "justMyCode": false, "stopAtEntry": true, - "program": "${workspaceRoot}/bin/powershell", + "program": "${workspaceRoot}/debug/powershell", "args": [ ], "preLaunchTask": "build", "cwd": "${workspaceRoot}" diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 9864ad2b47..3c853f8aa9 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -8,7 +8,7 @@ "tasks": [ { "taskName": "build", - "args": [ "Import-Module ${workspaceRoot}/PowerShellGitHubDev.psm1; Start-PSBuild" ], + "args": [ "Import-Module ${workspaceRoot}/PowerShellGitHubDev.psm1; Start-PSBuild -Output debug" ], "isBuildCommand": true, "problemMatcher": "$msCompile" } From 77ffc715dc3033270dbe76b315dc360a5bd5c4a5 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 6 May 2016 10:48:01 -0700 Subject: [PATCH 3/6] Make VS Code debug powershell with -NonInteractive --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index e40f0062f7..afd0d5d0b4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,7 @@ "justMyCode": false, "stopAtEntry": true, "program": "${workspaceRoot}/debug/powershell", - "args": [ ], + "args": [ "-NonInteractive" ], "preLaunchTask": "build", "cwd": "${workspaceRoot}" }, From 502cd381ea3e69e6df49aa29200e5ca69d68f26d Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 6 May 2016 10:55:17 -0700 Subject: [PATCH 4/6] Note the pre-release VS Code requirements --- docs/debugging/README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/debugging/README.md b/docs/debugging/README.md index 2994048d17..319c423d68 100644 --- a/docs/debugging/README.md +++ b/docs/debugging/README.md @@ -2,7 +2,7 @@ Debugging ========= VS Code -------- +======= [Experimental .NET Core Debugging in VS Code][core-debug] enables cross-platform debugging with the [Visual Studio Code][vscode] editor. @@ -38,19 +38,32 @@ process named `powershell`, and will attach to it. If you need more fine grained control, replace `processName` with `processId` and provide a PID. (Please be careful not to commit such a change). +Important Note +-------------- + +Debugging is very sensitive to the versions of our .NET Core packages, VS Code, +and the C# extension. + +- Use the VS Code [Insiders][] build +- Use the latest pre-release of the [C# extension][] +- Refer to the pre-release [documentation][] + [core-debug]: https://blogs.msdn.microsoft.com/visualstudioalm/2016/03/10/experimental-net-core-debugging-in-vs-code/ [vscode]: https://code.visualstudio.com/ [OmniSharp]: https://github.com/OmniSharp/omnisharp-vscode [vscclrdebugger]: http://aka.ms/vscclrdebugger +[insiders]: https://code.visualstudio.com/insiders +[C# extension]: https://github.com/OmniSharp/omnisharp-vscode/releases +[documentation]: https://github.com/OmniSharp/omnisharp-vscode/pull/157 corehost --------- +======== The native executable prouduced by .NET CLI will produce trace output if launched with `COREHOST_TRACE=1 ./powershell`. CoreCLR PAL ------------ +=========== The native code in the CLR has debug channels to selectively output information to the console. These are controlled by the From 1411ce2a46ab7d72f5a5276c4c8cc9643713d08b Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 6 May 2016 10:59:53 -0700 Subject: [PATCH 5/6] Ignore the debug folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c8259cf33f..9cdda77f55 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ bin/ obj/ +debug/ project.lock.json *-tests.xml From 63ab9fe681bbc10fa82b816044ee794976bff35d Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 6 May 2016 11:49:02 -0700 Subject: [PATCH 6/6] Bump MMIN package to rc4 With the correct NETStandard.Library dependency. --- src/Microsoft.Management.Infrastructure/project.json | 2 +- src/windows-build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.Management.Infrastructure/project.json b/src/Microsoft.Management.Infrastructure/project.json index c30907ee6e..e6ff6d089b 100644 --- a/src/Microsoft.Management.Infrastructure/project.json +++ b/src/Microsoft.Management.Infrastructure/project.json @@ -8,7 +8,7 @@ }, "dependencies": { - "Microsoft.Management.Infrastructure.Native": "1.0.0-rc3" + "Microsoft.Management.Infrastructure.Native": "1.0.0-rc4" }, "frameworks": { diff --git a/src/windows-build b/src/windows-build index 674541f744..7144b55bda 160000 --- a/src/windows-build +++ b/src/windows-build @@ -1 +1 @@ -Subproject commit 674541f7444de5be5f8c63e3a2ef2d98739c1943 +Subproject commit 7144b55bdafb71dc91af4f5fb13b6e14904b789f