From cf32b21f845def30105b1b4bbbae126b989b362b Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 19 Jan 2022 10:59:46 -0800 Subject: [PATCH 1/7] Update 1ES pool to use new secure images --- tools/releaseBuild/yaml/releaseBuild.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/releaseBuild/yaml/releaseBuild.yml b/tools/releaseBuild/yaml/releaseBuild.yml index df4ca9f..84acf81 100644 --- a/tools/releaseBuild/yaml/releaseBuild.yml +++ b/tools/releaseBuild/yaml/releaseBuild.yml @@ -42,7 +42,7 @@ stages: pool: name: PowerShell1ES demands: - - ImageOverride -equals MMS2019 + - ImageOverride -equals MMSWindows2019-Secure displayName: Sign Windows variables: @@ -64,7 +64,9 @@ stages: - job: BuildLinux displayName: Linux pool: - vmImage: ubuntu-latest + name: PowerShell1ES + demands: + - ImageOverride -equals MMSUbuntu20.04-Secure strategy: matrix: UbuntuArm: @@ -94,7 +96,7 @@ stages: pool: name: PowerShell1ES demands: - - ImageOverride -equals MMS2019 + - ImageOverride -equals MMSWindows2019-Secure variables: - group: ESRP @@ -109,7 +111,7 @@ stages: pool: name: PowerShell1ES demands: - - ImageOverride -equals MMS2019 + - ImageOverride -equals MMSWindows2019-Secure steps: - checkout: self clean: true From 6a581c205a2e029e5587188965208fa32bcf19a6 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 9 Feb 2022 14:49:08 -0800 Subject: [PATCH 2/7] Update to secure images --- tools/releaseBuild/yaml/releaseBuild.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/releaseBuild/yaml/releaseBuild.yml b/tools/releaseBuild/yaml/releaseBuild.yml index 84acf81..d12c4cf 100644 --- a/tools/releaseBuild/yaml/releaseBuild.yml +++ b/tools/releaseBuild/yaml/releaseBuild.yml @@ -42,7 +42,7 @@ stages: pool: name: PowerShell1ES demands: - - ImageOverride -equals MMSWindows2019-Secure + - ImageOverride -equals PSMMS2019-PS-Native-Secure displayName: Sign Windows variables: @@ -66,7 +66,7 @@ stages: pool: name: PowerShell1ES demands: - - ImageOverride -equals MMSUbuntu20.04-Secure + - ImageOverride -equals PSMMSUbuntu20.04-Secure strategy: matrix: UbuntuArm: @@ -96,7 +96,7 @@ stages: pool: name: PowerShell1ES demands: - - ImageOverride -equals MMSWindows2019-Secure + - ImageOverride -equals PSMMS2019-PS-Native-Secure variables: - group: ESRP @@ -111,7 +111,7 @@ stages: pool: name: PowerShell1ES demands: - - ImageOverride -equals MMSWindows2019-Secure + - ImageOverride -equals PSMMS2019-PS-Native-Secure steps: - checkout: self clean: true From 39aa9ac34a46f1ac58f109844f6fb46d5bc6d13d Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 9 Feb 2022 14:52:04 -0800 Subject: [PATCH 3/7] Update build stage with new image --- tools/releaseBuild/yaml/releaseBuild.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/releaseBuild/yaml/releaseBuild.yml b/tools/releaseBuild/yaml/releaseBuild.yml index d12c4cf..2e71b3f 100644 --- a/tools/releaseBuild/yaml/releaseBuild.yml +++ b/tools/releaseBuild/yaml/releaseBuild.yml @@ -23,7 +23,9 @@ stages: jobs: - job: BuildWin pool: - vmImage: vs2017-win2016 + name: PowerShell1ES + demands: + - ImageOverride -equals PSMMS2019-PS-Native-Secure displayName: Windows strategy: matrix: From 4c70c112ea55b554e8f54976d2daaa5272bd6731 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 9 Feb 2022 15:08:32 -0800 Subject: [PATCH 4/7] Remove usage of choco to install cmake and windows SDK --- build.psm1 | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/build.psm1 b/build.psm1 index 3c759c8..41d90d3 100644 --- a/build.psm1 +++ b/build.psm1 @@ -464,7 +464,7 @@ function Start-BuildNativeUnixBinaries { } elseif ($IsMacOS) { Start-NativeExecution { cmake -DCMAKE_TOOLCHAIN_FILE="./macos.toolchain.cmake" . } - Start-NativeExecution { make -j } + Start-NativeExecution { make -j } Start-NativeExecution { ctest --verbose } } else { @@ -2154,7 +2154,7 @@ function Start-PSBootstrap { $sdkPresent = Test-Win10SDK # Install chocolatey - $chocolateyPath = "$env:AllUsersProfile\chocolatey\bin" + <#$chocolateyPath = "$env:AllUsersProfile\chocolatey\bin" if(precheck 'choco' $null) { Write-Log "Chocolatey is already installed. Skipping installation." @@ -2177,25 +2177,34 @@ function Start-PSBootstrap { } else { Write-Log "Skipping installation of chocolatey, cause both cmake and Win 10 SDK are present." } + #> # Install cmake - $cmakePath = "${env:ProgramFiles}\CMake\bin" - if($cmakePresent -and !($force.IsPresent)) { - Write-Log "Cmake is already installed. Skipping installation." + #$cmakePath = "${env:ProgramFiles}\CMake\bin" + if($cmakePresent) { + Write-Log "Cmake is already installed." } else { - Write-Log "Cmake not present or -Force used. Installing cmake." - Start-NativeExecution { choco install cmake -y --version 3.10.0 } + throw "Cmake not present." + + <#Start-NativeExecution { choco install cmake -y --version 3.10.0 } if (-not ($machinePath.ToLower().Contains($cmakePath.ToLower()))) { Write-Log "Adding $cmakePath to Path environment variable" $env:Path += ";$cmakePath" $newMachineEnvironmentPath = "$cmakePath;$newMachineEnvironmentPath" } else { Write-Log "$cmakePath already present in Path environment variable" - } + }#> + } + + if ($sdkPresent) { + Write-Log "Windows 10 SDK is already installed." + } + else { + throw "Windows 10 SDK not present." } # Install Windows 10 SDK - $packageName = "windows-sdk-10.0" + <#$packageName = "windows-sdk-10.0" if (-not $sdkPresent) { Write-Log "Windows 10 SDK not present. Installing $packageName." @@ -2211,6 +2220,7 @@ function Start-PSBootstrap { [Environment]::SetEnvironmentVariable('Path', $newMachineEnvironmentPath, 'MACHINE') } } + #> } } } finally { From 48265d317b18f230f8c6a244df9670a820f653ff Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 9 Feb 2022 15:27:30 -0800 Subject: [PATCH 5/7] Remove choco from yaml --- tools/releaseBuild/yaml/windows-build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/releaseBuild/yaml/windows-build.yml b/tools/releaseBuild/yaml/windows-build.yml index a5c9cd2..f1ed011 100644 --- a/tools/releaseBuild/yaml/windows-build.yml +++ b/tools/releaseBuild/yaml/windows-build.yml @@ -1,8 +1,4 @@ steps: - - powershell: | - choco install cmake.install --installargs 'ADD_CMAKE_TO_PATH=System' - displayName: Install cmake - condition: succeeded() - powershell: | $vsPath = ${Env:ProgramFiles(x86)} + '\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin' Write-Host "##vso[task.prependpath]$vsPath" From b3f043e07dc30ac01a22a49f6fd8ea0adc2872d9 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 9 Feb 2022 17:32:52 -0800 Subject: [PATCH 6/7] Update the AzUpload task version --- tools/releaseBuild/yaml/upload.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/yaml/upload.yml b/tools/releaseBuild/yaml/upload.yml index 256bde8..62ac0fb 100644 --- a/tools/releaseBuild/yaml/upload.yml +++ b/tools/releaseBuild/yaml/upload.yml @@ -3,7 +3,7 @@ parameters: sourcePath: '' steps: -- task: AzureFileCopy@2 +- task: AzureFileCopy@4 displayName: 'Upload ${{ parameters.fileName }} to azure blob' inputs: SourcePath: '${{ parameters.sourcePath }}' From ed19f80662963e51a9783b98c5d48332f5f296f7 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 14 Feb 2022 12:05:56 -0800 Subject: [PATCH 7/7] Remove commented code --- build.psm1 | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) diff --git a/build.psm1 b/build.psm1 index 41d90d3..efc448a 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2153,47 +2153,12 @@ function Start-PSBootstrap { $cmakePresent = precheck 'cmake' $null $sdkPresent = Test-Win10SDK - # Install chocolatey - <#$chocolateyPath = "$env:AllUsersProfile\chocolatey\bin" - - if(precheck 'choco' $null) { - Write-Log "Chocolatey is already installed. Skipping installation." - } - elseif(($cmakePresent -eq $false) -or ($sdkPresent -eq $false)) { - Write-Log "Chocolatey not present. Installing chocolatey." - if ($Force -or "Install chocolatey via https://chocolatey.org/install.ps1") { - Invoke-Expression ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) - if (-not ($machinePath.ToLower().Contains($chocolateyPath.ToLower()))) { - Write-Log "Adding $chocolateyPath to Path environment variable" - $env:Path += ";$chocolateyPath" - $newMachineEnvironmentPath += ";$chocolateyPath" - } else { - Write-Log "$chocolateyPath already present in Path environment variable" - } - } else { - Write-Error "Chocolatey is required to install missing dependencies. Please install it from https://chocolatey.org/ manually. Alternatively, install cmake and Windows 10 SDK." - return - } - } else { - Write-Log "Skipping installation of chocolatey, cause both cmake and Win 10 SDK are present." - } - #> - # Install cmake #$cmakePath = "${env:ProgramFiles}\CMake\bin" if($cmakePresent) { Write-Log "Cmake is already installed." } else { throw "Cmake not present." - - <#Start-NativeExecution { choco install cmake -y --version 3.10.0 } - if (-not ($machinePath.ToLower().Contains($cmakePath.ToLower()))) { - Write-Log "Adding $cmakePath to Path environment variable" - $env:Path += ";$cmakePath" - $newMachineEnvironmentPath = "$cmakePath;$newMachineEnvironmentPath" - } else { - Write-Log "$cmakePath already present in Path environment variable" - }#> } if ($sdkPresent) { @@ -2202,25 +2167,6 @@ function Start-PSBootstrap { else { throw "Windows 10 SDK not present." } - - # Install Windows 10 SDK - <#$packageName = "windows-sdk-10.0" - - if (-not $sdkPresent) { - Write-Log "Windows 10 SDK not present. Installing $packageName." - Start-NativeExecution { choco install windows-sdk-10.0 -y } - } else { - Write-Log "Windows 10 SDK present. Skipping installation." - } - - # Update path machine environment variable - if ($newMachineEnvironmentPath -ne $machinePath) { - Write-Log "Updating Path machine environment variable" - if ($Force -or $PSCmdlet.ShouldProcess("Update Path machine environment variable to $newMachineEnvironmentPath")) { - [Environment]::SetEnvironmentVariable('Path', $newMachineEnvironmentPath, 'MACHINE') - } - } - #> } } } finally {