From 99e4b87cc66424ba27242c66c181080797d2f34a Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Wed, 27 Jul 2016 10:48:36 -0700 Subject: [PATCH 1/4] Teach Start-DevPowerShell run CoreCLR version --- build.psm1 | 7 ++++--- docs/building/windows-full.md | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build.psm1 b/build.psm1 index bf4eaf408..8941e2772 100644 --- a/build.psm1 +++ b/build.psm1 @@ -884,10 +884,11 @@ function Publish-NuGetFeed function Start-DevPowerShell { param( + [switch]$FullCLR, [switch]$ZapDisable, [string[]]$ArgumentList = '', [switch]$LoadProfile, - [string]$binDir = (Split-Path (New-PSOptions -FullCLR).Output), + [string]$binDir = (Split-Path (New-PSOptions -FullCLR:$FullCLR).Output), [switch]$NoNewWindow, [string]$Command, [switch]$KeepPSModulePath @@ -918,7 +919,7 @@ function Start-DevPowerShell { $env:COMPLUS_ZapDisable = 1 } - if (-not (Test-Path $binDir\powershell.exe.config)) { + if ($FullCLR -and (-not (Test-Path $binDir\powershell.exe.config))) { $configContents = @" @@ -932,7 +933,7 @@ function Start-DevPowerShell { # splatting for the win $startProcessArgs = @{ - FilePath = "$binDir\powershell.exe" + FilePath = "$binDir\powershell" ArgumentList = "$ArgumentList" } diff --git a/docs/building/windows-full.md b/docs/building/windows-full.md index f9c7e23fc..6a07e257e 100644 --- a/docs/building/windows-full.md +++ b/docs/building/windows-full.md @@ -92,20 +92,20 @@ Assembly Cache (GAC), not your output directory. Use `Start-DevPowerShell` helper funciton, to workaround it with `$env:DEVPATH` ```powershell -Start-DevPowerShell +Start-DevPowerShell -FullCLR ``` This command has a reasonable default to run `powershell.exe` from the build output folder. If you are building an unusual configuration (i.e. not `Debug`), you can explicitly specify path to the bin directory ```powershell -Start-DevPowerShell -binDir .\src\Microsoft.PowerShell.ConsoleHost\bin\Debug\net451 +Start-DevPowerShell -FullCLR -binDir .\src\Microsoft.PowerShell.ConsoleHost\bin\Debug\net451 ``` Or more programmatically: ```powershell -Start-DevPowerShell -binDir (Split-Path -Parent (Get-PSOutput)) +Start-DevPowerShell -FullCLR -binDir (Split-Path -Parent (Get-PSOutput)) ``` The default for produced `powershell.exe` is x64. From 2fe47648307fc474776604b8ad71caa7eb032f5f Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Wed, 27 Jul 2016 10:55:42 -0700 Subject: [PATCH 2/4] Fix Start-DevPowerShell for Unix --- build.psm1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.psm1 b/build.psm1 index 8941e2772..25614ea82 100644 --- a/build.psm1 +++ b/build.psm1 @@ -895,6 +895,12 @@ function Start-DevPowerShell { ) try { + if ((-not $NoNewWindow) -and ($IsLinux -or $IsOSX)) + { + Write-Warning "Start-DevPowerShell -NoNewWindow is implied on non-windows systems" + $NoNewWindow = $true + } + if (-not $LoadProfile) { $ArgumentList = @('-noprofile') + $ArgumentList } From 70ff0cef196af4b2350c39aff5886f925bad122c Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Wed, 27 Jul 2016 12:19:17 -0700 Subject: [PATCH 3/4] Fix Start-DevPowerShell call from appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 9ce7c3021..2eceae748 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,7 +42,7 @@ test_script: $env:FullOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -FullCLR)) Write-Host -Foreground Green 'Run FullCLR tests' $testResultsFileFullCLR = "$pwd\TestsResults.FullCLR.xml" - Start-DevPowerShell -NoNewWindow -ArgumentList '-noprofile', '-noninteractive' -Command "Invoke-Pester test/fullCLR -ExcludeTag 'Slow' -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR" + Start-DevPowerShell -FullCLR -NoNewWindow -ArgumentList '-noprofile', '-noninteractive' -Command "Invoke-Pester test/fullCLR -ExcludeTag 'Slow' -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR" (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFileFullCLR)) # # Fail the build, if tests failed From ce5cc3ca37bad9ecf9ecfe568cf505408a8f155c Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Wed, 27 Jul 2016 12:27:41 -0700 Subject: [PATCH 4/4] Fix Start-DevPowerShell for PowerShellCore edition on windows --- build.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.psm1 b/build.psm1 index 25614ea82..519fde426 100644 --- a/build.psm1 +++ b/build.psm1 @@ -895,9 +895,9 @@ function Start-DevPowerShell { ) try { - if ((-not $NoNewWindow) -and ($IsLinux -or $IsOSX)) + if ((-not $NoNewWindow) -and ($IsCoreCLR)) { - Write-Warning "Start-DevPowerShell -NoNewWindow is implied on non-windows systems" + Write-Warning "Start-DevPowerShell -NoNewWindow is currently implied in PowerShellCore edition https://github.com/PowerShell/PowerShell/issues/1543" $NoNewWindow = $true }