From acaca2daf9680bd9125da6e634e6ebabe411a349 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Sat, 13 Apr 2024 12:52:19 -0700 Subject: [PATCH 01/45] Behavioral simplification: Drop `testParallelism`; lit uses all CPUs by default. --- azure-devops/cmake-configure-build.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/azure-devops/cmake-configure-build.yml b/azure-devops/cmake-configure-build.yml index 441be5792ab..67efd93d7cc 100644 --- a/azure-devops/cmake-configure-build.yml +++ b/azure-devops/cmake-configure-build.yml @@ -19,21 +19,12 @@ parameters: - name: litFlags type: object default: - - '-j$(testParallelism)' - '--xunit-xml-output=$(buildOutputLocation)/test-results.xml' - '--order=lexical' - '--num-shards=$(System.TotalJobsInPhase)' - '--run-shard=$(System.JobPositionInPhase)' steps: -- task: PowerShell@2 - displayName: 'Get Test Parallelism' - timeoutInMinutes: 1 - inputs: - targetType: inline - script: | - $testParallelism = $env:NUMBER_OF_PROCESSORS - Write-Host "##vso[task.setvariable variable=testParallelism;]$testParallelism" - script: | if exist "$(buildOutputLocation)" ( rmdir /S /Q "$(buildOutputLocation)" From 6d44ededa8d9f17fc13f4707afc52829dd3c2747 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 16:13:11 -0700 Subject: [PATCH 02/45] Change `amd64` to `x64`; VsDevCmd.bat handles them as synonyms. --- azure-devops/asan-pipeline.yml | 2 +- azure-devops/cross-build.yml | 2 +- azure-devops/format-validation.yml | 6 +++--- azure-pipelines.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index f046f194053..f66556e4ee0 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -27,7 +27,7 @@ stages: - template: native-build-test.yml parameters: targetPlatform: x64 - vsDevCmdArch: amd64 + vsDevCmdArch: x64 buildBenchmarks: false asanBuild: true testSelection: ${{ variables.testSelection }} diff --git a/azure-devops/cross-build.yml b/azure-devops/cross-build.yml index c391f50424a..a3e59225e57 100644 --- a/azure-devops/cross-build.yml +++ b/azure-devops/cross-build.yml @@ -4,7 +4,7 @@ parameters: - name: hostArch type: string - default: amd64 + default: x64 - name: targetPlatform type: string - name: vsDevCmdArch diff --git a/azure-devops/format-validation.yml b/azure-devops/format-validation.yml index fa86b6b67a2..cbf762f637a 100644 --- a/azure-devops/format-validation.yml +++ b/azure-devops/format-validation.yml @@ -23,7 +23,7 @@ jobs: displayName: 'Clean after checkout' - script: | call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=amd64 -arch=amd64 -no_logo + -host_arch=x64 -arch=x64 -no_logo cmake -G Ninja -S $(Build.SourcesDirectory)/tools -B $(tmpDir)/format-validate-build cmake --build $(tmpDir)/format-validate-build displayName: 'Build format and validation' @@ -31,14 +31,14 @@ jobs: env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - script: | call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=amd64 -arch=amd64 -no_logo + -host_arch=x64 -arch=x64 -no_logo cmake --build $(tmpDir)/format-validate-build --target run-format displayName: 'clang-format Files' timeoutInMinutes: 5 env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - script: | call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=amd64 -arch=amd64 -no_logo + -host_arch=x64 -arch=x64 -no_logo cmake --build $(tmpDir)/format-validate-build --target run-validate displayName: 'Validate Files' timeoutInMinutes: 2 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1ff09dfdc66..1ddaaa450e8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,7 +28,7 @@ stages: - template: azure-devops/native-build-test.yml parameters: targetPlatform: x64 - vsDevCmdArch: amd64 + vsDevCmdArch: x64 - stage: Build_And_Test_x86 dependsOn: Build_And_Test_x64 From 17a8870fd44509d5588c6c556c6cffe6934d92e2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 16:21:26 -0700 Subject: [PATCH 03/45] In cross-build.yml, rename `vsDevCmdArch` to `targetArch`. This matches how it's being passed to cmake-configure-build.yml and run-tests.yml. --- azure-devops/cross-build.yml | 6 +++--- azure-pipelines.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-devops/cross-build.yml b/azure-devops/cross-build.yml index a3e59225e57..bea8bd8edad 100644 --- a/azure-devops/cross-build.yml +++ b/azure-devops/cross-build.yml @@ -7,7 +7,7 @@ parameters: default: x64 - name: targetPlatform type: string -- name: vsDevCmdArch +- name: targetArch type: string - name: buildBenchmarks type: boolean @@ -31,14 +31,14 @@ jobs: parameters: targetPlatform: ${{ parameters.targetPlatform }} hostArch: ${{ parameters.hostArch }} - targetArch: ${{ parameters.vsDevCmdArch }} + targetArch: ${{ parameters.targetArch }} cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' buildBenchmarks: ${{ parameters.buildBenchmarks }} - template: run-tests.yml parameters: hostArch: ${{ parameters.hostArch }} targetPlatform: ${{ parameters.targetPlatform }} - targetArch: ${{ parameters.vsDevCmdArch }} + targetArch: ${{ parameters.targetArch }} displayName: 'Build Tests' # Exclude "stlasan" test (we don't yet support ASAN on ARM or ARM64) testSelection: '-E stlasan' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1ddaaa450e8..8f7ecce9cbf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -52,7 +52,7 @@ stages: - template: azure-devops/cross-build.yml parameters: targetPlatform: arm - vsDevCmdArch: arm + targetArch: arm buildBenchmarks: false - stage: Build_ARM64 @@ -65,4 +65,4 @@ stages: - template: azure-devops/cross-build.yml parameters: targetPlatform: arm64 - vsDevCmdArch: arm64 + targetArch: arm64 From a49383e88bc0851e786d61c895328783f01a902a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 16:39:44 -0700 Subject: [PATCH 04/45] In native-build-test.yml, split `vsDevCmdArch` into `hostArch` and `targetArch`. This matches what's being passed to cmake-configure-build.yml and run-tests.yml. --- azure-devops/asan-pipeline.yml | 6 ++++-- azure-devops/native-build-test.yml | 12 +++++++----- azure-pipelines.yml | 6 ++++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index f66556e4ee0..8d53b42a9cc 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -27,7 +27,8 @@ stages: - template: native-build-test.yml parameters: targetPlatform: x64 - vsDevCmdArch: x64 + hostArch: x64 + targetArch: x64 buildBenchmarks: false asanBuild: true testSelection: ${{ variables.testSelection }} @@ -42,7 +43,8 @@ stages: - template: native-build-test.yml parameters: targetPlatform: x86 - vsDevCmdArch: x86 + hostArch: x86 + targetArch: x86 buildBenchmarks: false asanBuild: true testSelection: ${{ variables.testSelection }} diff --git a/azure-devops/native-build-test.yml b/azure-devops/native-build-test.yml index 3c31da597cc..b12504781c8 100644 --- a/azure-devops/native-build-test.yml +++ b/azure-devops/native-build-test.yml @@ -4,7 +4,9 @@ parameters: - name: targetPlatform type: string -- name: vsDevCmdArch +- name: hostArch + type: string +- name: targetArch type: string - name: buildBenchmarks type: boolean @@ -35,13 +37,13 @@ jobs: - template: cmake-configure-build.yml parameters: targetPlatform: ${{ parameters.targetPlatform }} - targetArch: ${{ parameters.vsDevCmdArch }} - hostArch: ${{ parameters.vsDevCmdArch }} + targetArch: ${{ parameters.targetArch }} + hostArch: ${{ parameters.hostArch }} buildBenchmarks: ${{ parameters.buildBenchmarks }} asanBuild: ${{ parameters.asanBuild }} - template: run-tests.yml parameters: - hostArch: ${{ parameters.vsDevCmdArch }} + hostArch: ${{ parameters.hostArch }} targetPlatform: ${{ parameters.targetPlatform }} - targetArch: ${{ parameters.vsDevCmdArch }} + targetArch: ${{ parameters.targetArch }} testSelection: ${{ parameters.testSelection }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8f7ecce9cbf..aa19dbdc03c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,7 +28,8 @@ stages: - template: azure-devops/native-build-test.yml parameters: targetPlatform: x64 - vsDevCmdArch: x64 + hostArch: x64 + targetArch: x64 - stage: Build_And_Test_x86 dependsOn: Build_And_Test_x64 @@ -40,7 +41,8 @@ stages: - template: azure-devops/native-build-test.yml parameters: targetPlatform: x86 - vsDevCmdArch: x86 + hostArch: x86 + targetArch: x86 - stage: Build_ARM dependsOn: Build_And_Test_x64 From 20f8645b65122312eff4de379bb0da1c92b133e2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 16:44:06 -0700 Subject: [PATCH 05/45] Explicitly pass `hostArch: x64` to cross-build.yml. --- azure-devops/cross-build.yml | 1 - azure-pipelines.yml | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-devops/cross-build.yml b/azure-devops/cross-build.yml index bea8bd8edad..c28de994b72 100644 --- a/azure-devops/cross-build.yml +++ b/azure-devops/cross-build.yml @@ -4,7 +4,6 @@ parameters: - name: hostArch type: string - default: x64 - name: targetPlatform type: string - name: targetArch diff --git a/azure-pipelines.yml b/azure-pipelines.yml index aa19dbdc03c..fabafeb2f2f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -54,6 +54,7 @@ stages: - template: azure-devops/cross-build.yml parameters: targetPlatform: arm + hostArch: x64 targetArch: arm buildBenchmarks: false @@ -67,4 +68,5 @@ stages: - template: azure-devops/cross-build.yml parameters: targetPlatform: arm64 + hostArch: x64 targetArch: arm64 From 6d0860a745349b7ea3ecb7b8a1f08a26a9fd365e Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 16:50:11 -0700 Subject: [PATCH 06/45] Unify away `targetPlatform`; it was identical to `targetArch`. --- azure-devops/asan-pipeline.yml | 2 -- azure-devops/cmake-configure-build.yml | 2 -- azure-devops/cross-build.yml | 6 +----- azure-devops/native-build-test.yml | 6 +----- azure-devops/run-tests.yml | 6 ++---- azure-pipelines.yml | 4 ---- 6 files changed, 4 insertions(+), 22 deletions(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index 8d53b42a9cc..9405426076f 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -26,7 +26,6 @@ stages: jobs: - template: native-build-test.yml parameters: - targetPlatform: x64 hostArch: x64 targetArch: x64 buildBenchmarks: false @@ -42,7 +41,6 @@ stages: jobs: - template: native-build-test.yml parameters: - targetPlatform: x86 hostArch: x86 targetArch: x86 buildBenchmarks: false diff --git a/azure-devops/cmake-configure-build.yml b/azure-devops/cmake-configure-build.yml index 67efd93d7cc..c54a44280ba 100644 --- a/azure-devops/cmake-configure-build.yml +++ b/azure-devops/cmake-configure-build.yml @@ -6,8 +6,6 @@ parameters: type: string - name: targetArch type: string -- name: targetPlatform - type: string - name: buildBenchmarks type: boolean - name: asanBuild diff --git a/azure-devops/cross-build.yml b/azure-devops/cross-build.yml index c28de994b72..c7bdc290f3e 100644 --- a/azure-devops/cross-build.yml +++ b/azure-devops/cross-build.yml @@ -4,8 +4,6 @@ parameters: - name: hostArch type: string -- name: targetPlatform - type: string - name: targetArch type: string - name: buildBenchmarks @@ -15,7 +13,7 @@ parameters: type: number default: 8 jobs: -- job: '${{ parameters.targetPlatform }}' +- job: '${{ parameters.targetArch }}' strategy: parallel: ${{ parameters.numShards }} timeoutInMinutes: 30 @@ -28,7 +26,6 @@ jobs: - template: checkout-sources.yml - template: cmake-configure-build.yml parameters: - targetPlatform: ${{ parameters.targetPlatform }} hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' @@ -36,7 +33,6 @@ jobs: - template: run-tests.yml parameters: hostArch: ${{ parameters.hostArch }} - targetPlatform: ${{ parameters.targetPlatform }} targetArch: ${{ parameters.targetArch }} displayName: 'Build Tests' # Exclude "stlasan" test (we don't yet support ASAN on ARM or ARM64) diff --git a/azure-devops/native-build-test.yml b/azure-devops/native-build-test.yml index b12504781c8..9f382b34e8f 100644 --- a/azure-devops/native-build-test.yml +++ b/azure-devops/native-build-test.yml @@ -2,8 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception parameters: -- name: targetPlatform - type: string - name: hostArch type: string - name: targetArch @@ -23,7 +21,7 @@ parameters: # Exclude "stlasan" test by default default: '-E stlasan' jobs: -- job: '${{ parameters.targetPlatform }}' +- job: '${{ parameters.targetArch }}' strategy: parallel: ${{ parameters.numShards }} timeoutInMinutes: 30 @@ -36,7 +34,6 @@ jobs: - template: checkout-sources.yml - template: cmake-configure-build.yml parameters: - targetPlatform: ${{ parameters.targetPlatform }} targetArch: ${{ parameters.targetArch }} hostArch: ${{ parameters.hostArch }} buildBenchmarks: ${{ parameters.buildBenchmarks }} @@ -44,6 +41,5 @@ jobs: - template: run-tests.yml parameters: hostArch: ${{ parameters.hostArch }} - targetPlatform: ${{ parameters.targetPlatform }} targetArch: ${{ parameters.targetArch }} testSelection: ${{ parameters.testSelection }} diff --git a/azure-devops/run-tests.yml b/azure-devops/run-tests.yml index 32aa742c1bd..a077d55c629 100644 --- a/azure-devops/run-tests.yml +++ b/azure-devops/run-tests.yml @@ -2,8 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception parameters: -- name: targetPlatform - type: string - name: hostArch type: string - name: targetArch @@ -34,8 +32,8 @@ steps: searchFolder: $(buildOutputLocation) testResultsFormat: JUnit testResultsFiles: '**/test-results.xml' - testRunTitle: 'test-${{ parameters.targetPlatform }}-$(System.JobPositionInPhase)' + testRunTitle: 'test-${{ parameters.targetArch }}-$(System.JobPositionInPhase)' - publish: $(buildOutputLocation)/test-results.xml - artifact: '${{ parameters.targetPlatform }}-$(System.JobPositionInPhase)-xml-$(System.JobId)' + artifact: '${{ parameters.targetArch }}-$(System.JobPositionInPhase)-xml-$(System.JobId)' condition: failed() displayName: 'Publish XML Artifact' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fabafeb2f2f..998164abf46 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,7 +27,6 @@ stages: jobs: - template: azure-devops/native-build-test.yml parameters: - targetPlatform: x64 hostArch: x64 targetArch: x64 @@ -40,7 +39,6 @@ stages: jobs: - template: azure-devops/native-build-test.yml parameters: - targetPlatform: x86 hostArch: x86 targetArch: x86 @@ -53,7 +51,6 @@ stages: jobs: - template: azure-devops/cross-build.yml parameters: - targetPlatform: arm hostArch: x64 targetArch: arm buildBenchmarks: false @@ -67,6 +64,5 @@ stages: jobs: - template: azure-devops/cross-build.yml parameters: - targetPlatform: arm64 hostArch: x64 targetArch: arm64 From 6da00b1a60e46633e3a3e4bb6dde1ade988b247b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 16:54:53 -0700 Subject: [PATCH 07/45] Consistently order `hostArch` before `targetArch`. --- azure-devops/native-build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-devops/native-build-test.yml b/azure-devops/native-build-test.yml index 9f382b34e8f..281541391e5 100644 --- a/azure-devops/native-build-test.yml +++ b/azure-devops/native-build-test.yml @@ -34,8 +34,8 @@ jobs: - template: checkout-sources.yml - template: cmake-configure-build.yml parameters: - targetArch: ${{ parameters.targetArch }} hostArch: ${{ parameters.hostArch }} + targetArch: ${{ parameters.targetArch }} buildBenchmarks: ${{ parameters.buildBenchmarks }} asanBuild: ${{ parameters.asanBuild }} - template: run-tests.yml From 46ce7ad6f51b693355d97b2011ebac45ee1e5e6d Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 17:08:42 -0700 Subject: [PATCH 08/45] Cosmetic change: Unify 'Build Tests' and 'Run Tests' into 'Build and Run Tests'. Spending logic to vary the `displayName` is unnecessary, especially because we already distinguish 'Build and Test x64' vs. 'Build ARM64' at the top level. --- azure-devops/cross-build.yml | 1 - azure-devops/run-tests.yml | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/azure-devops/cross-build.yml b/azure-devops/cross-build.yml index c7bdc290f3e..86257ea01ee 100644 --- a/azure-devops/cross-build.yml +++ b/azure-devops/cross-build.yml @@ -34,6 +34,5 @@ jobs: parameters: hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} - displayName: 'Build Tests' # Exclude "stlasan" test (we don't yet support ASAN on ARM or ARM64) testSelection: '-E stlasan' diff --git a/azure-devops/run-tests.yml b/azure-devops/run-tests.yml index a077d55c629..033de448f7d 100644 --- a/azure-devops/run-tests.yml +++ b/azure-devops/run-tests.yml @@ -6,15 +6,12 @@ parameters: type: string - name: targetArch type: string -- name: displayName - type: string - default: 'Run Tests' # Parameters to pass to ctest to select the test(s) to run - name: testSelection type: string steps: - task: CmdLine@2 - displayName: ${{ parameters.displayName }} + displayName: 'Build and Run Tests' timeoutInMinutes: 30 condition: succeeded() inputs: From 4881ae7a344e0bb505d2d9d7a57fb0d05fd57c76 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 20:26:12 -0700 Subject: [PATCH 09/45] Use long-form ctest options for clarity. --- azure-devops/asan-pipeline.yml | 2 +- azure-devops/cross-build.yml | 2 +- azure-devops/native-build-test.yml | 2 +- azure-devops/run-tests.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index 9405426076f..bb08d205bf9 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -6,7 +6,7 @@ variables: - template: config.yml - name: testSelection - value: '-R stlasan' # Restrict to "stlasan" test + value: '--tests-regex stlasan' # Restrict to "stlasan" test trigger: none diff --git a/azure-devops/cross-build.yml b/azure-devops/cross-build.yml index 86257ea01ee..8ab10861477 100644 --- a/azure-devops/cross-build.yml +++ b/azure-devops/cross-build.yml @@ -35,4 +35,4 @@ jobs: hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} # Exclude "stlasan" test (we don't yet support ASAN on ARM or ARM64) - testSelection: '-E stlasan' + testSelection: '--exclude-regex stlasan' diff --git a/azure-devops/native-build-test.yml b/azure-devops/native-build-test.yml index 281541391e5..2708f509829 100644 --- a/azure-devops/native-build-test.yml +++ b/azure-devops/native-build-test.yml @@ -19,7 +19,7 @@ parameters: - name: testSelection type: string # Exclude "stlasan" test by default - default: '-E stlasan' + default: '--exclude-regex stlasan' jobs: - job: '${{ parameters.targetArch }}' strategy: diff --git a/azure-devops/run-tests.yml b/azure-devops/run-tests.yml index 033de448f7d..28435e3d4e5 100644 --- a/azure-devops/run-tests.yml +++ b/azure-devops/run-tests.yml @@ -19,7 +19,7 @@ steps: script: | call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo - ctest -V ${{ parameters.testSelection }} + ctest --verbose ${{ parameters.testSelection }} env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - task: PublishTestResults@2 displayName: 'Publish Tests' From 0952e229a362ea48ae8cdeb31aaa4ed0614f5400 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 20:28:40 -0700 Subject: [PATCH 10/45] Rename `testSelection` to `ctestOptions`. This clarifies who the ultimate consumer is. --- azure-devops/asan-pipeline.yml | 6 +++--- azure-devops/cross-build.yml | 2 +- azure-devops/native-build-test.yml | 4 ++-- azure-devops/run-tests.yml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index bb08d205bf9..84f7a9fc9dd 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -5,7 +5,7 @@ variables: - template: config.yml - - name: testSelection + - name: ctestOptions value: '--tests-regex stlasan' # Restrict to "stlasan" test trigger: none @@ -30,7 +30,7 @@ stages: targetArch: x64 buildBenchmarks: false asanBuild: true - testSelection: ${{ variables.testSelection }} + ctestOptions: ${{ variables.ctestOptions }} - stage: Build_And_Test_x86 displayName: 'Build and Test x86' @@ -45,6 +45,6 @@ stages: targetArch: x86 buildBenchmarks: false asanBuild: true - testSelection: ${{ variables.testSelection }} + ctestOptions: ${{ variables.ctestOptions }} # no coverage for ARM and ARM64 diff --git a/azure-devops/cross-build.yml b/azure-devops/cross-build.yml index 8ab10861477..d2dd043864d 100644 --- a/azure-devops/cross-build.yml +++ b/azure-devops/cross-build.yml @@ -35,4 +35,4 @@ jobs: hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} # Exclude "stlasan" test (we don't yet support ASAN on ARM or ARM64) - testSelection: '--exclude-regex stlasan' + ctestOptions: '--exclude-regex stlasan' diff --git a/azure-devops/native-build-test.yml b/azure-devops/native-build-test.yml index 2708f509829..bd9801c82ff 100644 --- a/azure-devops/native-build-test.yml +++ b/azure-devops/native-build-test.yml @@ -16,7 +16,7 @@ parameters: type: number default: 8 # Parameters to pass to ctest to select the test(s) to run -- name: testSelection +- name: ctestOptions type: string # Exclude "stlasan" test by default default: '--exclude-regex stlasan' @@ -42,4 +42,4 @@ jobs: parameters: hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} - testSelection: ${{ parameters.testSelection }} + ctestOptions: ${{ parameters.ctestOptions }} diff --git a/azure-devops/run-tests.yml b/azure-devops/run-tests.yml index 28435e3d4e5..b65f00942ee 100644 --- a/azure-devops/run-tests.yml +++ b/azure-devops/run-tests.yml @@ -7,7 +7,7 @@ parameters: - name: targetArch type: string # Parameters to pass to ctest to select the test(s) to run -- name: testSelection +- name: ctestOptions type: string steps: - task: CmdLine@2 @@ -19,7 +19,7 @@ steps: script: | call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo - ctest --verbose ${{ parameters.testSelection }} + ctest --verbose ${{ parameters.ctestOptions }} env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - task: PublishTestResults@2 displayName: 'Publish Tests' From bf6ebf2c083d06e06ab91afebc7f2b2824cc3c0f Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 20:34:38 -0700 Subject: [PATCH 11/45] Drop unnecessary comments. --- azure-devops/asan-pipeline.yml | 2 +- azure-devops/cross-build.yml | 1 - azure-devops/native-build-test.yml | 2 -- azure-devops/run-tests.yml | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index 84f7a9fc9dd..831d7592bd1 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -6,7 +6,7 @@ variables: - template: config.yml - name: ctestOptions - value: '--tests-regex stlasan' # Restrict to "stlasan" test + value: '--tests-regex stlasan' trigger: none diff --git a/azure-devops/cross-build.yml b/azure-devops/cross-build.yml index d2dd043864d..95639015ba1 100644 --- a/azure-devops/cross-build.yml +++ b/azure-devops/cross-build.yml @@ -34,5 +34,4 @@ jobs: parameters: hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} - # Exclude "stlasan" test (we don't yet support ASAN on ARM or ARM64) ctestOptions: '--exclude-regex stlasan' diff --git a/azure-devops/native-build-test.yml b/azure-devops/native-build-test.yml index bd9801c82ff..0cd3487abb2 100644 --- a/azure-devops/native-build-test.yml +++ b/azure-devops/native-build-test.yml @@ -15,10 +15,8 @@ parameters: - name: numShards type: number default: 8 - # Parameters to pass to ctest to select the test(s) to run - name: ctestOptions type: string - # Exclude "stlasan" test by default default: '--exclude-regex stlasan' jobs: - job: '${{ parameters.targetArch }}' diff --git a/azure-devops/run-tests.yml b/azure-devops/run-tests.yml index b65f00942ee..9f7e799c1c6 100644 --- a/azure-devops/run-tests.yml +++ b/azure-devops/run-tests.yml @@ -6,7 +6,6 @@ parameters: type: string - name: targetArch type: string - # Parameters to pass to ctest to select the test(s) to run - name: ctestOptions type: string steps: From 7fe629d0757240beb1c21447c34faa16424ce6f7 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 20:46:54 -0700 Subject: [PATCH 12/45] In cross-build.yml, change hardcoded `ctestOptions` to a parameter with a default argument. This is more complicated, but it's a step towards unification. --- azure-devops/cross-build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/azure-devops/cross-build.yml b/azure-devops/cross-build.yml index 95639015ba1..f2751694c1e 100644 --- a/azure-devops/cross-build.yml +++ b/azure-devops/cross-build.yml @@ -12,6 +12,9 @@ parameters: - name: numShards type: number default: 8 +- name: ctestOptions + type: string + default: '--exclude-regex stlasan' jobs: - job: '${{ parameters.targetArch }}' strategy: @@ -34,4 +37,4 @@ jobs: parameters: hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} - ctestOptions: '--exclude-regex stlasan' + ctestOptions: ${{ parameters.ctestOptions }} From 693e9eb0ea97aaf581c87d18fa79a7bba43f0b83 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 20:52:37 -0700 Subject: [PATCH 13/45] In asan-pipeline.yml, don't bother centralizing `'--tests-regex stlasan'` into a variable. IMO this extra step was making things harder to follow. --- azure-devops/asan-pipeline.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index 831d7592bd1..a957883ac02 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -5,8 +5,6 @@ variables: - template: config.yml - - name: ctestOptions - value: '--tests-regex stlasan' trigger: none @@ -30,7 +28,7 @@ stages: targetArch: x64 buildBenchmarks: false asanBuild: true - ctestOptions: ${{ variables.ctestOptions }} + ctestOptions: '--tests-regex stlasan' - stage: Build_And_Test_x86 displayName: 'Build and Test x86' @@ -45,6 +43,6 @@ stages: targetArch: x86 buildBenchmarks: false asanBuild: true - ctestOptions: ${{ variables.ctestOptions }} + ctestOptions: '--tests-regex stlasan' # no coverage for ARM and ARM64 From 40172416a9f09fdcd970db0995ef7080a9e6ceb2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 20:59:19 -0700 Subject: [PATCH 14/45] In cross-build.yml, take `asanBuild` as a parameter with a default argument. Again, this is a step towards unification. This makes a clarity improvement possible - now we can remove the `asanBuild` default argument from cmake-configure-build.yml. IMO having defaults at different "levels" was very confusing. --- azure-devops/cmake-configure-build.yml | 1 - azure-devops/cross-build.yml | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/azure-devops/cmake-configure-build.yml b/azure-devops/cmake-configure-build.yml index c54a44280ba..a4691793428 100644 --- a/azure-devops/cmake-configure-build.yml +++ b/azure-devops/cmake-configure-build.yml @@ -10,7 +10,6 @@ parameters: type: boolean - name: asanBuild type: boolean - default: false - name: cmakeAdditionalFlags type: string default: '' diff --git a/azure-devops/cross-build.yml b/azure-devops/cross-build.yml index f2751694c1e..7399a2d9bb8 100644 --- a/azure-devops/cross-build.yml +++ b/azure-devops/cross-build.yml @@ -9,6 +9,9 @@ parameters: - name: buildBenchmarks type: boolean default: true +- name: asanBuild + type: boolean + default: false - name: numShards type: number default: 8 @@ -33,6 +36,7 @@ jobs: targetArch: ${{ parameters.targetArch }} cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' buildBenchmarks: ${{ parameters.buildBenchmarks }} + asanBuild: ${{ parameters.asanBuild }} - template: run-tests.yml parameters: hostArch: ${{ parameters.hostArch }} From c5fb8fd38f0ceddd582bdb37e3888dd6d75038a0 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 21:16:30 -0700 Subject: [PATCH 15/45] Change how `cmakeAdditionalFlags` is defaulted. Clarity improvement: Don't default it at the cmake-configure-build.yml level. Both native-build-test.yml and cross-build.yml now take it as a parameter, defaulting to empty, and pass it down. Finally, azure-pipelines.yml passes `cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON'` when performing cross builds. This is the final step towards unification. --- azure-devops/cmake-configure-build.yml | 1 - azure-devops/cross-build.yml | 5 ++++- azure-devops/native-build-test.yml | 4 ++++ azure-pipelines.yml | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/azure-devops/cmake-configure-build.yml b/azure-devops/cmake-configure-build.yml index a4691793428..f1744ce7f22 100644 --- a/azure-devops/cmake-configure-build.yml +++ b/azure-devops/cmake-configure-build.yml @@ -12,7 +12,6 @@ parameters: type: boolean - name: cmakeAdditionalFlags type: string - default: '' - name: litFlags type: object default: diff --git a/azure-devops/cross-build.yml b/azure-devops/cross-build.yml index 7399a2d9bb8..c6b939d68cd 100644 --- a/azure-devops/cross-build.yml +++ b/azure-devops/cross-build.yml @@ -12,6 +12,9 @@ parameters: - name: asanBuild type: boolean default: false +- name: cmakeAdditionalFlags + type: string + default: '' - name: numShards type: number default: 8 @@ -34,7 +37,7 @@ jobs: parameters: hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} - cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' + cmakeAdditionalFlags: ${{ parameters.cmakeAdditionalFlags }} buildBenchmarks: ${{ parameters.buildBenchmarks }} asanBuild: ${{ parameters.asanBuild }} - template: run-tests.yml diff --git a/azure-devops/native-build-test.yml b/azure-devops/native-build-test.yml index 0cd3487abb2..c6b939d68cd 100644 --- a/azure-devops/native-build-test.yml +++ b/azure-devops/native-build-test.yml @@ -12,6 +12,9 @@ parameters: - name: asanBuild type: boolean default: false +- name: cmakeAdditionalFlags + type: string + default: '' - name: numShards type: number default: 8 @@ -34,6 +37,7 @@ jobs: parameters: hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} + cmakeAdditionalFlags: ${{ parameters.cmakeAdditionalFlags }} buildBenchmarks: ${{ parameters.buildBenchmarks }} asanBuild: ${{ parameters.asanBuild }} - template: run-tests.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 998164abf46..4019d0ad671 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -54,6 +54,7 @@ stages: hostArch: x64 targetArch: arm buildBenchmarks: false + cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' - stage: Build_ARM64 dependsOn: Build_And_Test_x64 @@ -66,3 +67,4 @@ stages: parameters: hostArch: x64 targetArch: arm64 + cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' From 5b9207435405383f16e9c0f2a5857567da72554b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 21:26:07 -0700 Subject: [PATCH 16/45] Unify (identical) native-build-test.yml and cross-build.yml into build-and-test.yml. Saying "and" in the name clarifies that we're doing two separate things. --- azure-devops/asan-pipeline.yml | 4 +- .../{cross-build.yml => build-and-test.yml} | 0 azure-devops/native-build-test.yml | 47 ------------------- azure-pipelines.yml | 8 ++-- 4 files changed, 6 insertions(+), 53 deletions(-) rename azure-devops/{cross-build.yml => build-and-test.yml} (100%) delete mode 100644 azure-devops/native-build-test.yml diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index a957883ac02..4103ae9935b 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -22,7 +22,7 @@ stages: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} jobs: - - template: native-build-test.yml + - template: build-and-test.yml parameters: hostArch: x64 targetArch: x64 @@ -37,7 +37,7 @@ stages: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} jobs: - - template: native-build-test.yml + - template: build-and-test.yml parameters: hostArch: x86 targetArch: x86 diff --git a/azure-devops/cross-build.yml b/azure-devops/build-and-test.yml similarity index 100% rename from azure-devops/cross-build.yml rename to azure-devops/build-and-test.yml diff --git a/azure-devops/native-build-test.yml b/azure-devops/native-build-test.yml deleted file mode 100644 index c6b939d68cd..00000000000 --- a/azure-devops/native-build-test.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -parameters: -- name: hostArch - type: string -- name: targetArch - type: string -- name: buildBenchmarks - type: boolean - default: true -- name: asanBuild - type: boolean - default: false -- name: cmakeAdditionalFlags - type: string - default: '' -- name: numShards - type: number - default: 8 -- name: ctestOptions - type: string - default: '--exclude-regex stlasan' -jobs: -- job: '${{ parameters.targetArch }}' - strategy: - parallel: ${{ parameters.numShards }} - timeoutInMinutes: 30 - steps: - - script: | - if exist "$(tmpDir)" (rmdir /S /Q $(tmpDir)) - mkdir $(tmpDir) - displayName: 'Setup TMP Directory' - - - template: checkout-sources.yml - - template: cmake-configure-build.yml - parameters: - hostArch: ${{ parameters.hostArch }} - targetArch: ${{ parameters.targetArch }} - cmakeAdditionalFlags: ${{ parameters.cmakeAdditionalFlags }} - buildBenchmarks: ${{ parameters.buildBenchmarks }} - asanBuild: ${{ parameters.asanBuild }} - - template: run-tests.yml - parameters: - hostArch: ${{ parameters.hostArch }} - targetArch: ${{ parameters.targetArch }} - ctestOptions: ${{ parameters.ctestOptions }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4019d0ad671..04f2bb09f72 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -25,7 +25,7 @@ stages: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} jobs: - - template: azure-devops/native-build-test.yml + - template: azure-devops/build-and-test.yml parameters: hostArch: x64 targetArch: x64 @@ -37,7 +37,7 @@ stages: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} jobs: - - template: azure-devops/native-build-test.yml + - template: azure-devops/build-and-test.yml parameters: hostArch: x86 targetArch: x86 @@ -49,7 +49,7 @@ stages: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} jobs: - - template: azure-devops/cross-build.yml + - template: azure-devops/build-and-test.yml parameters: hostArch: x64 targetArch: arm @@ -63,7 +63,7 @@ stages: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} jobs: - - template: azure-devops/cross-build.yml + - template: azure-devops/build-and-test.yml parameters: hostArch: x64 targetArch: arm64 From e0af61cd3649e0a12a9d4c6a986cb92a0c744c8a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 21:42:32 -0700 Subject: [PATCH 17/45] Consistently sort parameters after `hostArch`, `targetArch`. --- azure-devops/asan-pipeline.yml | 4 ++-- azure-devops/build-and-test.yml | 16 ++++++++-------- azure-devops/cmake-configure-build.yml | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index 4103ae9935b..aa9d6136c28 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -26,8 +26,8 @@ stages: parameters: hostArch: x64 targetArch: x64 - buildBenchmarks: false asanBuild: true + buildBenchmarks: false ctestOptions: '--tests-regex stlasan' - stage: Build_And_Test_x86 @@ -41,8 +41,8 @@ stages: parameters: hostArch: x86 targetArch: x86 - buildBenchmarks: false asanBuild: true + buildBenchmarks: false ctestOptions: '--tests-regex stlasan' # no coverage for ARM and ARM64 diff --git a/azure-devops/build-and-test.yml b/azure-devops/build-and-test.yml index c6b939d68cd..777b46b4930 100644 --- a/azure-devops/build-and-test.yml +++ b/azure-devops/build-and-test.yml @@ -6,21 +6,21 @@ parameters: type: string - name: targetArch type: string -- name: buildBenchmarks - type: boolean - default: true - name: asanBuild type: boolean default: false +- name: buildBenchmarks + type: boolean + default: true - name: cmakeAdditionalFlags type: string default: '' -- name: numShards - type: number - default: 8 - name: ctestOptions type: string default: '--exclude-regex stlasan' +- name: numShards + type: number + default: 8 jobs: - job: '${{ parameters.targetArch }}' strategy: @@ -37,9 +37,9 @@ jobs: parameters: hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} - cmakeAdditionalFlags: ${{ parameters.cmakeAdditionalFlags }} - buildBenchmarks: ${{ parameters.buildBenchmarks }} asanBuild: ${{ parameters.asanBuild }} + buildBenchmarks: ${{ parameters.buildBenchmarks }} + cmakeAdditionalFlags: ${{ parameters.cmakeAdditionalFlags }} - template: run-tests.yml parameters: hostArch: ${{ parameters.hostArch }} diff --git a/azure-devops/cmake-configure-build.yml b/azure-devops/cmake-configure-build.yml index f1744ce7f22..56be1d38b1f 100644 --- a/azure-devops/cmake-configure-build.yml +++ b/azure-devops/cmake-configure-build.yml @@ -6,10 +6,10 @@ parameters: type: string - name: targetArch type: string -- name: buildBenchmarks - type: boolean - name: asanBuild type: boolean +- name: buildBenchmarks + type: boolean - name: cmakeAdditionalFlags type: string - name: litFlags From e49a3e26294b854eadf953c69344985b5f95c221 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 21:54:49 -0700 Subject: [PATCH 18/45] Change the `buildBenchmarks` default from `true` to `false`. --- azure-devops/asan-pipeline.yml | 2 -- azure-devops/build-and-test.yml | 2 +- azure-pipelines.yml | 4 +++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index aa9d6136c28..5107cd41b4a 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -27,7 +27,6 @@ stages: hostArch: x64 targetArch: x64 asanBuild: true - buildBenchmarks: false ctestOptions: '--tests-regex stlasan' - stage: Build_And_Test_x86 @@ -42,7 +41,6 @@ stages: hostArch: x86 targetArch: x86 asanBuild: true - buildBenchmarks: false ctestOptions: '--tests-regex stlasan' # no coverage for ARM and ARM64 diff --git a/azure-devops/build-and-test.yml b/azure-devops/build-and-test.yml index 777b46b4930..abdf94aa973 100644 --- a/azure-devops/build-and-test.yml +++ b/azure-devops/build-and-test.yml @@ -11,7 +11,7 @@ parameters: default: false - name: buildBenchmarks type: boolean - default: true + default: false - name: cmakeAdditionalFlags type: string default: '' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 04f2bb09f72..bdcb235fe2b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,6 +29,7 @@ stages: parameters: hostArch: x64 targetArch: x64 + buildBenchmarks: true - stage: Build_And_Test_x86 dependsOn: Build_And_Test_x64 @@ -41,6 +42,7 @@ stages: parameters: hostArch: x86 targetArch: x86 + buildBenchmarks: true - stage: Build_ARM dependsOn: Build_And_Test_x64 @@ -53,7 +55,6 @@ stages: parameters: hostArch: x64 targetArch: arm - buildBenchmarks: false cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' - stage: Build_ARM64 @@ -67,4 +68,5 @@ stages: parameters: hostArch: x64 targetArch: arm64 + buildBenchmarks: true cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' From 5606102257913dd3a0ae715a81170d540b042f4a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 23:45:59 -0700 Subject: [PATCH 19/45] Consistently capitalize the `PowerShell@2` task. --- azure-devops/format-validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-devops/format-validation.yml b/azure-devops/format-validation.yml index cbf762f637a..62f7ded5794 100644 --- a/azure-devops/format-validation.yml +++ b/azure-devops/format-validation.yml @@ -43,7 +43,7 @@ jobs: displayName: 'Validate Files' timeoutInMinutes: 2 env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - - task: Powershell@2 + - task: PowerShell@2 displayName: 'Create Diff' inputs: filePath: azure-devops/create-prdiff.ps1 From 5c5ce7a53473404c9d0d74e27e3d96aaaa67066b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 23:47:36 -0700 Subject: [PATCH 20/45] Drop unnecessary `pwsh: false`. This is the default on Windows. See: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/powershell-v2?view=azure-pipelines --- azure-devops/format-validation.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-devops/format-validation.yml b/azure-devops/format-validation.yml index 62f7ded5794..95a167ed203 100644 --- a/azure-devops/format-validation.yml +++ b/azure-devops/format-validation.yml @@ -47,6 +47,5 @@ jobs: displayName: 'Create Diff' inputs: filePath: azure-devops/create-prdiff.ps1 - pwsh: false condition: succeededOrFailed() env: { TMP: $(tmpDir), TEMP: $(tmpDir) } From c3b09a12abd207bfc495e60275bc1fd1d8c5f44d Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 15 Apr 2024 23:57:17 -0700 Subject: [PATCH 21/45] Simplify `task: CmdLine@2` to the `script:` shortcut. We use this everywhere else. Docs: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/cmd-line-v2?view=azure-pipelines#remarks https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/steps-script?view=azure-pipelines --- azure-devops/run-tests.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/azure-devops/run-tests.yml b/azure-devops/run-tests.yml index 9f7e799c1c6..f597b9d137c 100644 --- a/azure-devops/run-tests.yml +++ b/azure-devops/run-tests.yml @@ -9,16 +9,14 @@ parameters: - name: ctestOptions type: string steps: -- task: CmdLine@2 +- script: | + call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ + -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo + ctest --verbose ${{ parameters.ctestOptions }} displayName: 'Build and Run Tests' timeoutInMinutes: 30 condition: succeeded() - inputs: - workingDirectory: $(buildOutputLocation) - script: | - call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo - ctest --verbose ${{ parameters.ctestOptions }} + workingDirectory: $(buildOutputLocation) env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - task: PublishTestResults@2 displayName: 'Publish Tests' From e41ddcaeefc2301b2f315ecc5b21262158554536 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 12:23:20 -0700 Subject: [PATCH 22/45] Add parameter `analyzeBuild` to control `STL_USE_ANALYZE`. Originally hardcoded to `ON`, now defaulted to `true`. (These are synonyms to CMake.) --- azure-devops/build-and-test.yml | 4 ++++ azure-devops/cmake-configure-build.yml | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/azure-devops/build-and-test.yml b/azure-devops/build-and-test.yml index abdf94aa973..6a4adc9a8e7 100644 --- a/azure-devops/build-and-test.yml +++ b/azure-devops/build-and-test.yml @@ -6,6 +6,9 @@ parameters: type: string - name: targetArch type: string +- name: analyzeBuild + type: boolean + default: true - name: asanBuild type: boolean default: false @@ -37,6 +40,7 @@ jobs: parameters: hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} + analyzeBuild: ${{ parameters.analyzeBuild }} asanBuild: ${{ parameters.asanBuild }} buildBenchmarks: ${{ parameters.buildBenchmarks }} cmakeAdditionalFlags: ${{ parameters.cmakeAdditionalFlags }} diff --git a/azure-devops/cmake-configure-build.yml b/azure-devops/cmake-configure-build.yml index 56be1d38b1f..4c2dfd9512b 100644 --- a/azure-devops/cmake-configure-build.yml +++ b/azure-devops/cmake-configure-build.yml @@ -6,6 +6,8 @@ parameters: type: string - name: targetArch type: string +- name: analyzeBuild + type: boolean - name: asanBuild type: boolean - name: buildBenchmarks @@ -31,7 +33,7 @@ steps: -DCMAKE_CXX_COMPILER=cl ^ -DCMAKE_BUILD_TYPE=Release ^ -DLIT_FLAGS=${{ join(';', parameters.litFlags) }} ^ - -DSTL_USE_ANALYZE=ON ^ + -DSTL_USE_ANALYZE=${{ parameters.analyzeBuild }} ^ -DSTL_ASAN_BUILD=${{ parameters.asanBuild }} ^ -S $(Build.SourcesDirectory) -B "$(buildOutputLocation)" displayName: 'Configure the STL' From 92bcfb33709fa224a31271489c3d47daca4a0a6c Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 12:28:00 -0700 Subject: [PATCH 23/45] Change the `analyzeBuild` default from `true` to `false`. --- azure-devops/asan-pipeline.yml | 2 ++ azure-devops/build-and-test.yml | 2 +- azure-pipelines.yml | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index 5107cd41b4a..b683253eb5a 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -26,6 +26,7 @@ stages: parameters: hostArch: x64 targetArch: x64 + analyzeBuild: true asanBuild: true ctestOptions: '--tests-regex stlasan' @@ -40,6 +41,7 @@ stages: parameters: hostArch: x86 targetArch: x86 + analyzeBuild: true asanBuild: true ctestOptions: '--tests-regex stlasan' diff --git a/azure-devops/build-and-test.yml b/azure-devops/build-and-test.yml index 6a4adc9a8e7..290572a64c7 100644 --- a/azure-devops/build-and-test.yml +++ b/azure-devops/build-and-test.yml @@ -8,7 +8,7 @@ parameters: type: string - name: analyzeBuild type: boolean - default: true + default: false - name: asanBuild type: boolean default: false diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bdcb235fe2b..48e3868b1ff 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,6 +29,7 @@ stages: parameters: hostArch: x64 targetArch: x64 + analyzeBuild: true buildBenchmarks: true - stage: Build_And_Test_x86 @@ -42,6 +43,7 @@ stages: parameters: hostArch: x86 targetArch: x86 + analyzeBuild: true buildBenchmarks: true - stage: Build_ARM @@ -55,6 +57,7 @@ stages: parameters: hostArch: x64 targetArch: arm + analyzeBuild: true cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' - stage: Build_ARM64 @@ -68,5 +71,6 @@ stages: parameters: hostArch: x64 targetArch: arm64 + analyzeBuild: true buildBenchmarks: true cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' From d94d760b43d7be799e1b005fe653f3f7d91e839d Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 12:33:12 -0700 Subject: [PATCH 24/45] Behavior change: Don't enable `analyzeBuild` in asan-pipeline.yml. --- azure-devops/asan-pipeline.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index b683253eb5a..5107cd41b4a 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -26,7 +26,6 @@ stages: parameters: hostArch: x64 targetArch: x64 - analyzeBuild: true asanBuild: true ctestOptions: '--tests-regex stlasan' @@ -41,7 +40,6 @@ stages: parameters: hostArch: x86 targetArch: x86 - analyzeBuild: true asanBuild: true ctestOptions: '--tests-regex stlasan' From 3e33813daa4eb48b335902b50ace95fa45daf8dc Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 12:54:56 -0700 Subject: [PATCH 25/45] Simplify checkout-sources.yml by dropping unnecessary parameters. These parameters (`llvmSHAVar` etc.) were storing the names of Azure Pipelines variables to create (`llvmSHA`), confusingly sharing the same names as PowerShell variables (`$llvmSHA` etc.). This layer of indirection was unnecessary. We can take the names `llvmSHAVar` etc. and directly use them as the names of Azure Pipelines variables. --- azure-devops/checkout-sources.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-sources.yml index 76c9214700a..d3e3980d45c 100644 --- a/azure-devops/checkout-sources.yml +++ b/azure-devops/checkout-sources.yml @@ -1,16 +1,6 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -parameters: -- name: llvmSHAVar - type: string - default: llvmSHA -- name: boostMathSHAVar - type: string - default: boostMathSHA -- name: googleBenchmarkSHAVar - type: string - default: googleBenchmarkSHA steps: - checkout: self clean: true @@ -28,12 +18,12 @@ steps: cd $(Build.SourcesDirectory) $regexSubmoduleSHA = '^[ \-+]([0-9a-f]+) .*$' $llvmSHA = git submodule status --cached llvm-project | %{$_ -replace $regexSubmoduleSHA, '$1'} - Write-Host "##vso[task.setvariable variable=${{ parameters.llvmSHAVar }};]$llvmSHA" + Write-Host "##vso[task.setvariable variable=llvmSHAVar;]$llvmSHA" $boostMathSHA = git submodule status --cached boost-math | %{$_ -replace $regexSubmoduleSHA, '$1'} - Write-Host "##vso[task.setvariable variable=${{ parameters.boostMathSHAVar }};]$boostMathSHA" + Write-Host "##vso[task.setvariable variable=boostMathSHAVar;]$boostMathSHA" $googleBenchmarkSHA = git submodule status --cached benchmarks/google-benchmark ` | %{$_ -replace $regexSubmoduleSHA, '$1'} - Write-Host "##vso[task.setvariable variable=${{ parameters.googleBenchmarkSHAVar }};]$googleBenchmarkSHA" + Write-Host "##vso[task.setvariable variable=googleBenchmarkSHAVar;]$googleBenchmarkSHA" - script: | cd $(Build.SourcesDirectory) if not exist "llvm-project" ( @@ -51,7 +41,7 @@ steps: git remote add llvm https://github.com/llvm/llvm-project.git ) - git fetch --filter=tree:0 --depth=1 llvm $(${{ parameters.llvmSHAVar }}) + git fetch --filter=tree:0 --depth=1 llvm $(llvmSHAVar) git sparse-checkout set --cone --sparse-index libcxx/test libcxx/utils/libcxx llvm/utils/lit git reset --quiet --hard FETCH_HEAD git clean --quiet -x -d -f -f @@ -73,7 +63,7 @@ steps: git remote add boostorg https://github.com/boostorg/math.git ) - git fetch --filter=tree:0 --depth=1 boostorg $(${{ parameters.boostMathSHAVar }}) + git fetch --filter=tree:0 --depth=1 boostorg $(boostMathSHAVar) git reset --quiet --hard FETCH_HEAD git clean --quiet -x -d -f -f displayName: "Checkout boost-math source" @@ -94,7 +84,7 @@ steps: git remote add googlebenchmark https://github.com/google/benchmark.git ) - git fetch --filter=tree:0 --depth=1 googlebenchmark $(${{ parameters.googleBenchmarkSHAVar }}) + git fetch --filter=tree:0 --depth=1 googlebenchmark $(googleBenchmarkSHAVar) git reset --quiet --hard FETCH_HEAD git clean --quiet -x -d -f -f displayName: "Checkout google benchmark source" From f490278ae22daebc0f3c2a1d39f712204515edf9 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 13:52:25 -0700 Subject: [PATCH 26/45] In checkout-sources.yml, drop unnecessary semicolons when setting Azure Pipelines variables. --- azure-devops/checkout-sources.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-sources.yml index d3e3980d45c..a3bd5db3ad4 100644 --- a/azure-devops/checkout-sources.yml +++ b/azure-devops/checkout-sources.yml @@ -18,12 +18,12 @@ steps: cd $(Build.SourcesDirectory) $regexSubmoduleSHA = '^[ \-+]([0-9a-f]+) .*$' $llvmSHA = git submodule status --cached llvm-project | %{$_ -replace $regexSubmoduleSHA, '$1'} - Write-Host "##vso[task.setvariable variable=llvmSHAVar;]$llvmSHA" + Write-Host "##vso[task.setvariable variable=llvmSHAVar]$llvmSHA" $boostMathSHA = git submodule status --cached boost-math | %{$_ -replace $regexSubmoduleSHA, '$1'} - Write-Host "##vso[task.setvariable variable=boostMathSHAVar;]$boostMathSHA" + Write-Host "##vso[task.setvariable variable=boostMathSHAVar]$boostMathSHA" $googleBenchmarkSHA = git submodule status --cached benchmarks/google-benchmark ` | %{$_ -replace $regexSubmoduleSHA, '$1'} - Write-Host "##vso[task.setvariable variable=googleBenchmarkSHAVar;]$googleBenchmarkSHA" + Write-Host "##vso[task.setvariable variable=googleBenchmarkSHAVar]$googleBenchmarkSHA" - script: | cd $(Build.SourcesDirectory) if not exist "llvm-project" ( From cf4313456e17e8a7fb7b97fd39b49a0a7068ffe2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 14:06:24 -0700 Subject: [PATCH 27/45] Extract `git submodule status` into a loop. --- azure-devops/checkout-sources.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-sources.yml index a3bd5db3ad4..4e0ee112cff 100644 --- a/azure-devops/checkout-sources.yml +++ b/azure-devops/checkout-sources.yml @@ -17,13 +17,16 @@ steps: script: | cd $(Build.SourcesDirectory) $regexSubmoduleSHA = '^[ \-+]([0-9a-f]+) .*$' - $llvmSHA = git submodule status --cached llvm-project | %{$_ -replace $regexSubmoduleSHA, '$1'} - Write-Host "##vso[task.setvariable variable=llvmSHAVar]$llvmSHA" - $boostMathSHA = git submodule status --cached boost-math | %{$_ -replace $regexSubmoduleSHA, '$1'} - Write-Host "##vso[task.setvariable variable=boostMathSHAVar]$boostMathSHA" - $googleBenchmarkSHA = git submodule status --cached benchmarks/google-benchmark ` - | %{$_ -replace $regexSubmoduleSHA, '$1'} - Write-Host "##vso[task.setvariable variable=googleBenchmarkSHAVar]$googleBenchmarkSHA" + $submoduleVarNames = [ordered]@{ + 'llvm-project' = 'llvmSHAVar'; + 'boost-math' = 'boostMathSHAVar'; + 'benchmarks/google-benchmark' = 'googleBenchmarkSHAVar'; + } + foreach ($submodule in $submoduleVarNames.Keys) { + $varName = $submoduleVarNames[$submodule] + $sha = git submodule status --cached $submodule | %{$_ -replace $regexSubmoduleSHA, '$1'} + Write-Host "##vso[task.setvariable variable=$varName]$sha" + } - script: | cd $(Build.SourcesDirectory) if not exist "llvm-project" ( From eeeaa70f76a2765074f59f59267e88d1dcfc2f69 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 14:15:36 -0700 Subject: [PATCH 28/45] Perform regex replacement on a separate line. This simplifies the syntax and avoids packing too much logic into a single line. It also allows us to put the regex directly next to its replacement, clarifying how the capture group is connected. --- azure-devops/checkout-sources.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-sources.yml index 4e0ee112cff..26c2db75dc8 100644 --- a/azure-devops/checkout-sources.yml +++ b/azure-devops/checkout-sources.yml @@ -16,7 +16,6 @@ steps: targetType: inline script: | cd $(Build.SourcesDirectory) - $regexSubmoduleSHA = '^[ \-+]([0-9a-f]+) .*$' $submoduleVarNames = [ordered]@{ 'llvm-project' = 'llvmSHAVar'; 'boost-math' = 'boostMathSHAVar'; @@ -24,7 +23,8 @@ steps: } foreach ($submodule in $submoduleVarNames.Keys) { $varName = $submoduleVarNames[$submodule] - $sha = git submodule status --cached $submodule | %{$_ -replace $regexSubmoduleSHA, '$1'} + $rawStatus = git submodule status --cached $submodule + $sha = $rawStatus -replace '^[ \-+]([0-9a-f]+) .*$', '$1' Write-Host "##vso[task.setvariable variable=$varName]$sha" } - script: | From e4e953c3524e5a0fa227d816e3234f2a5f0fe527 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 14:28:59 -0700 Subject: [PATCH 29/45] Scripts don't need to `cd $(Build.SourcesDirectory)` as that's their default `workingDirectory`. Several of our scripts were already assuming this; let's be consistent. See docs: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/cmd-line-v2?view=azure-pipelines#inputs https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/powershell-v2?view=azure-pipelines#inputs --- azure-devops/checkout-sources.yml | 6 +----- azure-devops/format-validation.yml | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-sources.yml index 26c2db75dc8..be870d90f1c 100644 --- a/azure-devops/checkout-sources.yml +++ b/azure-devops/checkout-sources.yml @@ -6,7 +6,6 @@ steps: clean: true submodules: false - script: | - cd $(Build.SourcesDirectory) git clean --quiet -x -d -f -f displayName: 'Clean after checkout' - task: PowerShell@2 @@ -15,7 +14,6 @@ steps: inputs: targetType: inline script: | - cd $(Build.SourcesDirectory) $submoduleVarNames = [ordered]@{ 'llvm-project' = 'llvmSHAVar'; 'boost-math' = 'boostMathSHAVar'; @@ -28,7 +26,6 @@ steps: Write-Host "##vso[task.setvariable variable=$varName]$sha" } - script: | - cd $(Build.SourcesDirectory) if not exist "llvm-project" ( mkdir llvm-project ) @@ -50,7 +47,6 @@ steps: git clean --quiet -x -d -f -f displayName: "Checkout LLVM source" - script: | - cd $(Build.SourcesDirectory) if not exist "boost-math" ( mkdir boost-math ) @@ -71,7 +67,7 @@ steps: git clean --quiet -x -d -f -f displayName: "Checkout boost-math source" - script: | - cd $(Build.SourcesDirectory)/benchmarks + cd benchmarks if not exist "google-benchmark" ( mkdir google-benchmark ) diff --git a/azure-devops/format-validation.yml b/azure-devops/format-validation.yml index 95a167ed203..b196b914847 100644 --- a/azure-devops/format-validation.yml +++ b/azure-devops/format-validation.yml @@ -18,7 +18,6 @@ jobs: clean: true submodules: false - script: | - cd $(Build.SourcesDirectory) git clean --quiet -x -d -f -f displayName: 'Clean after checkout' - script: | From 27a3a7c16d734684c9498c2d25e90e2ffd233625 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 15:36:20 -0700 Subject: [PATCH 30/45] Add `doTesting` to control whether we checkout LLVM and build/run tests. This is phrased positively to avoid negation. I'm intentionally not providing a default. Defaulting to `false` would be confusing, because the name build-and-test.yml suggests that testing will be performed. Defaulting to `true` would be inconsistent with the other booleans all defaulting to `false`. --- azure-devops/asan-pipeline.yml | 2 ++ azure-devops/build-and-test.yml | 5 +++++ azure-devops/checkout-sources.yml | 4 ++++ azure-devops/run-tests.yml | 8 +++++--- azure-pipelines.yml | 4 ++++ 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index 5107cd41b4a..3f053619b1c 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -28,6 +28,7 @@ stages: targetArch: x64 asanBuild: true ctestOptions: '--tests-regex stlasan' + doTesting: true - stage: Build_And_Test_x86 displayName: 'Build and Test x86' @@ -42,5 +43,6 @@ stages: targetArch: x86 asanBuild: true ctestOptions: '--tests-regex stlasan' + doTesting: true # no coverage for ARM and ARM64 diff --git a/azure-devops/build-and-test.yml b/azure-devops/build-and-test.yml index 290572a64c7..32b032084a2 100644 --- a/azure-devops/build-and-test.yml +++ b/azure-devops/build-and-test.yml @@ -21,6 +21,8 @@ parameters: - name: ctestOptions type: string default: '--exclude-regex stlasan' +- name: doTesting + type: boolean - name: numShards type: number default: 8 @@ -36,6 +38,8 @@ jobs: displayName: 'Setup TMP Directory' - template: checkout-sources.yml + parameters: + doTesting: ${{ parameters.doTesting }} - template: cmake-configure-build.yml parameters: hostArch: ${{ parameters.hostArch }} @@ -49,3 +53,4 @@ jobs: hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} ctestOptions: ${{ parameters.ctestOptions }} + doTesting: ${{ parameters.doTesting }} diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-sources.yml index be870d90f1c..52c5bc4ee46 100644 --- a/azure-devops/checkout-sources.yml +++ b/azure-devops/checkout-sources.yml @@ -1,6 +1,9 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +parameters: +- name: doTesting + type: boolean steps: - checkout: self clean: true @@ -46,6 +49,7 @@ steps: git reset --quiet --hard FETCH_HEAD git clean --quiet -x -d -f -f displayName: "Checkout LLVM source" + condition: and(succeeded(), ${{ parameters.doTesting }}) - script: | if not exist "boost-math" ( mkdir boost-math diff --git a/azure-devops/run-tests.yml b/azure-devops/run-tests.yml index f597b9d137c..88cd0cea96f 100644 --- a/azure-devops/run-tests.yml +++ b/azure-devops/run-tests.yml @@ -8,6 +8,8 @@ parameters: type: string - name: ctestOptions type: string +- name: doTesting + type: boolean steps: - script: | call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ @@ -15,13 +17,13 @@ steps: ctest --verbose ${{ parameters.ctestOptions }} displayName: 'Build and Run Tests' timeoutInMinutes: 30 - condition: succeeded() + condition: and(succeeded(), ${{ parameters.doTesting }}) workingDirectory: $(buildOutputLocation) env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - task: PublishTestResults@2 displayName: 'Publish Tests' timeoutInMinutes: 5 - condition: succeededOrFailed() + condition: and(succeededOrFailed(), ${{ parameters.doTesting }}) inputs: searchFolder: $(buildOutputLocation) testResultsFormat: JUnit @@ -29,5 +31,5 @@ steps: testRunTitle: 'test-${{ parameters.targetArch }}-$(System.JobPositionInPhase)' - publish: $(buildOutputLocation)/test-results.xml artifact: '${{ parameters.targetArch }}-$(System.JobPositionInPhase)-xml-$(System.JobId)' - condition: failed() + condition: and(failed(), ${{ parameters.doTesting }}) displayName: 'Publish XML Artifact' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 48e3868b1ff..5644b24f97f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,6 +31,7 @@ stages: targetArch: x64 analyzeBuild: true buildBenchmarks: true + doTesting: true - stage: Build_And_Test_x86 dependsOn: Build_And_Test_x64 @@ -45,6 +46,7 @@ stages: targetArch: x86 analyzeBuild: true buildBenchmarks: true + doTesting: true - stage: Build_ARM dependsOn: Build_And_Test_x64 @@ -59,6 +61,7 @@ stages: targetArch: arm analyzeBuild: true cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' + doTesting: true - stage: Build_ARM64 dependsOn: Build_And_Test_x64 @@ -74,3 +77,4 @@ stages: analyzeBuild: true buildBenchmarks: true cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' + doTesting: true From 114c20f6a4f179d0a86a4b022582111df1289c5d Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 16:34:21 -0700 Subject: [PATCH 31/45] Major behavioral change: Add 'Early Build' stages. Alongside 'Code Format', we begin by fanning out an 'Early Build' for each architecture. This verifies that the STL builds, and also covers `/analyze` and the benchmarks (the latter is still skipped for plain ARM). It skips all testing, and saves more time by skipping the LLVM checkout. Then we fan in for the normal x64 build and test. This results in several improvements: * Any build breaks (whether ordinary, `/analyze`, or benchmark) are caught early and cheaply. Previously, we'd spend at least 8 shards, or the full 32 for a non-x64 break. * This reduces the length of the critical path. We previously paid two `/analyze` and benchmark builds on the critical path (x64, then non-x64). Now we perform one `/analyze` and benchmark build simultaneously with 'Code Format' which takes almost as long, so it's nearly free. * By removing work from the 32 full test shards (`/analyze` was expensive although the benchmarks are currently cheap), we're reducing the surface area for eviction, and reducing the amount of work that needs to be rerun after evictions. If 'Code Format' fails, this performs a bit more work than before, but less than 1 full test shard. --- azure-pipelines.yml | 77 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5644b24f97f..b17f52bc25c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,9 +18,9 @@ stages: jobs: - template: azure-devops/format-validation.yml - - stage: Build_And_Test_x64 - dependsOn: Code_Format - displayName: 'Build and Test x64' + - stage: Early_Build_x64 + dependsOn: [] + displayName: 'Early Build x64' pool: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} @@ -31,6 +31,72 @@ stages: targetArch: x64 analyzeBuild: true buildBenchmarks: true + doTesting: false + numShards: 1 + + - stage: Early_Build_x86 + dependsOn: [] + displayName: 'Early Build x86' + pool: + name: ${{ variables.poolName }} + demands: ${{ variables.poolDemands }} + jobs: + - template: azure-devops/build-and-test.yml + parameters: + hostArch: x86 + targetArch: x86 + analyzeBuild: true + buildBenchmarks: true + doTesting: false + numShards: 1 + + - stage: Early_Build_ARM + dependsOn: [] + displayName: 'Early Build ARM' + pool: + name: ${{ variables.poolName }} + demands: ${{ variables.poolDemands }} + jobs: + - template: azure-devops/build-and-test.yml + parameters: + hostArch: x64 + targetArch: arm + analyzeBuild: true + doTesting: false + numShards: 1 + + - stage: Early_Build_ARM64 + dependsOn: [] + displayName: 'Early Build ARM64' + pool: + name: ${{ variables.poolName }} + demands: ${{ variables.poolDemands }} + jobs: + - template: azure-devops/build-and-test.yml + parameters: + hostArch: x64 + targetArch: arm64 + analyzeBuild: true + buildBenchmarks: true + doTesting: false + numShards: 1 + + - stage: Build_And_Test_x64 + dependsOn: + - Code_Format + - Early_Build_x64 + - Early_Build_x86 + - Early_Build_ARM + - Early_Build_ARM64 + displayName: 'Build and Test x64' + pool: + name: ${{ variables.poolName }} + demands: ${{ variables.poolDemands }} + jobs: + - template: azure-devops/build-and-test.yml + parameters: + hostArch: x64 + targetArch: x64 doTesting: true - stage: Build_And_Test_x86 @@ -44,8 +110,6 @@ stages: parameters: hostArch: x86 targetArch: x86 - analyzeBuild: true - buildBenchmarks: true doTesting: true - stage: Build_ARM @@ -59,7 +123,6 @@ stages: parameters: hostArch: x64 targetArch: arm - analyzeBuild: true cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' doTesting: true @@ -74,7 +137,5 @@ stages: parameters: hostArch: x64 targetArch: arm64 - analyzeBuild: true - buildBenchmarks: true cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' doTesting: true From 8f931320dd4516f7283a0bbed3dd321d500320bd Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 16:52:01 -0700 Subject: [PATCH 32/45] Cosmetic change: Display 'Build and Test' for ARM/ARM64. We're still compiling the tests, just not running them. --- azure-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b17f52bc25c..f5f99583066 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -112,9 +112,9 @@ stages: targetArch: x86 doTesting: true - - stage: Build_ARM + - stage: Build_And_Test_ARM dependsOn: Build_And_Test_x64 - displayName: 'Build ARM' + displayName: 'Build and Test ARM' pool: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} @@ -126,9 +126,9 @@ stages: cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' doTesting: true - - stage: Build_ARM64 + - stage: Build_And_Test_ARM64 dependsOn: Build_And_Test_x64 - displayName: 'Build ARM64' + displayName: 'Build and Test ARM64' pool: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} From 3ed351e20b406181761e01a0d0c138e7f4517d47 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 18:21:28 -0700 Subject: [PATCH 33/45] Behavior change: Make `buildBenchmarks` control whether we checkout google-benchmark. --- azure-devops/build-and-test.yml | 1 + azure-devops/checkout-sources.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/azure-devops/build-and-test.yml b/azure-devops/build-and-test.yml index 32b032084a2..753b092f432 100644 --- a/azure-devops/build-and-test.yml +++ b/azure-devops/build-and-test.yml @@ -39,6 +39,7 @@ jobs: - template: checkout-sources.yml parameters: + buildBenchmarks: ${{ parameters.buildBenchmarks }} doTesting: ${{ parameters.doTesting }} - template: cmake-configure-build.yml parameters: diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-sources.yml index 52c5bc4ee46..a64b340cfaa 100644 --- a/azure-devops/checkout-sources.yml +++ b/azure-devops/checkout-sources.yml @@ -2,6 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception parameters: +- name: buildBenchmarks + type: boolean - name: doTesting type: boolean steps: @@ -91,3 +93,4 @@ steps: git reset --quiet --hard FETCH_HEAD git clean --quiet -x -d -f -f displayName: "Checkout google benchmark source" + condition: and(succeeded(), ${{ parameters.buildBenchmarks }}) From 11952e796689934f96b444ec5b2f1cc3565edeaf Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 19:08:05 -0700 Subject: [PATCH 34/45] `git sparse-checkout` now defaults to `--cone`. See: https://github.blog/2022-06-27-highlights-from-git-2-37/ --- azure-devops/checkout-sources.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-sources.yml index a64b340cfaa..fe1df9dd273 100644 --- a/azure-devops/checkout-sources.yml +++ b/azure-devops/checkout-sources.yml @@ -47,7 +47,7 @@ steps: ) git fetch --filter=tree:0 --depth=1 llvm $(llvmSHAVar) - git sparse-checkout set --cone --sparse-index libcxx/test libcxx/utils/libcxx llvm/utils/lit + git sparse-checkout set --sparse-index libcxx/test libcxx/utils/libcxx llvm/utils/lit git reset --quiet --hard FETCH_HEAD git clean --quiet -x -d -f -f displayName: "Checkout LLVM source" From 3cd74c2974a6fa052aa1bc24a40b16c941aa15ca Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 19:23:58 -0700 Subject: [PATCH 35/45] Make 'Setup TMP Directory' more consistent. Move one occurrence from build-and-test.yml into checkout-sources.yml, so it consistently appears before `checkout: self`. Change the other occurrence in format-validation.yml to also use a single-line `if exist` command. --- azure-devops/build-and-test.yml | 5 ----- azure-devops/checkout-sources.yml | 4 ++++ azure-devops/format-validation.yml | 4 +--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/azure-devops/build-and-test.yml b/azure-devops/build-and-test.yml index 753b092f432..3368cde00f8 100644 --- a/azure-devops/build-and-test.yml +++ b/azure-devops/build-and-test.yml @@ -32,11 +32,6 @@ jobs: parallel: ${{ parameters.numShards }} timeoutInMinutes: 30 steps: - - script: | - if exist "$(tmpDir)" (rmdir /S /Q $(tmpDir)) - mkdir $(tmpDir) - displayName: 'Setup TMP Directory' - - template: checkout-sources.yml parameters: buildBenchmarks: ${{ parameters.buildBenchmarks }} diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-sources.yml index fe1df9dd273..9ea8067e20b 100644 --- a/azure-devops/checkout-sources.yml +++ b/azure-devops/checkout-sources.yml @@ -7,6 +7,10 @@ parameters: - name: doTesting type: boolean steps: +- script: | + if exist "$(tmpDir)" (rmdir /S /Q $(tmpDir)) + mkdir $(tmpDir) + displayName: 'Setup TMP Directory' - checkout: self clean: true submodules: false diff --git a/azure-devops/format-validation.yml b/azure-devops/format-validation.yml index b196b914847..dc5413cbd4a 100644 --- a/azure-devops/format-validation.yml +++ b/azure-devops/format-validation.yml @@ -9,9 +9,7 @@ jobs: displayName: 'Validation' steps: - script: | - if exist "$(tmpDir)" ( - rmdir /S /Q $(tmpDir) - ) + if exist "$(tmpDir)" (rmdir /S /Q $(tmpDir)) mkdir $(tmpDir) displayName: 'Setup TMP Directory' - checkout: self From 78162cbc53fd5952047b9288df317fa3bd7f5013 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 19:36:48 -0700 Subject: [PATCH 36/45] Behavior change: Set `fetchDepth: 1` and `fetchTags: false`. These settings observably improve our checkout behavior. --- azure-devops/checkout-sources.yml | 2 ++ azure-devops/format-validation.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-sources.yml index 9ea8067e20b..464051ee963 100644 --- a/azure-devops/checkout-sources.yml +++ b/azure-devops/checkout-sources.yml @@ -14,6 +14,8 @@ steps: - checkout: self clean: true submodules: false + fetchDepth: 1 + fetchTags: false - script: | git clean --quiet -x -d -f -f displayName: 'Clean after checkout' diff --git a/azure-devops/format-validation.yml b/azure-devops/format-validation.yml index dc5413cbd4a..3a2bb8cda32 100644 --- a/azure-devops/format-validation.yml +++ b/azure-devops/format-validation.yml @@ -15,6 +15,8 @@ jobs: - checkout: self clean: true submodules: false + fetchDepth: 1 + fetchTags: false - script: | git clean --quiet -x -d -f -f displayName: 'Clean after checkout' From 7bb30a4a146f4ad466371d21e3a376446dc30ba0 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 21:21:04 -0700 Subject: [PATCH 37/45] Replace general `cmakeAdditionalFlags` with specific `testsBuildOnly`. And we don't need to use this when configuring the benchmarks. --- azure-devops/build-and-test.yml | 8 ++++---- azure-devops/cmake-configure-build.yml | 9 +++++---- azure-pipelines.yml | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/azure-devops/build-and-test.yml b/azure-devops/build-and-test.yml index 3368cde00f8..cdb99960dd6 100644 --- a/azure-devops/build-and-test.yml +++ b/azure-devops/build-and-test.yml @@ -15,9 +15,6 @@ parameters: - name: buildBenchmarks type: boolean default: false -- name: cmakeAdditionalFlags - type: string - default: '' - name: ctestOptions type: string default: '--exclude-regex stlasan' @@ -26,6 +23,9 @@ parameters: - name: numShards type: number default: 8 +- name: testsBuildOnly + type: boolean + default: false jobs: - job: '${{ parameters.targetArch }}' strategy: @@ -43,7 +43,7 @@ jobs: analyzeBuild: ${{ parameters.analyzeBuild }} asanBuild: ${{ parameters.asanBuild }} buildBenchmarks: ${{ parameters.buildBenchmarks }} - cmakeAdditionalFlags: ${{ parameters.cmakeAdditionalFlags }} + testsBuildOnly: ${{ parameters.testsBuildOnly }} - template: run-tests.yml parameters: hostArch: ${{ parameters.hostArch }} diff --git a/azure-devops/cmake-configure-build.yml b/azure-devops/cmake-configure-build.yml index 4c2dfd9512b..dec0d987f71 100644 --- a/azure-devops/cmake-configure-build.yml +++ b/azure-devops/cmake-configure-build.yml @@ -12,8 +12,8 @@ parameters: type: boolean - name: buildBenchmarks type: boolean -- name: cmakeAdditionalFlags - type: string +- name: testsBuildOnly + type: boolean - name: litFlags type: object default: @@ -29,12 +29,13 @@ steps: ) call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo - cmake ${{ parameters.cmakeAdditionalFlags }} -G Ninja ^ + cmake -G Ninja ^ -DCMAKE_CXX_COMPILER=cl ^ -DCMAKE_BUILD_TYPE=Release ^ -DLIT_FLAGS=${{ join(';', parameters.litFlags) }} ^ -DSTL_USE_ANALYZE=${{ parameters.analyzeBuild }} ^ -DSTL_ASAN_BUILD=${{ parameters.asanBuild }} ^ + -DTESTS_BUILD_ONLY=${{ parameters.testsBuildOnly }} ^ -S $(Build.SourcesDirectory) -B "$(buildOutputLocation)" displayName: 'Configure the STL' timeoutInMinutes: 2 @@ -52,7 +53,7 @@ steps: ) call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo - cmake ${{ parameters.cmakeAdditionalFlags }} -G Ninja ^ + cmake -G Ninja ^ -DCMAKE_CXX_COMPILER=cl ^ -DCMAKE_BUILD_TYPE=Release ^ -DSTL_BINARY_DIR="$(buildOutputLocation)" ^ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f5f99583066..9870b4ee22f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -123,8 +123,8 @@ stages: parameters: hostArch: x64 targetArch: arm - cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' doTesting: true + testsBuildOnly: true - stage: Build_And_Test_ARM64 dependsOn: Build_And_Test_x64 @@ -137,5 +137,5 @@ stages: parameters: hostArch: x64 targetArch: arm64 - cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' doTesting: true + testsBuildOnly: true From af29fdf2fbb79a0844ab55a7679109081c7d229b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 21:50:26 -0700 Subject: [PATCH 38/45] Changed my mind, use `skipTesting` with a default of `false`. --- azure-devops/asan-pipeline.yml | 2 -- azure-devops/build-and-test.yml | 9 +++++---- azure-devops/checkout-sources.yml | 4 ++-- azure-devops/run-tests.yml | 8 ++++---- azure-pipelines.yml | 12 ++++-------- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index 3f053619b1c..5107cd41b4a 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -28,7 +28,6 @@ stages: targetArch: x64 asanBuild: true ctestOptions: '--tests-regex stlasan' - doTesting: true - stage: Build_And_Test_x86 displayName: 'Build and Test x86' @@ -43,6 +42,5 @@ stages: targetArch: x86 asanBuild: true ctestOptions: '--tests-regex stlasan' - doTesting: true # no coverage for ARM and ARM64 diff --git a/azure-devops/build-and-test.yml b/azure-devops/build-and-test.yml index cdb99960dd6..b4003324c81 100644 --- a/azure-devops/build-and-test.yml +++ b/azure-devops/build-and-test.yml @@ -18,11 +18,12 @@ parameters: - name: ctestOptions type: string default: '--exclude-regex stlasan' -- name: doTesting - type: boolean - name: numShards type: number default: 8 +- name: skipTesting + type: boolean + default: false - name: testsBuildOnly type: boolean default: false @@ -35,7 +36,7 @@ jobs: - template: checkout-sources.yml parameters: buildBenchmarks: ${{ parameters.buildBenchmarks }} - doTesting: ${{ parameters.doTesting }} + skipTesting: ${{ parameters.skipTesting }} - template: cmake-configure-build.yml parameters: hostArch: ${{ parameters.hostArch }} @@ -49,4 +50,4 @@ jobs: hostArch: ${{ parameters.hostArch }} targetArch: ${{ parameters.targetArch }} ctestOptions: ${{ parameters.ctestOptions }} - doTesting: ${{ parameters.doTesting }} + skipTesting: ${{ parameters.skipTesting }} diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-sources.yml index 464051ee963..3ba962d2b34 100644 --- a/azure-devops/checkout-sources.yml +++ b/azure-devops/checkout-sources.yml @@ -4,7 +4,7 @@ parameters: - name: buildBenchmarks type: boolean -- name: doTesting +- name: skipTesting type: boolean steps: - script: | @@ -57,7 +57,7 @@ steps: git reset --quiet --hard FETCH_HEAD git clean --quiet -x -d -f -f displayName: "Checkout LLVM source" - condition: and(succeeded(), ${{ parameters.doTesting }}) + condition: and(succeeded(), not(${{ parameters.skipTesting }})) - script: | if not exist "boost-math" ( mkdir boost-math diff --git a/azure-devops/run-tests.yml b/azure-devops/run-tests.yml index 88cd0cea96f..27ce640f32f 100644 --- a/azure-devops/run-tests.yml +++ b/azure-devops/run-tests.yml @@ -8,7 +8,7 @@ parameters: type: string - name: ctestOptions type: string -- name: doTesting +- name: skipTesting type: boolean steps: - script: | @@ -17,13 +17,13 @@ steps: ctest --verbose ${{ parameters.ctestOptions }} displayName: 'Build and Run Tests' timeoutInMinutes: 30 - condition: and(succeeded(), ${{ parameters.doTesting }}) + condition: and(succeeded(), not(${{ parameters.skipTesting }})) workingDirectory: $(buildOutputLocation) env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - task: PublishTestResults@2 displayName: 'Publish Tests' timeoutInMinutes: 5 - condition: and(succeededOrFailed(), ${{ parameters.doTesting }}) + condition: and(succeededOrFailed(), not(${{ parameters.skipTesting }})) inputs: searchFolder: $(buildOutputLocation) testResultsFormat: JUnit @@ -31,5 +31,5 @@ steps: testRunTitle: 'test-${{ parameters.targetArch }}-$(System.JobPositionInPhase)' - publish: $(buildOutputLocation)/test-results.xml artifact: '${{ parameters.targetArch }}-$(System.JobPositionInPhase)-xml-$(System.JobId)' - condition: and(failed(), ${{ parameters.doTesting }}) + condition: and(failed(), not(${{ parameters.skipTesting }})) displayName: 'Publish XML Artifact' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9870b4ee22f..3941274d57a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,8 +31,8 @@ stages: targetArch: x64 analyzeBuild: true buildBenchmarks: true - doTesting: false numShards: 1 + skipTesting: true - stage: Early_Build_x86 dependsOn: [] @@ -47,8 +47,8 @@ stages: targetArch: x86 analyzeBuild: true buildBenchmarks: true - doTesting: false numShards: 1 + skipTesting: true - stage: Early_Build_ARM dependsOn: [] @@ -62,8 +62,8 @@ stages: hostArch: x64 targetArch: arm analyzeBuild: true - doTesting: false numShards: 1 + skipTesting: true - stage: Early_Build_ARM64 dependsOn: [] @@ -78,8 +78,8 @@ stages: targetArch: arm64 analyzeBuild: true buildBenchmarks: true - doTesting: false numShards: 1 + skipTesting: true - stage: Build_And_Test_x64 dependsOn: @@ -97,7 +97,6 @@ stages: parameters: hostArch: x64 targetArch: x64 - doTesting: true - stage: Build_And_Test_x86 dependsOn: Build_And_Test_x64 @@ -110,7 +109,6 @@ stages: parameters: hostArch: x86 targetArch: x86 - doTesting: true - stage: Build_And_Test_ARM dependsOn: Build_And_Test_x64 @@ -123,7 +121,6 @@ stages: parameters: hostArch: x64 targetArch: arm - doTesting: true testsBuildOnly: true - stage: Build_And_Test_ARM64 @@ -137,5 +134,4 @@ stages: parameters: hostArch: x64 targetArch: arm64 - doTesting: true testsBuildOnly: true From 6439b1a62c0080dbdfac7c7dceb396de8b9048e9 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 16 Apr 2024 22:51:49 -0700 Subject: [PATCH 39/45] Split checkout-sources.yml into checkout-self.yml and checkout-submodules.yml. Now format-validation.yml can use checkout-self.yml, avoiding duplication. --- azure-devops/build-and-test.yml | 3 ++- azure-devops/checkout-self.yml | 16 ++++++++++++++++ ...ckout-sources.yml => checkout-submodules.yml} | 12 ------------ azure-devops/format-validation.yml | 13 +------------ 4 files changed, 19 insertions(+), 25 deletions(-) create mode 100644 azure-devops/checkout-self.yml rename azure-devops/{checkout-sources.yml => checkout-submodules.yml} (86%) diff --git a/azure-devops/build-and-test.yml b/azure-devops/build-and-test.yml index b4003324c81..2c75e5e06c6 100644 --- a/azure-devops/build-and-test.yml +++ b/azure-devops/build-and-test.yml @@ -33,7 +33,8 @@ jobs: parallel: ${{ parameters.numShards }} timeoutInMinutes: 30 steps: - - template: checkout-sources.yml + - template: checkout-self.yml + - template: checkout-submodules.yml parameters: buildBenchmarks: ${{ parameters.buildBenchmarks }} skipTesting: ${{ parameters.skipTesting }} diff --git a/azure-devops/checkout-self.yml b/azure-devops/checkout-self.yml new file mode 100644 index 00000000000..7fac477f5b8 --- /dev/null +++ b/azure-devops/checkout-self.yml @@ -0,0 +1,16 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +steps: +- script: | + if exist "$(tmpDir)" (rmdir /S /Q $(tmpDir)) + mkdir $(tmpDir) + displayName: 'Setup TMP Directory' +- checkout: self + clean: true + submodules: false + fetchDepth: 1 + fetchTags: false +- script: | + git clean --quiet -x -d -f -f + displayName: 'Clean after checkout' diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-submodules.yml similarity index 86% rename from azure-devops/checkout-sources.yml rename to azure-devops/checkout-submodules.yml index 3ba962d2b34..e25ffc9c5e5 100644 --- a/azure-devops/checkout-sources.yml +++ b/azure-devops/checkout-submodules.yml @@ -7,18 +7,6 @@ parameters: - name: skipTesting type: boolean steps: -- script: | - if exist "$(tmpDir)" (rmdir /S /Q $(tmpDir)) - mkdir $(tmpDir) - displayName: 'Setup TMP Directory' -- checkout: self - clean: true - submodules: false - fetchDepth: 1 - fetchTags: false -- script: | - git clean --quiet -x -d -f -f - displayName: 'Clean after checkout' - task: PowerShell@2 displayName: 'Get submodule SHAs' timeoutInMinutes: 1 diff --git a/azure-devops/format-validation.yml b/azure-devops/format-validation.yml index 3a2bb8cda32..62553a627ad 100644 --- a/azure-devops/format-validation.yml +++ b/azure-devops/format-validation.yml @@ -8,18 +8,7 @@ jobs: timeoutInMinutes: 5 displayName: 'Validation' steps: - - script: | - if exist "$(tmpDir)" (rmdir /S /Q $(tmpDir)) - mkdir $(tmpDir) - displayName: 'Setup TMP Directory' - - checkout: self - clean: true - submodules: false - fetchDepth: 1 - fetchTags: false - - script: | - git clean --quiet -x -d -f -f - displayName: 'Clean after checkout' + - template: checkout-self.yml - script: | call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ -host_arch=x64 -arch=x64 -no_logo From a9370edddd857f032132483e897e4ed357b19294 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Apr 2024 01:22:47 -0700 Subject: [PATCH 40/45] Behavioral simplification: Avoid 3x duplication with checkout-submodule.yml. This extracts 3 copy-pasted cmd scripts into 1 PowerShell script. We no longer need to use Azure Pipelines variables to communicate the SHA. Each remote is now named submodule-upstream for uniformity, as the name doesn't matter. I've performed a few additional simplifications that I believe are proper, but we'll need to watch out for problems when agents reuse repos: * After top-level self-checkout, each submodule directory should exist, so we shouldn't have to force-create it. * If the .git directory doesn't exist in the submodule, we shouldn't need to obliterate all other files there. We're going to perform a checkout and clean that should restore us to a known good state. * If the .git directory already exists, running `git init` again is harmless by design. * Instead of the "run `git remote get-url` and look for failure" technique, we can check the output of `git remote` to make `git remote add` idempotent. --- azure-devops/build-and-test.yml | 17 +++++- azure-devops/checkout-submodule.yml | 31 ++++++++++ azure-devops/checkout-submodules.yml | 90 ---------------------------- 3 files changed, 45 insertions(+), 93 deletions(-) create mode 100644 azure-devops/checkout-submodule.yml delete mode 100644 azure-devops/checkout-submodules.yml diff --git a/azure-devops/build-and-test.yml b/azure-devops/build-and-test.yml index 2c75e5e06c6..6798be4d1b7 100644 --- a/azure-devops/build-and-test.yml +++ b/azure-devops/build-and-test.yml @@ -34,10 +34,21 @@ jobs: timeoutInMinutes: 30 steps: - template: checkout-self.yml - - template: checkout-submodules.yml + - template: checkout-submodule.yml parameters: - buildBenchmarks: ${{ parameters.buildBenchmarks }} - skipTesting: ${{ parameters.skipTesting }} + enabled: ${{ not(parameters.skipTesting) }} + path: 'llvm-project' + url: 'https://github.com/llvm/llvm-project.git' + - template: checkout-submodule.yml + parameters: + enabled: true + path: 'boost-math' + url: 'https://github.com/boostorg/math.git' + - template: checkout-submodule.yml + parameters: + enabled: ${{ parameters.buildBenchmarks }} + path: 'benchmarks/google-benchmark' + url: 'https://github.com/google/benchmark.git' - template: cmake-configure-build.yml parameters: hostArch: ${{ parameters.hostArch }} diff --git a/azure-devops/checkout-submodule.yml b/azure-devops/checkout-submodule.yml new file mode 100644 index 00000000000..3822543e9d8 --- /dev/null +++ b/azure-devops/checkout-submodule.yml @@ -0,0 +1,31 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +parameters: +- name: enabled + type: boolean +- name: path + type: string +- name: url + type: string +steps: +- task: PowerShell@2 + displayName: 'Checkout ${{ parameters.path }} Submodule' + condition: and(succeeded(), ${{ parameters.enabled }}) + inputs: + targetType: inline + script: | + $submodule = '${{ parameters.path }}' + $rawStatus = git submodule status --cached $submodule + $sha = $rawStatus -replace '^[ \-+]([0-9a-f]+) .*$', '$1' + cd $submodule + git init + if ((git remote) -eq $null) { + git remote add submodule-upstream ${{ parameters.url }} + } + git fetch --filter=tree:0 --depth=1 submodule-upstream $sha + if ($submodule -eq 'llvm-project') { + git sparse-checkout set --sparse-index libcxx/test libcxx/utils/libcxx llvm/utils/lit + } + git reset --quiet --hard FETCH_HEAD + git clean --quiet -x -d -f -f diff --git a/azure-devops/checkout-submodules.yml b/azure-devops/checkout-submodules.yml deleted file mode 100644 index e25ffc9c5e5..00000000000 --- a/azure-devops/checkout-submodules.yml +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -parameters: -- name: buildBenchmarks - type: boolean -- name: skipTesting - type: boolean -steps: -- task: PowerShell@2 - displayName: 'Get submodule SHAs' - timeoutInMinutes: 1 - inputs: - targetType: inline - script: | - $submoduleVarNames = [ordered]@{ - 'llvm-project' = 'llvmSHAVar'; - 'boost-math' = 'boostMathSHAVar'; - 'benchmarks/google-benchmark' = 'googleBenchmarkSHAVar'; - } - foreach ($submodule in $submoduleVarNames.Keys) { - $varName = $submoduleVarNames[$submodule] - $rawStatus = git submodule status --cached $submodule - $sha = $rawStatus -replace '^[ \-+]([0-9a-f]+) .*$', '$1' - Write-Host "##vso[task.setvariable variable=$varName]$sha" - } -- script: | - if not exist "llvm-project" ( - mkdir llvm-project - ) - cd llvm-project - - if not exist ".git" ( - del /S /Q * - git init - ) - - git remote get-url llvm - if errorlevel 1 ( - git remote add llvm https://github.com/llvm/llvm-project.git - ) - - git fetch --filter=tree:0 --depth=1 llvm $(llvmSHAVar) - git sparse-checkout set --sparse-index libcxx/test libcxx/utils/libcxx llvm/utils/lit - git reset --quiet --hard FETCH_HEAD - git clean --quiet -x -d -f -f - displayName: "Checkout LLVM source" - condition: and(succeeded(), not(${{ parameters.skipTesting }})) -- script: | - if not exist "boost-math" ( - mkdir boost-math - ) - cd boost-math - - if not exist ".git" ( - del /S /Q * - git init - ) - - git remote get-url boostorg - if errorlevel 1 ( - git remote add boostorg https://github.com/boostorg/math.git - ) - - git fetch --filter=tree:0 --depth=1 boostorg $(boostMathSHAVar) - git reset --quiet --hard FETCH_HEAD - git clean --quiet -x -d -f -f - displayName: "Checkout boost-math source" -- script: | - cd benchmarks - if not exist "google-benchmark" ( - mkdir google-benchmark - ) - cd google-benchmark - - if not exist ".git" ( - del /S /Q * - git init - ) - - git remote get-url googlebenchmark - if errorlevel 1 ( - git remote add googlebenchmark https://github.com/google/benchmark.git - ) - - git fetch --filter=tree:0 --depth=1 googlebenchmark $(googleBenchmarkSHAVar) - git reset --quiet --hard FETCH_HEAD - git clean --quiet -x -d -f -f - displayName: "Checkout google benchmark source" - condition: and(succeeded(), ${{ parameters.buildBenchmarks }}) From ac058aaa22aa8a0afb251c85ecb9dec65062a770 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Apr 2024 12:18:29 -0700 Subject: [PATCH 41/45] [toolset update] Use PowerShell 7.4.2. --- azure-devops/provision-image.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index ee3f0ab1a6d..99f75eeee9b 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -62,11 +62,11 @@ Function DownloadAndExtractZip { return $TempSubdirPath } -if ($PSVersionTable.PSVersion -lt [Version]::new('7.4.1')) { +if ($PSVersionTable.PSVersion -lt [Version]::new('7.4.2')) { Write-Host "Old PowerShell version: $($PSVersionTable.PSVersion)" # https://github.com/PowerShell/PowerShell/releases/latest - $PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/PowerShell-7.4.1-win-x64.zip' + $PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/PowerShell-7.4.2-win-x64.zip' Write-Host "Downloading: $PowerShellZipUrl" $ExtractedPowerShellPath = DownloadAndExtractZip -Url $PowerShellZipUrl $PwshPath = Join-Path $ExtractedPowerShellPath 'pwsh.exe' From 607d7121a7e40c0c5939986d415fe66d0854fe35 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Apr 2024 12:44:23 -0700 Subject: [PATCH 42/45] [toolset update] Spot D32ds_v5 => Regular D32ads_v5 --- azure-devops/config.yml | 2 +- azure-devops/create-1es-hosted-pool.ps1 | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/azure-devops/config.yml b/azure-devops/config.yml index 63c3d01266c..bf83ab5a7f6 100644 --- a/azure-devops/config.yml +++ b/azure-devops/config.yml @@ -8,7 +8,7 @@ variables: value: 'StlBuild-2024-04-10T1048-Pool' readonly: true - name: poolDemands - value: 'EnableSpotVM -equals true' + value: 'EnableSpotVM -equals false' readonly: true - name: tmpDir value: 'D:\Temp' diff --git a/azure-devops/create-1es-hosted-pool.ps1 b/azure-devops/create-1es-hosted-pool.ps1 index 9aaf950bfd2..19adaea2aa4 100644 --- a/azure-devops/create-1es-hosted-pool.ps1 +++ b/azure-devops/create-1es-hosted-pool.ps1 @@ -14,7 +14,7 @@ $ErrorActionPreference = 'Stop' $CurrentDate = Get-Date $Location = 'eastus' -$VMSize = 'Standard_D32ds_v5' +$VMSize = 'Standard_D32ads_v5' $ProtoVMName = 'PROTOTYPE' $ImagePublisher = 'MicrosoftWindowsServer' $ImageOffer = 'WindowsServer' @@ -167,10 +167,11 @@ $Nic = New-AzNetworkInterface ` #################################################################################################### Display-ProgressBar -Status 'Creating prototype VM' +# Previously: -Priority 'Spot' $VM = New-AzVMConfig ` -Name $ProtoVMName ` -VMSize $VMSize ` - -Priority 'Spot' ` + -Priority 'Regular' ` -MaxPrice -1 $VM = Set-AzVMOperatingSystem ` @@ -342,7 +343,7 @@ $PoolName = $ResourceGroupName + '-Pool' $PoolProperties = @{ 'organization' = 'https://dev.azure.com/vclibs' 'projects' = @('STL') - 'sku' = @{ 'name' = $VMSize; 'tier' = 'StandardSSD'; 'enableSpot' = $true; } + 'sku' = @{ 'name' = $VMSize; 'tier' = 'StandardSSD'; 'enableSpot' = $false; } 'images' = @(@{ 'imageName' = $ImageName; 'poolBufferPercentage' = '100'; }) 'maxPoolSize' = 64 'agentProfile' = @{ 'type' = 'Stateless'; } From 082fa830b5121c9ca86edde0692386540417a6e2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Apr 2024 12:50:51 -0700 Subject: [PATCH 43/45] [toolset update] `New-AzVMConfig` defaults to `-MaxPrice -1`. See: https://learn.microsoft.com/en-us/powershell/module/az.compute/new-azvmconfig?view=azps-11.5.0#-maxprice Let's drop this since we won't need it if we ever go back to Spot VMs, and I'm worried it might conflict with Regular VMs. --- azure-devops/create-1es-hosted-pool.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-devops/create-1es-hosted-pool.ps1 b/azure-devops/create-1es-hosted-pool.ps1 index 19adaea2aa4..0814678ed98 100644 --- a/azure-devops/create-1es-hosted-pool.ps1 +++ b/azure-devops/create-1es-hosted-pool.ps1 @@ -171,8 +171,7 @@ Display-ProgressBar -Status 'Creating prototype VM' $VM = New-AzVMConfig ` -Name $ProtoVMName ` -VMSize $VMSize ` - -Priority 'Regular' ` - -MaxPrice -1 + -Priority 'Regular' $VM = Set-AzVMOperatingSystem ` -VM $VM ` From dec7828432e4303b416323171e0209402da49311 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Apr 2024 13:39:19 -0700 Subject: [PATCH 44/45] [toolset update] New pool. --- azure-devops/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-devops/config.yml b/azure-devops/config.yml index bf83ab5a7f6..f699f5d75c2 100644 --- a/azure-devops/config.yml +++ b/azure-devops/config.yml @@ -5,7 +5,7 @@ variables: - name: poolName - value: 'StlBuild-2024-04-10T1048-Pool' + value: 'StlBuild-2024-04-17T1257-Pool' readonly: true - name: poolDemands value: 'EnableSpotVM -equals false' From c59fe88ab3c0cd552bf7f31c6b08e48f05ba859a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Apr 2024 13:40:15 -0700 Subject: [PATCH 45/45] [toolset update] VS 2022 17.10 Preview 4. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 80682b0ba3d..9f4a728a636 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem # How To Build With The Visual Studio IDE -1. Install Visual Studio 2022 17.10 Preview 3 or later. +1. Install Visual Studio 2022 17.10 Preview 4 or later. * Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer. * We recommend selecting "C++ CMake tools for Windows" in the VS Installer. This will ensure that you're using supported versions of CMake and Ninja. @@ -156,7 +156,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem # How To Build With A Native Tools Command Prompt -1. Install Visual Studio 2022 17.10 Preview 3 or later. +1. Install Visual Studio 2022 17.10 Preview 4 or later. * Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer. * We recommend selecting "C++ CMake tools for Windows" in the VS Installer. This will ensure that you're using supported versions of CMake and Ninja.