From 3ec546fdfd13e792a438f2bd81ba419993ce18a8 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Sun, 17 May 2020 23:12:32 +0800 Subject: [PATCH 01/46] Delete recursive windows initialize-environment --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index 4bbc15665b69aa..503dae02ed9ea7 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete($Path) + [System.IO.Directory]::Delete($Path,true) } } From 7ea3b773a4430a7825a6e7cafe8ddbc9f3f7c311 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Sun, 17 May 2020 23:14:54 +0800 Subject: [PATCH 02/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index 503dae02ed9ea7..abf07efdc411de 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete($Path,true) + [System.IO.Directory]::Delete($Path, true) } } From aa8344d924ede886521079e4c33dc72079cf3313 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Sun, 17 May 2020 23:17:40 +0800 Subject: [PATCH 03/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index abf07efdc411de..ed926ca2b0b55b 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete($Path, true) + [System.IO.Directory]::Delete($Path, recursive) } } From 881c4e8697afc21d9738447aa744d6059774992f Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Sun, 17 May 2020 23:23:05 +0800 Subject: [PATCH 04/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index ed926ca2b0b55b..279b5fcd9d182a 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete($Path, recursive) + [System.IO.Directory]::Delete($Path,$true) } } From 18d53c642e0f1b8d43f8df978b4d05fe1d3812c9 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Sun, 17 May 2020 23:45:02 +0800 Subject: [PATCH 05/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index 279b5fcd9d182a..c990c54401b830 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete($Path,$true) + [System.IO.Directory]::Delete(Convert-Path $Path), $true) } } From e4ae132a0707a05fd50995d274de6ed919bb9382 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Sun, 17 May 2020 23:46:32 +0800 Subject: [PATCH 06/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index c990c54401b830..f54c10a92bf163 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete(Convert-Path $Path), $true) + [System.IO.Directory]::Delete(Convert-Path $Path, $true) } } From dee8fcac336c74bcd96136b9912d92ae2cf5f455 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Sun, 17 May 2020 23:47:52 +0800 Subject: [PATCH 07/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index f54c10a92bf163..b06ae1b2d43f11 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete(Convert-Path $Path, $true) + [System.IO.Directory]::Delete($Path, $true) } } From f388bfa1df3d1e1563e8b876a36bb80556167808 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Sun, 17 May 2020 23:51:02 +0800 Subject: [PATCH 08/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index b06ae1b2d43f11..e9708881594459 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete($Path, $true) + [System.IO.Directory]::Delete((Convert-Path $Path), $true) } } From d7d13e87c06d09e2aa6cbf6cdf5a927f7ede1a3b Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 02:35:01 +0800 Subject: [PATCH 09/46] Update CONTROL --- ports/mpir/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/mpir/CONTROL b/ports/mpir/CONTROL index 79238cbb55c429..58d1c7b37452ba 100644 --- a/ports/mpir/CONTROL +++ b/ports/mpir/CONTROL @@ -1,5 +1,5 @@ Source: mpir -Version: 3.0.0-7 +Version: 3.0.0-8 Homepage: https://github.com/wbhart/mpir Description: Multiple Precision Integers and Rationals. -Supports: !uwp \ No newline at end of file +Supports: !uwp From b7fa72c66e623286a6f7c6c6f9afb905e2d92989 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 02:35:07 +0800 Subject: [PATCH 10/46] Update portfile.cmake --- ports/mpir/portfile.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index 42dd34c942e34f..9f8534633fbf11 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,8 +1,4 @@ -include(vcpkg_common_functions) - -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "MPIR currently can only be built for desktop") -endif() + vcpkg_fail_port_install(MESSAGE "MPIR currently can only be built for desktop" ON_TARGET "UWP") if(VCPKG_CRT_LINKAGE STREQUAL "static" AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") message(FATAL_ERROR "MPIR currently can only be built using the dynamic CRT when building DLLs") From 336af54a1cda5f27479b314c2d0781f4ae1c7c62 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 03:03:40 +0800 Subject: [PATCH 11/46] add cmake to vmss --- .../windows/provision-image.ps1 | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/scripts/azure-pipelines/windows/provision-image.ps1 b/scripts/azure-pipelines/windows/provision-image.ps1 index 9a33461ee72b25..02527a0d5853d8 100644 --- a/scripts/azure-pipelines/windows/provision-image.ps1 +++ b/scripts/azure-pipelines/windows/provision-image.ps1 @@ -114,6 +114,8 @@ $Workloads = @( $MpiUrl = 'https://download.microsoft.com/download/A/E/0/AE002626-9D9D-448D-8197-1EA510E297CE/msmpisetup.exe' +$CmakeUrl = 'https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2-win32-x86.msi' + $CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_426.00_win10.exe' $CudaFeatures = 'nvcc_10.1 cuobjdump_10.1 nvprune_10.1 cupti_10.1 gpu_library_advisor_10.1 memcheck_10.1 ' + ` 'nvdisasm_10.1 nvprof_10.1 visual_profiler_10.1 visual_studio_integration_10.1 cublas_10.1 cublas_dev_10.1 ' + ` @@ -313,6 +315,37 @@ Function InstallMpi { } } +<# +.SYNOPSIS +Installs Cmake + +.DESCRIPTION +Downloads the Cmake installer located at $Url, and installs it with the +correct flags. + +.PARAMETER Url +The URL of the installer. +#> +Function InstallCmake { + Param( + [String]$Url + ) + + try { + Write-Host 'Downloading Cmake...' + [string]$msiPath = Get-TempFilePath -Extension 'msi' + curl.exe -L -o $msiPath -s -S $Url + Write-Host 'Installing Cmake...' + $args = @('/i', $msiPath, '/norestart', '/quiet', '/qn') + $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru + Add-Path "${env:ProgramFiles(x86)}\CMake\bin" + PrintMsiExitCodeMessage $proc.ExitCode + } + catch { + Write-Error "Failed to install Cmake! $($_.Exception.Message)" + } +} + <# .SYNOPSIS Installs NVIDIA's CUDA Toolkit. @@ -431,6 +464,7 @@ Add-MPPreference -ExclusionProcess python.exe InstallVisualStudio -Workloads $Workloads -BootstrapperUrl $VisualStudioBootstrapperUrl -Nickname 'Stable' InstallMpi -Url $MpiUrl +InstallCmake -Url $CmakeUrl InstallCuda -Url $CudaUrl -Features $CudaFeatures InstallZip -Url $BinSkimUrl -Name 'BinSkim' -Dir 'C:\BinSkim' if (-Not ([string]::IsNullOrWhiteSpace($StorageAccountName))) { From c9ada16d762ad80bfae4210fe42dc31689d446b4 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 14:24:46 +0800 Subject: [PATCH 12/46] Update portfile.cmake --- ports/mpir/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index 9f8534633fbf11..a633b3cf3cd158 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -128,5 +128,5 @@ else() vcpkg_copy_pdbs() - configure_file(${SOURCE_PATH}/COPYING.lib ${CURRENT_PACKAGES_DIR}/share/mpir/copyright COPYONLY) + configure_file(${SOURCE_PATH}/COPYING.lib ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) endif() From 9713344055e500772cec7295ae2b855c328b92a5 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 14:35:43 +0800 Subject: [PATCH 13/46] Update azure-pipelines.yml --- scripts/azure-pipelines/osx/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index 2427a899e732ba..a22a8a8618f168 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -52,5 +52,5 @@ jobs: displayName: 'Publish Artifact: x64-osx port build failure logs' inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)/failureLogs' - ArtifactName: 'x64-osx port build failure logs' + ArtifactName: 'x64-osx_port_build_failure_logs' condition: failed() From f58a6f09d7f2afe73f147b8568458af8f54d126f Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 14:43:18 +0800 Subject: [PATCH 14/46] Update initialize-environment.sh --- scripts/azure-pipelines/osx/initialize-environment.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/azure-pipelines/osx/initialize-environment.sh b/scripts/azure-pipelines/osx/initialize-environment.sh index 5eeba4255c67a3..1ae3b6f157dd78 100755 --- a/scripts/azure-pipelines/osx/initialize-environment.sh +++ b/scripts/azure-pipelines/osx/initialize-environment.sh @@ -20,6 +20,7 @@ ln -s ~/Data/packages rm -rf ~/Data/packages/* || true rm archives || rm -rf archives || true +mkdir -p ~/Data/packages/failureLogs || true ln -s ~/Data/archives rm -rf downloads || true From 223a2ac0b5ae34225623fa1b80e4bf2c0d685233 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 14:43:23 +0800 Subject: [PATCH 15/46] Update azure-pipelines.yml --- scripts/azure-pipelines/osx/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index a22a8a8618f168..2427a899e732ba 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -52,5 +52,5 @@ jobs: displayName: 'Publish Artifact: x64-osx port build failure logs' inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)/failureLogs' - ArtifactName: 'x64-osx_port_build_failure_logs' + ArtifactName: 'x64-osx port build failure logs' condition: failed() From 3aa5e67a7118169ae681e9eb87f79fa8206b54b9 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 14:45:26 +0800 Subject: [PATCH 16/46] Update initialize-environment.sh --- scripts/azure-pipelines/osx/initialize-environment.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/azure-pipelines/osx/initialize-environment.sh b/scripts/azure-pipelines/osx/initialize-environment.sh index 1ae3b6f157dd78..5eeba4255c67a3 100755 --- a/scripts/azure-pipelines/osx/initialize-environment.sh +++ b/scripts/azure-pipelines/osx/initialize-environment.sh @@ -20,7 +20,6 @@ ln -s ~/Data/packages rm -rf ~/Data/packages/* || true rm archives || rm -rf archives || true -mkdir -p ~/Data/packages/failureLogs || true ln -s ~/Data/archives rm -rf downloads || true From b75df0e761236ffa441ad5e67b2314554d0ef7e8 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 15:02:05 +0800 Subject: [PATCH 17/46] Update azure-pipelines.yml --- scripts/azure-pipelines/windows/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/azure-pipelines.yml b/scripts/azure-pipelines/windows/azure-pipelines.yml index 559037e3b9f3ab..5575e0072530a6 100644 --- a/scripts/azure-pipelines/windows/azure-pipelines.yml +++ b/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -59,4 +59,4 @@ jobs: inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)\failureLogs' ArtifactName: '${{ parameters.triplet }} port build failure logs' - condition: failed() + condition: succeededOrFailed() From 43c93d5af1af5b539856816f11419536e657547b Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 15:02:14 +0800 Subject: [PATCH 18/46] Update azure-pipelines.yml --- scripts/azure-pipelines/osx/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index 2427a899e732ba..848b70c794ad6c 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -43,7 +43,7 @@ jobs: inputs: failOnStderr: true filePath: 'scripts/azure-pipelines/analyze-test-results.ps1' - arguments: '-baselineFile $(System.DefaultWorkingDirectory)/scripts/ci.baseline.txt -logDir "$(System.ArtifactsDirectory)/xml-results" -outputDir "$(Build.ArtifactStagingDirectory)" -failurelogDir ~/Data/archives/fail -triplets "x64-osx" -errorOnRegression' + arguments: '-baselineFile $(System.DefaultWorkingDirectory)/scripts/ci.baseline.txt -logDir "$(System.ArtifactsDirectory)/xml-results" -failurelogDir ~/Data/archives/fail -outputDir "$(Build.ArtifactStagingDirectory)" -triplets "x64-osx" -errorOnRegression' - bash: | df -h displayName: 'Report on Disk Space After Build' From fc6a4cd9c773e89375d295b7684ece06c6d74b19 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 15:06:36 +0800 Subject: [PATCH 19/46] Update azure-pipelines.yml --- scripts/azure-pipelines/osx/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index 848b70c794ad6c..1218e15f5b7020 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -51,6 +51,6 @@ jobs: - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: x64-osx port build failure logs' inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)/failureLogs' + PathtoPublish: '$(Build.ArtifactStagingDirectory)' ArtifactName: 'x64-osx port build failure logs' condition: failed() From 9e78d21ff3871029c92e1d093345d7ccbc35ece9 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 15:06:48 +0800 Subject: [PATCH 20/46] Update azure-pipelines.yml --- scripts/azure-pipelines/windows/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/azure-pipelines.yml b/scripts/azure-pipelines/windows/azure-pipelines.yml index 5575e0072530a6..58aae20b3457ae 100644 --- a/scripts/azure-pipelines/windows/azure-pipelines.yml +++ b/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -57,6 +57,6 @@ jobs: - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: ${{ parameters.triplet }} port build failure logs' inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\failureLogs' + PathtoPublish: '$(Build.ArtifactStagingDirectory)' ArtifactName: '${{ parameters.triplet }} port build failure logs' condition: succeededOrFailed() From 30983bd30b53d3560e9b8ce3f3ad47608315574d Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 15:12:10 +0800 Subject: [PATCH 21/46] Update azure-pipelines.yml --- scripts/azure-pipelines/windows/azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/azure-pipelines/windows/azure-pipelines.yml b/scripts/azure-pipelines/windows/azure-pipelines.yml index 58aae20b3457ae..559037e3b9f3ab 100644 --- a/scripts/azure-pipelines/windows/azure-pipelines.yml +++ b/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -57,6 +57,6 @@ jobs: - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: ${{ parameters.triplet }} port build failure logs' inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' + PathtoPublish: '$(Build.ArtifactStagingDirectory)\failureLogs' ArtifactName: '${{ parameters.triplet }} port build failure logs' - condition: succeededOrFailed() + condition: failed() From 499e1b6b5af563167fb8a8a97e720ac8fe20cef7 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Mon, 18 May 2020 15:13:10 +0800 Subject: [PATCH 22/46] Update azure-pipelines.yml --- scripts/azure-pipelines/osx/azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index 1218e15f5b7020..2427a899e732ba 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -43,7 +43,7 @@ jobs: inputs: failOnStderr: true filePath: 'scripts/azure-pipelines/analyze-test-results.ps1' - arguments: '-baselineFile $(System.DefaultWorkingDirectory)/scripts/ci.baseline.txt -logDir "$(System.ArtifactsDirectory)/xml-results" -failurelogDir ~/Data/archives/fail -outputDir "$(Build.ArtifactStagingDirectory)" -triplets "x64-osx" -errorOnRegression' + arguments: '-baselineFile $(System.DefaultWorkingDirectory)/scripts/ci.baseline.txt -logDir "$(System.ArtifactsDirectory)/xml-results" -outputDir "$(Build.ArtifactStagingDirectory)" -failurelogDir ~/Data/archives/fail -triplets "x64-osx" -errorOnRegression' - bash: | df -h displayName: 'Report on Disk Space After Build' @@ -51,6 +51,6 @@ jobs: - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: x64-osx port build failure logs' inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' + PathtoPublish: '$(Build.ArtifactStagingDirectory)/failureLogs' ArtifactName: 'x64-osx port build failure logs' condition: failed() From 9b79907ec98e5aaa2be1eb982888f623935d617c Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 04:40:05 +0800 Subject: [PATCH 23/46] Update CONTROL --- ports/mpir/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mpir/CONTROL b/ports/mpir/CONTROL index 58d1c7b37452ba..6a68f926df7b34 100644 --- a/ports/mpir/CONTROL +++ b/ports/mpir/CONTROL @@ -1,5 +1,5 @@ Source: mpir -Version: 3.0.0-8 +Version: 3.0.0-7 Homepage: https://github.com/wbhart/mpir Description: Multiple Precision Integers and Rationals. Supports: !uwp From da88b49093fc9c69c471106302db22df26e5c329 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 04:40:38 +0800 Subject: [PATCH 24/46] Update portfile.cmake --- ports/mpir/portfile.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index a633b3cf3cd158..42dd34c942e34f 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,4 +1,8 @@ - vcpkg_fail_port_install(MESSAGE "MPIR currently can only be built for desktop" ON_TARGET "UWP") +include(vcpkg_common_functions) + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + message(FATAL_ERROR "MPIR currently can only be built for desktop") +endif() if(VCPKG_CRT_LINKAGE STREQUAL "static" AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") message(FATAL_ERROR "MPIR currently can only be built using the dynamic CRT when building DLLs") @@ -128,5 +132,5 @@ else() vcpkg_copy_pdbs() - configure_file(${SOURCE_PATH}/COPYING.lib ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) + configure_file(${SOURCE_PATH}/COPYING.lib ${CURRENT_PACKAGES_DIR}/share/mpir/copyright COPYONLY) endif() From 1cbbb18d7fab773246abedcced9a79f5b14accf5 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 06:23:42 +0800 Subject: [PATCH 25/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index e9708881594459..f6955485eea50c 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete((Convert-Path $Path), $true) + [System.IO.Directory]::Delete((Convert-Path $Path.Fullname), $true) } } From d8a2e8dfe77a6853c9119240b012b2377082777e Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 06:38:33 +0800 Subject: [PATCH 26/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index f6955485eea50c..108cad340d921b 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete((Convert-Path $Path.Fullname), $true) + [System.IO.Directory]::Delete($Path.Fullname) } } From c0f8ea32f1d63a59a328b7366976df24ba698c72 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 06:42:14 +0800 Subject: [PATCH 27/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index 108cad340d921b..e9708881594459 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete($Path.Fullname) + [System.IO.Directory]::Delete((Convert-Path $Path), $true) } } From 1a47d0bf252809e55af4ea3c647d07138505debe Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 08:51:33 +0800 Subject: [PATCH 28/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index e9708881594459..4bbc15665b69aa 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete((Convert-Path $Path), $true) + [System.IO.Directory]::Delete($Path) } } From a3e81183e5521ec8e8e2415f008908ffaddcaf97 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 09:38:06 +0800 Subject: [PATCH 29/46] Update provision-image.ps1 --- scripts/azure-pipelines/windows/provision-image.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/provision-image.ps1 b/scripts/azure-pipelines/windows/provision-image.ps1 index 02527a0d5853d8..9afc50ced1c197 100644 --- a/scripts/azure-pipelines/windows/provision-image.ps1 +++ b/scripts/azure-pipelines/windows/provision-image.ps1 @@ -338,7 +338,8 @@ Function InstallCmake { Write-Host 'Installing Cmake...' $args = @('/i', $msiPath, '/norestart', '/quiet', '/qn') $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru - Add-Path "${env:ProgramFiles(x86)}\CMake\bin" + $CurrentValue = [Environment]::GetEnvironmentVariable("PATH", "Machine") + [Environment]::SetEnvironmentVariable("PATH", $CurrentValue + [System.IO.Path]::PathSeparator + "${env:ProgramFiles(x86)}\CMake\bin", "Machine") PrintMsiExitCodeMessage $proc.ExitCode } catch { From 39ce13d26af1d8d18d3cc5bc2411c57d236bd850 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 09:40:10 +0800 Subject: [PATCH 30/46] Update initialize-environment.ps1 --- .../windows/initialize-environment.ps1 | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index 4bbc15665b69aa..1c1fc578b3965b 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -29,6 +29,81 @@ function Remove-DirectorySymlink { } } +# Source: https://github.com/appveyor/ci/blob/master/scripts/path-utils.psm1 +function Get-Path +{ + ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") | Sort-Object +} + +function Add-Path([string]$item,[switch]$before) +{ + $item = (Get-SanitizedPath $item) + $pathItemsArray = ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") + $pathItems = New-Object System.Collections.ArrayList($null) + $pathItems.AddRange($pathItemsArray) + + # add folder + $index = -1 + for($i = 0; $i -lt $pathItems.Count; $i++) { + if((Get-SanitizedPath $pathItems[$i]) -eq $item) { + $index = $i; + break + } + } + + if($index -eq -1) { + # item not found - add it + if ($before) { + $pathItems.Insert(0, $item) + } else { + $pathItems.Add($item) | Out-null + } + + # update PATH variable + $updatedPath = $pathItems -join ';' + [Environment]::SetEnvironmentVariable("path", $updatedPath, "machine") + } +} + +function Remove-Path([string]$item) +{ + $item = (Get-SanitizedPath $item) + $pathItemsArray = ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") + $pathItems = New-Object System.Collections.ArrayList($null) + $pathItems.AddRange($pathItemsArray) + + $index = -1 + for($i = 0; $i -lt $pathItems.Count; $i++) { + if((Get-SanitizedPath $pathItems[$i]) -eq $item) { + $index = $i; + break + } + } + + if($index -ne -1) { + # remove folder + $pathItems.RemoveAt($index) | Out-null + + # update PATH variable + $updatedPath = $pathItems -join ';' + [Environment]::SetEnvironmentVariable("path", $updatedPath, "machine") + } +} + +function Get-SanitizedPath([string]$path) { + return $path.Replace('/', '\').Trim('\') +} + +function Add-SessionPath([string]$path) { + $sanitizedPath = Get-SanitizedPath $path + foreach($item in $env:path.Split(";")) { + if($sanitizedPath -eq (Get-SanitizedPath $item)) { + return # already added + } + } + $env:path = "$sanitizedPath;$env:path" +} + Write-Host 'Setting up archives mount' if (-Not (Test-Path W:)) { net use W: "\\$StorageAccountName.file.core.windows.net\archives" /u:"AZURE\$StorageAccountName" $StorageAccountKey From c03b105f4ada7d310a4be6b74b6615f13bccf5a7 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 09:47:13 +0800 Subject: [PATCH 31/46] Update provision-image.ps1 --- scripts/azure-pipelines/windows/provision-image.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/azure-pipelines/windows/provision-image.ps1 b/scripts/azure-pipelines/windows/provision-image.ps1 index 9afc50ced1c197..fed366b36b7fe8 100644 --- a/scripts/azure-pipelines/windows/provision-image.ps1 +++ b/scripts/azure-pipelines/windows/provision-image.ps1 @@ -338,8 +338,10 @@ Function InstallCmake { Write-Host 'Installing Cmake...' $args = @('/i', $msiPath, '/norestart', '/quiet', '/qn') $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru - $CurrentValue = [Environment]::GetEnvironmentVariable("PATH", "Machine") - [Environment]::SetEnvironmentVariable("PATH", $CurrentValue + [System.IO.Path]::PathSeparator + "${env:ProgramFiles(x86)}\CMake\bin", "Machine") +# $CurrentValue = [Environment]::GetEnvironmentVariable("PATH", "Machine") +# [Environment]::SetEnvironmentVariable("PATH", $CurrentValue + [System.IO.Path]::PathSeparator + "${env:ProgramFiles(x86)}\CMake\bin", "Machine") + Add-Path "${env:ProgramFiles(x86)}\CMake\bin" + Add-SessionPath "${env:ProgramFiles(x86)}\CMake\bin" PrintMsiExitCodeMessage $proc.ExitCode } catch { From 4df8c21c6047ea302b9da74e828005463c1be11f Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 09:55:44 +0800 Subject: [PATCH 32/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index 1c1fc578b3965b..f36c1b45c4b1e0 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -104,6 +104,9 @@ function Add-SessionPath([string]$path) { $env:path = "$sanitizedPath;$env:path" } +Get-Path Format-List | Out-Host +"`n" + Write-Host 'Setting up archives mount' if (-Not (Test-Path W:)) { net use W: "\\$StorageAccountName.file.core.windows.net\archives" /u:"AZURE\$StorageAccountName" $StorageAccountKey From e7ffb8c6812252e337c4bf7fb940194129e6ab5e Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 09:59:58 +0800 Subject: [PATCH 33/46] Update provision-image.ps1 --- scripts/azure-pipelines/windows/provision-image.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/provision-image.ps1 b/scripts/azure-pipelines/windows/provision-image.ps1 index fed366b36b7fe8..5c0e7645b1eead 100644 --- a/scripts/azure-pipelines/windows/provision-image.ps1 +++ b/scripts/azure-pipelines/windows/provision-image.ps1 @@ -340,8 +340,8 @@ Function InstallCmake { $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru # $CurrentValue = [Environment]::GetEnvironmentVariable("PATH", "Machine") # [Environment]::SetEnvironmentVariable("PATH", $CurrentValue + [System.IO.Path]::PathSeparator + "${env:ProgramFiles(x86)}\CMake\bin", "Machine") - Add-Path "${env:ProgramFiles(x86)}\CMake\bin" Add-SessionPath "${env:ProgramFiles(x86)}\CMake\bin" + Add-Path "${env:ProgramFiles(x86)}\CMake\bin" PrintMsiExitCodeMessage $proc.ExitCode } catch { From 24d2031607cb0057476683ea23d5a45f5c803f83 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 10:04:47 +0800 Subject: [PATCH 34/46] Update provision-image.ps1 --- scripts/azure-pipelines/windows/provision-image.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/azure-pipelines/windows/provision-image.ps1 b/scripts/azure-pipelines/windows/provision-image.ps1 index 5c0e7645b1eead..fa38fbb19c7542 100644 --- a/scripts/azure-pipelines/windows/provision-image.ps1 +++ b/scripts/azure-pipelines/windows/provision-image.ps1 @@ -340,8 +340,8 @@ Function InstallCmake { $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru # $CurrentValue = [Environment]::GetEnvironmentVariable("PATH", "Machine") # [Environment]::SetEnvironmentVariable("PATH", $CurrentValue + [System.IO.Path]::PathSeparator + "${env:ProgramFiles(x86)}\CMake\bin", "Machine") - Add-SessionPath "${env:ProgramFiles(x86)}\CMake\bin" - Add-Path "${env:ProgramFiles(x86)}\CMake\bin" +# Add-SessionPath "${env:ProgramFiles(x86)}\CMake\bin" +# Add-Path "${env:ProgramFiles(x86)}\CMake\bin" PrintMsiExitCodeMessage $proc.ExitCode } catch { @@ -482,3 +482,6 @@ if (-Not ([string]::IsNullOrWhiteSpace($StorageAccountKey))) { -Name StorageAccountKey ` -Value $StorageAccountKey } + +Get-Path Format-List | Out-Host +"`n" From 55443534c2824f0ca7a7f431fe33e8d03ae953ed Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 10:08:26 +0800 Subject: [PATCH 35/46] Update provision-image.ps1 --- scripts/azure-pipelines/windows/provision-image.ps1 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/azure-pipelines/windows/provision-image.ps1 b/scripts/azure-pipelines/windows/provision-image.ps1 index fa38fbb19c7542..3fc0196c2f19ff 100644 --- a/scripts/azure-pipelines/windows/provision-image.ps1 +++ b/scripts/azure-pipelines/windows/provision-image.ps1 @@ -338,8 +338,8 @@ Function InstallCmake { Write-Host 'Installing Cmake...' $args = @('/i', $msiPath, '/norestart', '/quiet', '/qn') $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru -# $CurrentValue = [Environment]::GetEnvironmentVariable("PATH", "Machine") -# [Environment]::SetEnvironmentVariable("PATH", $CurrentValue + [System.IO.Path]::PathSeparator + "${env:ProgramFiles(x86)}\CMake\bin", "Machine") + $CurrentValue = [Environment]::GetEnvironmentVariable("PATH", "Machine") + [Environment]::SetEnvironmentVariable("PATH", $CurrentValue + [System.IO.Path]::PathSeparator + "${env:ProgramFiles(x86)}\CMake\bin", "Machine") # Add-SessionPath "${env:ProgramFiles(x86)}\CMake\bin" # Add-Path "${env:ProgramFiles(x86)}\CMake\bin" PrintMsiExitCodeMessage $proc.ExitCode @@ -482,6 +482,3 @@ if (-Not ([string]::IsNullOrWhiteSpace($StorageAccountKey))) { -Name StorageAccountKey ` -Value $StorageAccountKey } - -Get-Path Format-List | Out-Host -"`n" From a738efade889ffcc2d4f62847d80b1ecab15d192 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 10:13:42 +0800 Subject: [PATCH 36/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index f36c1b45c4b1e0..b88e77e5ec83a4 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -38,7 +38,7 @@ function Get-Path function Add-Path([string]$item,[switch]$before) { $item = (Get-SanitizedPath $item) - $pathItemsArray = ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") + $pathItemsArray = ([Environment]::GetEnvironmentVariable("path", "User")).Split(";") $pathItems = New-Object System.Collections.ArrayList($null) $pathItems.AddRange($pathItemsArray) From ff7f8697640d76e037dc3930606b62b3c05f561f Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 10:14:19 +0800 Subject: [PATCH 37/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index b88e77e5ec83a4..23d3a3a652eaa2 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -32,13 +32,13 @@ function Remove-DirectorySymlink { # Source: https://github.com/appveyor/ci/blob/master/scripts/path-utils.psm1 function Get-Path { - ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") | Sort-Object + ([Environment]::GetEnvironmentVariable("path", "User")).Split(";") | Sort-Object } function Add-Path([string]$item,[switch]$before) { $item = (Get-SanitizedPath $item) - $pathItemsArray = ([Environment]::GetEnvironmentVariable("path", "User")).Split(";") + $pathItemsArray = ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") $pathItems = New-Object System.Collections.ArrayList($null) $pathItems.AddRange($pathItemsArray) From a7daebf46f518ed0c86b1f5990e7f24f77f90a11 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 10:19:42 +0800 Subject: [PATCH 38/46] Update initialize-environment.ps1 --- .../windows/initialize-environment.ps1 | 75 ------------------- 1 file changed, 75 deletions(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index 23d3a3a652eaa2..2d0e5774027ec9 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -29,81 +29,6 @@ function Remove-DirectorySymlink { } } -# Source: https://github.com/appveyor/ci/blob/master/scripts/path-utils.psm1 -function Get-Path -{ - ([Environment]::GetEnvironmentVariable("path", "User")).Split(";") | Sort-Object -} - -function Add-Path([string]$item,[switch]$before) -{ - $item = (Get-SanitizedPath $item) - $pathItemsArray = ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") - $pathItems = New-Object System.Collections.ArrayList($null) - $pathItems.AddRange($pathItemsArray) - - # add folder - $index = -1 - for($i = 0; $i -lt $pathItems.Count; $i++) { - if((Get-SanitizedPath $pathItems[$i]) -eq $item) { - $index = $i; - break - } - } - - if($index -eq -1) { - # item not found - add it - if ($before) { - $pathItems.Insert(0, $item) - } else { - $pathItems.Add($item) | Out-null - } - - # update PATH variable - $updatedPath = $pathItems -join ';' - [Environment]::SetEnvironmentVariable("path", $updatedPath, "machine") - } -} - -function Remove-Path([string]$item) -{ - $item = (Get-SanitizedPath $item) - $pathItemsArray = ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") - $pathItems = New-Object System.Collections.ArrayList($null) - $pathItems.AddRange($pathItemsArray) - - $index = -1 - for($i = 0; $i -lt $pathItems.Count; $i++) { - if((Get-SanitizedPath $pathItems[$i]) -eq $item) { - $index = $i; - break - } - } - - if($index -ne -1) { - # remove folder - $pathItems.RemoveAt($index) | Out-null - - # update PATH variable - $updatedPath = $pathItems -join ';' - [Environment]::SetEnvironmentVariable("path", $updatedPath, "machine") - } -} - -function Get-SanitizedPath([string]$path) { - return $path.Replace('/', '\').Trim('\') -} - -function Add-SessionPath([string]$path) { - $sanitizedPath = Get-SanitizedPath $path - foreach($item in $env:path.Split(";")) { - if($sanitizedPath -eq (Get-SanitizedPath $item)) { - return # already added - } - } - $env:path = "$sanitizedPath;$env:path" -} - Get-Path Format-List | Out-Host "`n" From 04b8b2e9befc484a3338e1e5bedab758eeba5038 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 10:21:09 +0800 Subject: [PATCH 39/46] Update provision-image.ps1 --- .../windows/provision-image.ps1 | 83 ++++++++++++++++++- 1 file changed, 79 insertions(+), 4 deletions(-) diff --git a/scripts/azure-pipelines/windows/provision-image.ps1 b/scripts/azure-pipelines/windows/provision-image.ps1 index 3fc0196c2f19ff..0e7311031c5325 100644 --- a/scripts/azure-pipelines/windows/provision-image.ps1 +++ b/scripts/azure-pipelines/windows/provision-image.ps1 @@ -35,6 +35,81 @@ param( $ErrorActionPreference = 'Stop' +# Source: https://github.com/appveyor/ci/blob/master/scripts/path-utils.psm1 +function Get-Path +{ + ([Environment]::GetEnvironmentVariable("path", "User")).Split(";") | Sort-Object +} + +function Add-Path([string]$item,[switch]$before) +{ + $item = (Get-SanitizedPath $item) + $pathItemsArray = ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") + $pathItems = New-Object System.Collections.ArrayList($null) + $pathItems.AddRange($pathItemsArray) + + # add folder + $index = -1 + for($i = 0; $i -lt $pathItems.Count; $i++) { + if((Get-SanitizedPath $pathItems[$i]) -eq $item) { + $index = $i; + break + } + } + + if($index -eq -1) { + # item not found - add it + if ($before) { + $pathItems.Insert(0, $item) + } else { + $pathItems.Add($item) | Out-null + } + + # update PATH variable + $updatedPath = $pathItems -join ';' + [Environment]::SetEnvironmentVariable("path", $updatedPath, "machine") + } +} + +function Remove-Path([string]$item) +{ + $item = (Get-SanitizedPath $item) + $pathItemsArray = ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") + $pathItems = New-Object System.Collections.ArrayList($null) + $pathItems.AddRange($pathItemsArray) + + $index = -1 + for($i = 0; $i -lt $pathItems.Count; $i++) { + if((Get-SanitizedPath $pathItems[$i]) -eq $item) { + $index = $i; + break + } + } + + if($index -ne -1) { + # remove folder + $pathItems.RemoveAt($index) | Out-null + + # update PATH variable + $updatedPath = $pathItems -join ';' + [Environment]::SetEnvironmentVariable("path", $updatedPath, "machine") + } +} + +function Get-SanitizedPath([string]$path) { + return $path.Replace('/', '\').Trim('\') +} + +function Add-SessionPath([string]$path) { + $sanitizedPath = Get-SanitizedPath $path + foreach($item in $env:path.Split(";")) { + if($sanitizedPath -eq (Get-SanitizedPath $item)) { + return # already added + } + } + $env:path = "$sanitizedPath;$env:path" +} + <# .SYNOPSIS Gets a random file path in the temp directory. @@ -338,10 +413,10 @@ Function InstallCmake { Write-Host 'Installing Cmake...' $args = @('/i', $msiPath, '/norestart', '/quiet', '/qn') $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru - $CurrentValue = [Environment]::GetEnvironmentVariable("PATH", "Machine") - [Environment]::SetEnvironmentVariable("PATH", $CurrentValue + [System.IO.Path]::PathSeparator + "${env:ProgramFiles(x86)}\CMake\bin", "Machine") -# Add-SessionPath "${env:ProgramFiles(x86)}\CMake\bin" -# Add-Path "${env:ProgramFiles(x86)}\CMake\bin" +# $CurrentValue = [Environment]::GetEnvironmentVariable("PATH", "Machine") +# [Environment]::SetEnvironmentVariable("PATH", $CurrentValue + [System.IO.Path]::PathSeparator + "${env:ProgramFiles(x86)}\CMake\bin", "Machine") + Add-Path "${env:ProgramFiles(x86)}\CMake\bin" + Add-SessionPath "${env:ProgramFiles(x86)}\CMake\bin" PrintMsiExitCodeMessage $proc.ExitCode } catch { From 9374f686303eb35709fce93b9a555a8c740dfda0 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 10:22:19 +0800 Subject: [PATCH 40/46] Update provision-image.ps1 --- scripts/azure-pipelines/windows/provision-image.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/provision-image.ps1 b/scripts/azure-pipelines/windows/provision-image.ps1 index 0e7311031c5325..2623f86aa94a0e 100644 --- a/scripts/azure-pipelines/windows/provision-image.ps1 +++ b/scripts/azure-pipelines/windows/provision-image.ps1 @@ -38,7 +38,7 @@ $ErrorActionPreference = 'Stop' # Source: https://github.com/appveyor/ci/blob/master/scripts/path-utils.psm1 function Get-Path { - ([Environment]::GetEnvironmentVariable("path", "User")).Split(";") | Sort-Object + ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") | Sort-Object } function Add-Path([string]$item,[switch]$before) From 9a668f305dc642a60818972388890578ccd88266 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 10:24:24 +0800 Subject: [PATCH 41/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index 2d0e5774027ec9..bbaf210e4dce67 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,7 +25,7 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete($Path) + [System.IO.Directory]::Delete((Convert-Path $Path), $true) } } From 529a3e3c30e0d7ef44445f8dc0c673837444f5e2 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 10:26:18 +0800 Subject: [PATCH 42/46] Update initialize-environment.ps1 --- scripts/azure-pipelines/windows/initialize-environment.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index bbaf210e4dce67..7efabbeafe7263 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -29,6 +29,11 @@ function Remove-DirectorySymlink { } } +function Get-Path +{ + ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") | Sort-Object +} + Get-Path Format-List | Out-Host "`n" From c6f06e412647f0f4dd59451224fbe1df9299e865 Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 10:30:39 +0800 Subject: [PATCH 43/46] Update initialize-environment.ps1 --- .../azure-pipelines/windows/initialize-environment.ps1 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 index 7efabbeafe7263..4bbc15665b69aa 100644 --- a/scripts/azure-pipelines/windows/initialize-environment.ps1 +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -25,18 +25,10 @@ $StorageAccountKey = $env:StorageAccountKey function Remove-DirectorySymlink { Param([string]$Path) if (Test-Path $Path) { - [System.IO.Directory]::Delete((Convert-Path $Path), $true) + [System.IO.Directory]::Delete($Path) } } -function Get-Path -{ - ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") | Sort-Object -} - -Get-Path Format-List | Out-Host -"`n" - Write-Host 'Setting up archives mount' if (-Not (Test-Path W:)) { net use W: "\\$StorageAccountName.file.core.windows.net\archives" /u:"AZURE\$StorageAccountName" $StorageAccountKey From e0ff379de879c703273a721e7b4891995ec5b63c Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Tue, 19 May 2020 10:30:42 +0800 Subject: [PATCH 44/46] Update provision-image.ps1 --- .../windows/provision-image.ps1 | 77 ------------------- 1 file changed, 77 deletions(-) diff --git a/scripts/azure-pipelines/windows/provision-image.ps1 b/scripts/azure-pipelines/windows/provision-image.ps1 index 2623f86aa94a0e..18ea80db8e446a 100644 --- a/scripts/azure-pipelines/windows/provision-image.ps1 +++ b/scripts/azure-pipelines/windows/provision-image.ps1 @@ -35,81 +35,6 @@ param( $ErrorActionPreference = 'Stop' -# Source: https://github.com/appveyor/ci/blob/master/scripts/path-utils.psm1 -function Get-Path -{ - ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") | Sort-Object -} - -function Add-Path([string]$item,[switch]$before) -{ - $item = (Get-SanitizedPath $item) - $pathItemsArray = ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") - $pathItems = New-Object System.Collections.ArrayList($null) - $pathItems.AddRange($pathItemsArray) - - # add folder - $index = -1 - for($i = 0; $i -lt $pathItems.Count; $i++) { - if((Get-SanitizedPath $pathItems[$i]) -eq $item) { - $index = $i; - break - } - } - - if($index -eq -1) { - # item not found - add it - if ($before) { - $pathItems.Insert(0, $item) - } else { - $pathItems.Add($item) | Out-null - } - - # update PATH variable - $updatedPath = $pathItems -join ';' - [Environment]::SetEnvironmentVariable("path", $updatedPath, "machine") - } -} - -function Remove-Path([string]$item) -{ - $item = (Get-SanitizedPath $item) - $pathItemsArray = ([Environment]::GetEnvironmentVariable("path", "machine")).Split(";") - $pathItems = New-Object System.Collections.ArrayList($null) - $pathItems.AddRange($pathItemsArray) - - $index = -1 - for($i = 0; $i -lt $pathItems.Count; $i++) { - if((Get-SanitizedPath $pathItems[$i]) -eq $item) { - $index = $i; - break - } - } - - if($index -ne -1) { - # remove folder - $pathItems.RemoveAt($index) | Out-null - - # update PATH variable - $updatedPath = $pathItems -join ';' - [Environment]::SetEnvironmentVariable("path", $updatedPath, "machine") - } -} - -function Get-SanitizedPath([string]$path) { - return $path.Replace('/', '\').Trim('\') -} - -function Add-SessionPath([string]$path) { - $sanitizedPath = Get-SanitizedPath $path - foreach($item in $env:path.Split(";")) { - if($sanitizedPath -eq (Get-SanitizedPath $item)) { - return # already added - } - } - $env:path = "$sanitizedPath;$env:path" -} - <# .SYNOPSIS Gets a random file path in the temp directory. @@ -415,8 +340,6 @@ Function InstallCmake { $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru # $CurrentValue = [Environment]::GetEnvironmentVariable("PATH", "Machine") # [Environment]::SetEnvironmentVariable("PATH", $CurrentValue + [System.IO.Path]::PathSeparator + "${env:ProgramFiles(x86)}\CMake\bin", "Machine") - Add-Path "${env:ProgramFiles(x86)}\CMake\bin" - Add-SessionPath "${env:ProgramFiles(x86)}\CMake\bin" PrintMsiExitCodeMessage $proc.ExitCode } catch { From 599e5364732736f05581d9a548e7e8e701d7d0dc Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Wed, 20 May 2020 05:50:55 +0800 Subject: [PATCH 45/46] rethinking *| https://github.com/microsoft/STL/blob/master/azure-devops/provision-image.ps1 --- .../windows/provision-image.ps1 | 38 ++----------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/scripts/azure-pipelines/windows/provision-image.ps1 b/scripts/azure-pipelines/windows/provision-image.ps1 index 18ea80db8e446a..5dabc195ff70f8 100644 --- a/scripts/azure-pipelines/windows/provision-image.ps1 +++ b/scripts/azure-pipelines/windows/provision-image.ps1 @@ -114,7 +114,8 @@ $Workloads = @( $MpiUrl = 'https://download.microsoft.com/download/A/E/0/AE002626-9D9D-448D-8197-1EA510E297CE/msmpisetup.exe' -$CmakeUrl = 'https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2-win32-x86.msi' +$CMakeUrl = 'https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2-win32-x86.msi' +$NinjaUrl = 'https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip' $CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_426.00_win10.exe' $CudaFeatures = 'nvcc_10.1 cuobjdump_10.1 nvprune_10.1 cupti_10.1 gpu_library_advisor_10.1 memcheck_10.1 ' + ` @@ -315,38 +316,6 @@ Function InstallMpi { } } -<# -.SYNOPSIS -Installs Cmake - -.DESCRIPTION -Downloads the Cmake installer located at $Url, and installs it with the -correct flags. - -.PARAMETER Url -The URL of the installer. -#> -Function InstallCmake { - Param( - [String]$Url - ) - - try { - Write-Host 'Downloading Cmake...' - [string]$msiPath = Get-TempFilePath -Extension 'msi' - curl.exe -L -o $msiPath -s -S $Url - Write-Host 'Installing Cmake...' - $args = @('/i', $msiPath, '/norestart', '/quiet', '/qn') - $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru -# $CurrentValue = [Environment]::GetEnvironmentVariable("PATH", "Machine") -# [Environment]::SetEnvironmentVariable("PATH", $CurrentValue + [System.IO.Path]::PathSeparator + "${env:ProgramFiles(x86)}\CMake\bin", "Machine") - PrintMsiExitCodeMessage $proc.ExitCode - } - catch { - Write-Error "Failed to install Cmake! $($_.Exception.Message)" - } -} - <# .SYNOPSIS Installs NVIDIA's CUDA Toolkit. @@ -464,8 +433,9 @@ Add-MPPreference -ExclusionProcess link.exe Add-MPPreference -ExclusionProcess python.exe InstallVisualStudio -Workloads $Workloads -BootstrapperUrl $VisualStudioBootstrapperUrl -Nickname 'Stable' +InstallMSI 'CMake' $CMakeUrl +InstallZip 'Ninja' $NinjaUrl 'C:\Program Files\CMake\bin' InstallMpi -Url $MpiUrl -InstallCmake -Url $CmakeUrl InstallCuda -Url $CudaUrl -Features $CudaFeatures InstallZip -Url $BinSkimUrl -Name 'BinSkim' -Dir 'C:\BinSkim' if (-Not ([string]::IsNullOrWhiteSpace($StorageAccountName))) { From 037a360af66e443d31b98b7be52569460063212c Mon Sep 17 00:00:00 2001 From: Voskrese <10104740+Voskrese@users.noreply.github.com> Date: Wed, 20 May 2020 06:03:54 +0800 Subject: [PATCH 46/46] Update provision-image.ps1 --- scripts/azure-pipelines/windows/provision-image.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/azure-pipelines/windows/provision-image.ps1 b/scripts/azure-pipelines/windows/provision-image.ps1 index 5dabc195ff70f8..1f81785a77eee7 100644 --- a/scripts/azure-pipelines/windows/provision-image.ps1 +++ b/scripts/azure-pipelines/windows/provision-image.ps1 @@ -450,3 +450,8 @@ if (-Not ([string]::IsNullOrWhiteSpace($StorageAccountKey))) { -Name StorageAccountKey ` -Value $StorageAccountKey } +Write-Host 'Updating PATH...' +$environmentKey = Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' -Name Path +Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' ` + -Name Path ` + -Value "$($environmentKey.Path);C:\Program Files\CMake\bin"