diff --git a/eng/pipelines/cdac/prepare-cdac-helix-steps.yml b/eng/pipelines/cdac/prepare-cdac-helix-steps.yml index c3b61807915e56..d06fbb3e8d8461 100644 --- a/eng/pipelines/cdac/prepare-cdac-helix-steps.yml +++ b/eng/pipelines/cdac/prepare-cdac-helix-steps.yml @@ -7,13 +7,18 @@ parameters: buildDebuggees: true skipDebuggeeCopy: false runtimeConfiguration: 'Checked' + # Configuration used to rebuild the cDAC managed assemblies + DumpTests + # csproj during payload prep. The dump tests load the managed cDAC + # directly, so we ship Debug binaries here even when the rest of the + # build is Release. Defaults to $(_BuildConfig) for backward compatibility. + cdacTestConfig: '$(_BuildConfig)' steps: - ${{ if parameters.buildDebuggees }}: - script: $(Build.SourcesDirectory)$(dir).dotnet$(dir)dotnet$(exeExt) msbuild $(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/Microsoft.Diagnostics.DataContractReader.DumpTests.csproj /t:BuildDebuggeesOnly - /p:Configuration=$(_BuildConfig) + /p:Configuration=${{ parameters.cdacTestConfig }} /p:TargetArchitecture=$(archType) /p:RuntimeConfiguration=${{ parameters.runtimeConfiguration }} -bl:$(Build.SourcesDirectory)/artifacts/log/BuildDebuggees.binlog @@ -23,7 +28,7 @@ steps: $(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/Microsoft.Diagnostics.DataContractReader.DumpTests.csproj /p:PrepareHelixPayload=true /p:SkipDebuggeeCopy=${{ parameters.skipDebuggeeCopy }} - /p:Configuration=$(_BuildConfig) + /p:Configuration=${{ parameters.cdacTestConfig }} /p:HelixPayloadDir=$(Build.SourcesDirectory)/artifacts/helixPayload/cdac /p:SkipDumpVersions=net10.0 -bl:$(Build.SourcesDirectory)/artifacts/log/DumpTestPayload.binlog diff --git a/eng/pipelines/runtime-diagnostics.yml b/eng/pipelines/runtime-diagnostics.yml index f13e62a096b366..ba09a9ba7ae0c4 100644 --- a/eng/pipelines/runtime-diagnostics.yml +++ b/eng/pipelines/runtime-diagnostics.yml @@ -279,12 +279,45 @@ extends: condition: failed() # - # cDAC Dump Tests — Build, generate dumps, and run tests on Helix (single-leg mode) + # cDAC Stage — single stage containing the shared build + all per-platform + # test legs (dump tests, stress tests, x-plat dump generation). Putting + # them in one stage lets each test job depend on its OWN platform's + # CdacBuild job via job-level `dependsOnGlobalBuilds`, so linux_x64 dump + # tests start as soon as linux_x64 build is done -- no waiting for the + # slowest platform's build. # - - ${{ if and(eq(parameters.cdacDumpTestMode, 'single-leg'), ne(variables['Build.Reason'], 'Schedule')) }}: - - stage: CdacDumpTests - dependsOn: [] - jobs: + # Runtime is built Checked; the cDAC native shim ships in the Release + # testhost (used by stress tests in-process); dump tests rebuild the + # cDAC managed assemblies at /p:Configuration=Debug during payload prep. + # + - stage: Cdac + dependsOn: [] + jobs: + # ---- Shared per-platform build (always runs; downstream jobs depend on + # this via job-level dependsOnGlobalBuilds: - nameSuffix: CdacBuild) ---- + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + buildConfig: release + platforms: ${{ parameters.cdacDumpPlatforms }} + jobParameters: + nameSuffix: CdacBuild + buildArgs: -s clr+libs+tools.cdac+tools.cdacdumptests+tools.cdacstresstests -c $(_BuildConfig) -rc checked -lc $(_BuildConfig) /p:SkipDumpVersions=net10.0 + isOfficialBuild: ${{ variables.isOfficialBuild }} + timeoutInMinutes: 180 + postBuildSteps: + - template: /eng/pipelines/common/upload-artifact-step.yml + parameters: + rootFolder: $(Build.SourcesDirectory)/artifacts/bin + includeRootFolder: false + archiveType: $(archiveType) + archiveExtension: $(archiveExtension) + tarCompression: $(tarCompression) + artifactName: CdacBuildArtifacts_$(osGroup)$(osSubgroup)_$(archType) + displayName: cDAC Shared Build Artifacts + + # ---- cDAC Dump Tests (single-leg mode, not on schedule) ---- + - ${{ if and(eq(parameters.cdacDumpTestMode, 'single-leg'), ne(variables['Build.Reason'], 'Schedule')) }}: - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml @@ -293,10 +326,24 @@ extends: shouldContinueOnError: true jobParameters: nameSuffix: CdacDumpTest - buildArgs: -s clr+libs+tools.cdac+tools.cdacdumptests -c $(_BuildConfig) -rc checked -lc $(_BuildConfig) /p:SkipDumpVersions=net10.0 + # Tiny rebuild that triggers .dotnet init; coreclr+libs+tools.cdac + # come from CdacBuildArtifacts. prepare-cdac-helix-steps below + # rebuilds the cDAC managed assemblies at Debug for the dump tests. + buildArgs: -s tools.cdacdumptests -c $(_BuildConfig) -rc checked -lc $(_BuildConfig) /p:SkipDumpVersions=net10.0 timeoutInMinutes: 180 + dependsOnGlobalBuilds: + - nameSuffix: CdacBuild + preBuildSteps: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + artifactName: CdacBuildArtifacts_$(osGroup)$(osSubgroup)_$(archType) + artifactFileName: CdacBuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)$(archiveExtension) + unpackFolder: $(Build.SourcesDirectory)/artifacts/bin + displayName: 'cDAC Shared Build Artifacts' postBuildSteps: - template: /eng/pipelines/cdac/prepare-cdac-helix-steps.yml + parameters: + cdacTestConfig: Debug - template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml parameters: displayName: 'Send cDAC Dump Tests to Helix' @@ -320,15 +367,8 @@ extends: displayName: 'Fail on test errors' condition: always() - # - # cDAC GC Stress Tests — runs in-process cDAC vs runtime stack-ref - # verification at GC stress points. Independent stage with its own build - # so its status/failures don't get conflated with the dump tests. - # - - ${{ if ne(variables['Build.Reason'], 'Schedule') }}: - - stage: CdacStressTests - dependsOn: [] - jobs: + # ---- cDAC GC Stress Tests (not on schedule) ---- + - ${{ if ne(variables['Build.Reason'], 'Schedule') }}: - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml @@ -337,8 +377,19 @@ extends: shouldContinueOnError: true jobParameters: nameSuffix: CdacStressTest - buildArgs: -s clr+libs+tools.cdac+tools.cdacstresstests -c $(_BuildConfig) -rc checked -lc $(_BuildConfig) + # Tiny rebuild that triggers .dotnet init; coreclr+libs+tools.cdac + # come from CdacBuildArtifacts and aren't rebuilt. + buildArgs: -s tools.cdacstresstests -c $(_BuildConfig) -rc checked -lc $(_BuildConfig) timeoutInMinutes: 180 + dependsOnGlobalBuilds: + - nameSuffix: CdacBuild + preBuildSteps: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + artifactName: CdacBuildArtifacts_$(osGroup)$(osSubgroup)_$(archType) + artifactFileName: CdacBuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)$(archiveExtension) + unpackFolder: $(Build.SourcesDirectory)/artifacts/bin + displayName: 'cDAC Shared Build Artifacts' postBuildSteps: - template: /eng/pipelines/cdac/prepare-cdac-stress-helix-steps.yml - template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml @@ -368,15 +419,8 @@ extends: continueOnError: true condition: failed() - # - # cDAC X-Plat Dump Generation and Testing — Two-stage flow: - # 1. Generate dumps on each platform via Helix, download and publish as artifacts - # 2. Download all platforms' dumps and run tests on each target platform - # - - ${{ if or(eq(parameters.cdacDumpTestMode, 'xplat'), eq(variables['Build.Reason'], 'Schedule')) }}: - - stage: CdacXPlatDumpGen - dependsOn: [] - jobs: + # ---- cDAC X-Plat Dump Generation (xplat mode or schedule) ---- + - ${{ if or(eq(parameters.cdacDumpTestMode, 'xplat'), eq(variables['Build.Reason'], 'Schedule')) }}: - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml @@ -385,10 +429,21 @@ extends: shouldContinueOnError: true jobParameters: nameSuffix: CdacXPlatDumpGen - buildArgs: -s clr+libs+tools.cdac+tools.cdacdumptests -c $(_BuildConfig) -rc checked -lc $(_BuildConfig) /p:SkipDumpVersions=net10.0 + buildArgs: -s tools.cdacdumptests -c $(_BuildConfig) -rc checked -lc $(_BuildConfig) /p:SkipDumpVersions=net10.0 timeoutInMinutes: 180 + dependsOnGlobalBuilds: + - nameSuffix: CdacBuild + preBuildSteps: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + artifactName: CdacBuildArtifacts_$(osGroup)$(osSubgroup)_$(archType) + artifactFileName: CdacBuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)$(archiveExtension) + unpackFolder: $(Build.SourcesDirectory)/artifacts/bin + displayName: 'cDAC Shared Build Artifacts' postBuildSteps: - template: /eng/pipelines/cdac/prepare-cdac-helix-steps.yml + parameters: + cdacTestConfig: Debug - template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml parameters: displayName: 'Send cDAC Dump Gen to Helix' @@ -420,9 +475,16 @@ extends: displayName: 'Fail on dump generation errors' condition: always() + # + # cDAC X-Plat Dump Tests — runs after all source platforms have generated + # their dumps. This stage IS cross-platform-synchronizing (every target + # platform's test needs every source platform's dumps), so it remains a + # separate stage depending on Cdac. + # + - ${{ if or(eq(parameters.cdacDumpTestMode, 'xplat'), eq(variables['Build.Reason'], 'Schedule')) }}: - stage: CdacXPlatDumpTests dependsOn: - - CdacXPlatDumpGen + - Cdac jobs: - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -432,13 +494,25 @@ extends: shouldContinueOnError: true jobParameters: nameSuffix: CdacXPlatDumpTest - buildArgs: -s clr+libs+tools.cdac+tools.cdacdumptests -c $(_BuildConfig) -rc checked -lc $(_BuildConfig) /p:SkipDumpVersions=net10.0 + buildArgs: -s tools.cdacdumptests -c $(_BuildConfig) -rc checked -lc $(_BuildConfig) /p:SkipDumpVersions=net10.0 timeoutInMinutes: 180 + # No dependsOnGlobalBuilds: this stage depends on the entire Cdac + # stage (which already has the per-platform CdacBuild jobs), and + # AzDO does not support cross-stage job-level deps. The stage-level + # dependsOn: Cdac above is sufficient. + preBuildSteps: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + artifactName: CdacBuildArtifacts_$(osGroup)$(osSubgroup)_$(archType) + artifactFileName: CdacBuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)$(archiveExtension) + unpackFolder: $(Build.SourcesDirectory)/artifacts/bin + displayName: 'cDAC Shared Build Artifacts' postBuildSteps: - template: /eng/pipelines/cdac/prepare-cdac-helix-steps.yml parameters: buildDebuggees: false skipDebuggeeCopy: true + cdacTestConfig: Debug # Download dump artifacts from all source platforms - ${{ each platform in parameters.cdacXPlatDumpPlatforms }}: - task: DownloadPipelineArtifact@2