From 145bdf44f9e9a9286d8d68e3e29a5f38d9b44db1 Mon Sep 17 00:00:00 2001 From: Andy Jordan Date: Fri, 21 Oct 2022 11:04:49 -0700 Subject: [PATCH 1/2] Add assertion to build that PSES bits are built in release configuration Because it's way too easier to break that! We were building in release configuration, then running the tests...and the tests were then building (and overwriting the bits) in debug configuration. --- .vsts-ci/templates/ci-general.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index d4a042048c..7f19a93804 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -70,6 +70,18 @@ steps: workingDirectory: $(Build.SourcesDirectory)/vscode-powershell pwsh: ${{ parameters.pwsh }} +- task: PowerShell@2 + displayName: Assert PowerShellEditorServices release configuration + inputs: + targetType: inline + script: | + $assembly = [Reflection.Assembly]::LoadFile("$(Build.SourcesDirectory)/vscode-powershell/modules/PowerShellEditorServices.VSCode/bin/Microsoft.PowerShell.EditorServices.VSCode.dll") + if ($assembly.GetCustomAttributes([System.Diagnostics.DebuggableAttribute], $true).IsJITOptimizerDisabled) { + Write-Host "##vso[task.LogIssue type=error;] PowerShell Editor Services bits were not built in release configuration!" + exit 1 + } + pwsh: ${{ parameters.pwsh }} + - publish: $(vsixPath) artifact: vscode-powershell-vsix-$(System.JobId) displayName: Publish extension artifact From 4c4a1121366439985bf621458ff078a8aea03007 Mon Sep 17 00:00:00 2001 From: Andy Jordan Date: Fri, 21 Oct 2022 13:51:51 -0700 Subject: [PATCH 2/2] Invoke server build in same configuration as client --- vscode-powershell.build.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index 8c9131f071..1e170a3a1f 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -50,7 +50,7 @@ task RestoreEditorServices -If (Get-EditorServicesPath) { } Write-Host "`n### Building PSES`n" -ForegroundColor Green - Invoke-Build Build (Get-EditorServicesPath) + Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration } "Release" { # When releasing, we ensure the bits are not symlinked but copied, @@ -64,7 +64,7 @@ task RestoreEditorServices -If (Get-EditorServicesPath) { # We only build if it hasn't been built at all. if (!(Test-Path "$(Split-Path (Get-EditorServicesPath))/module/PowerShellEditorServices/bin")) { Write-Host "`n### Building PSES`n" -ForegroundColor Green - Invoke-Build Build (Get-EditorServicesPath) + Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration } Write-Host "`n### Copying PSES`n" -ForegroundColor Green