From 023fec62a572cf1fb2726e9c526b9e0b297110c0 Mon Sep 17 00:00:00 2001 From: "Haonan Tang (from Dev Box)" Date: Wed, 23 Apr 2025 13:35:42 +0800 Subject: [PATCH 01/31] separate build per platform --- ...WindowsAppSDK-Build-Stage-Per-Platform.yml | 168 +++++++++++++++++ .../WindowsAppSDK-Build-Stage.yml | 169 ++---------------- ...ndowsAppSDK-PackTransportPackage-Stage.yml | 7 +- .../WindowsAppSDK-Publish-Stage.yml | 2 +- .../WindowsAppSDK-RunTestsInPipeline-Job.yml | 3 + .../WindowsAppSDK-Test-Stage.yml | 5 +- 6 files changed, 197 insertions(+), 157 deletions(-) create mode 100644 build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml new file mode 100644 index 0000000000..f7ec1a9472 --- /dev/null +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml @@ -0,0 +1,168 @@ +parameters: +- name: "SignOutput" + type: boolean + default: false +- name: "IsOneBranch" + type: boolean + default: true +- name: runStaticAnalysis + type: boolean + default: true +- name: buildPlatform + type: string + default: x64 + +stages: +- stage: ${{ format('Build_{0}', parameters.buildPlatform) }} + # Skip the build job if we are reusing the output of a previous build. + # useBuildOutputFromBuildId variable is set on the Pipeline at Queue time. + condition: + eq(variables['useBuildOutputFromBuildId'],'') + dependsOn: [] + jobs: + - job: BuildFoundation + pool: + ${{ if parameters.IsOneBranch }}: + type: windows + ${{ if not( parameters.IsOneBranch ) }}: + type: windows + isCustom: true + name: 'ProjectReunionESPool-2022' + timeoutInMinutes: 120 + strategy: + maxParallel: 10 + matrix: + ${{ format('Release_{0}', parameters.buildPlatform) }}: + ${{ if ne(parameters.buildPlatform, 'arm64') }}: + buildPlatform: ${{ parameters.buildPlatform }} + buildConfiguration: 'release' + normalizedConfiguration: 'fre' + PGOBuildMode: 'Optimize' + ${{ else }}: + buildPlatform: ${{ parameters.buildPlatform }} + buildConfiguration: 'release' + normalizedConfiguration: 'fre' + variables: + - name: ob_outputDirectory + value: '$(REPOROOT)\out' + - name: ob_sdl_codeSignValidation_excludes + value: '-|**\Release\**;-|**\packages\**' + - name: ob_artifactBaseName + value: "FoundationBinaries_$(buildConfiguration)_$(buildPlatform)" + - name: ob_sdl_apiscan_enabled + ${{ if parameters.runStaticAnalysis }}: + value: true + ${{ else }}: + value: false + - name: ob_sdl_apiscan_softwareFolder + value: '$(build.SourcesDirectory)\APIScanTarget' + - name: ob_sdl_apiscan_symbolsFolder + value: '$(build.SourcesDirectory)\APIScanTarget;SRV*https://symweb.azurefd.net' + - template: AzurePipelinesTemplates/WindowsAppSDK-Global-LKGVersions.yml@WindowsAppSDKConfigSourceBranch + - name: localCompilerOverridePackageName + value: $[coalesce(variables.compilerOverridePackageName, variables.global_CompilerOverridePackageName)] + - name: localCompilerOverridePackageVersion + value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] + - name: localCompilerOverrideNupkgVersion + value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)] + steps: + - script: | + echo Build.SourceBranch=$(Build.SourceBranch) + echo Build.Reason=$(Build.Reason) + echo compilerOverridePackageName=$(compilerOverridePackageName) + echo compilerOverridePackageVersion=$(compilerOverridePackageVersion) + echo global_CompilerOverridePackageName=$(global_CompilerOverridePackageName) + echo global_CompilerOverridePackageVersion=$(global_CompilerOverridePackageVersion) + echo localCompilerOverridePackageName=$(localCompilerOverridePackageName) + echo localCompilerOverridePackageVersion=$(localCompilerOverridePackageVersion) + echo localCompilerOverrideNupkgVersion=$(localCompilerOverrideNupkgVersion) + echo System.PullRequest.targetBranchName=$(System.PullRequest.targetBranchName) + echo mySourceBranch=$(mySourceBranch) + + - template: WindowsAppSDK-BuildFoundation-Steps.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + IsOneBranch: ${{ parameters.IsOneBranch }} + runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + + # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" + # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- + # requisite of isNative=true isn't met currently. + - script: | + md "C:\__t\NativeCompilerPrefast" + displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' + + - job: BuildMRT + pool: + # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs + ${{ if parameters.IsOneBranch }}: + type: windows + ${{ if not( parameters.IsOneBranch ) }}: + type: windows + isCustom: true + name: 'ProjectReunionESPool-2022' + timeoutInMinutes: 120 + strategy: + maxParallel: 10 + matrix: + ${{ format('Release_{0}', parameters.buildPlatform) }}: + ${{ if ne(parameters.buildPlatform, 'arm64') }}: + buildPlatform: ${{ parameters.buildPlatform }} + buildConfiguration: 'Release' + normalizedConfiguration: 'fre' + PGOBuildMode: 'Optimize' + ${{ else }}: + buildPlatform: ${{ parameters.buildPlatform }} + buildConfiguration: 'Release' + normalizedConfiguration: 'fre' + variables: + - name: ob_outputDirectory + value: '$(REPOROOT)\out' + - name: ob_sdl_codeSignValidation_excludes + value: '-|**\Release\**' + - name: ob_sdl_suppression_suppressionSet + value: default + - name: ob_artifactBaseName + value: "MrtBinaries_$(buildConfiguration)_$(buildPlatform)" + - name: ob_sdl_apiscan_enabled + ${{ if parameters.runStaticAnalysis }}: + value: true + ${{ else }}: + value: false + - name: ob_sdl_apiscan_softwareFolder + value: '$(build.SourcesDirectory)\APIScanTarget' + - name: ob_sdl_apiscan_symbolsFolder + value: '$(build.SourcesDirectory)\APIScanTarget;SRV*https://symweb.azurefd.net' + - template: AzurePipelinesTemplates/WindowsAppSDK-Global-LKGVersions.yml@WindowsAppSDKConfigSourceBranch + - name: localCompilerOverridePackageName + value: $[coalesce(variables.compilerOverridePackageName, variables.global_CompilerOverridePackageName)] + - name: localCompilerOverridePackageVersion + value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] + - name: localCompilerOverrideNupkgVersion + value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)] + steps: + - script: | + echo Build.SourceBranch=$(Build.SourceBranch) + echo Build.Reason=$(Build.Reason) + echo compilerOverridePackageName=$(compilerOverridePackageName) + echo compilerOverridePackageVersion=$(compilerOverridePackageVersion) + echo global_CompilerOverridePackageName=$(global_CompilerOverridePackageName) + echo global_CompilerOverridePackageVersion=$(global_CompilerOverridePackageVersion) + echo localCompilerOverridePackageName=$(localCompilerOverridePackageName) + echo localCompilerOverridePackageVersion=$(localCompilerOverridePackageVersion) + echo localCompilerOverrideNupkgVersion=$(localCompilerOverrideNupkgVersion) + echo System.PullRequest.targetBranchName=$(System.PullRequest.targetBranchName) + echo mySourceBranch=$(mySourceBranch) + + - template: WindowsAppSDK-BuildMRT-Steps.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + IsOneBranch: ${{ parameters.IsOneBranch }} + runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + + # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" + # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- + # requisite of isNative=true isn't met currently. + - script: | + md "C:\__t\NativeCompilerPrefast" + displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' \ No newline at end of file diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml index c56d180901..3afb5c7f50 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml @@ -10,7 +10,7 @@ parameters: default: true stages: -- stage: Build +- stage: Verify_Copyright_Headers_and_Build_anycpu # Skip the build job if we are reusing the output of a previous build. # useBuildOutputFromBuildId variable is set on the Pipeline at Queue time. condition: @@ -30,82 +30,6 @@ stages: targetType: filePath filePath: tools\VerifyCopyrightHeaders.ps1 - - job: BuildFoundation - pool: - ${{ if parameters.IsOneBranch }}: - type: windows - ${{ if not( parameters.IsOneBranch ) }}: - type: windows - isCustom: true - name: 'ProjectReunionESPool-2022' - timeoutInMinutes: 120 - strategy: - maxParallel: 10 - matrix: - Release_x86: - buildPlatform: 'x86' - buildConfiguration: 'release' - normalizedConfiguration: 'fre' - PGOBuildMode: 'Optimize' - Release_x64: - buildPlatform: 'x64' - buildConfiguration: 'release' - normalizedConfiguration: 'fre' - PGOBuildMode: 'Optimize' - Release_Arm64: - buildPlatform: 'arm64' - buildConfiguration: 'release' - normalizedConfiguration: 'fre' - variables: - - name: ob_outputDirectory - value: '$(REPOROOT)\out' - - name: ob_sdl_codeSignValidation_excludes - value: '-|**\Release\**;-|**\packages\**' - - name: ob_artifactBaseName - value: "FoundationBinaries_$(buildConfiguration)_$(buildPlatform)" - - name: ob_sdl_apiscan_enabled - ${{ if parameters.runStaticAnalysis }}: - value: true - ${{ else }}: - value: false - - name: ob_sdl_apiscan_softwareFolder - value: '$(build.SourcesDirectory)\APIScanTarget' - - name: ob_sdl_apiscan_symbolsFolder - value: '$(build.SourcesDirectory)\APIScanTarget;SRV*https://symweb.azurefd.net' - - template: AzurePipelinesTemplates/WindowsAppSDK-Global-LKGVersions.yml@WindowsAppSDKConfigSourceBranch - - name: localCompilerOverridePackageName - value: $[coalesce(variables.compilerOverridePackageName, variables.global_CompilerOverridePackageName)] - - name: localCompilerOverridePackageVersion - value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] - - name: localCompilerOverrideNupkgVersion - value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)] - steps: - - script: | - echo Build.SourceBranch=$(Build.SourceBranch) - echo Build.Reason=$(Build.Reason) - echo compilerOverridePackageName=$(compilerOverridePackageName) - echo compilerOverridePackageVersion=$(compilerOverridePackageVersion) - echo global_CompilerOverridePackageName=$(global_CompilerOverridePackageName) - echo global_CompilerOverridePackageVersion=$(global_CompilerOverridePackageVersion) - echo localCompilerOverridePackageName=$(localCompilerOverridePackageName) - echo localCompilerOverridePackageVersion=$(localCompilerOverridePackageVersion) - echo localCompilerOverrideNupkgVersion=$(localCompilerOverrideNupkgVersion) - echo System.PullRequest.targetBranchName=$(System.PullRequest.targetBranchName) - echo mySourceBranch=$(mySourceBranch) - - - template: WindowsAppSDK-BuildFoundation-Steps.yml@self - parameters: - SignOutput: ${{ parameters.SignOutput }} - IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} - - # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" - # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- - # requisite of isNative=true isn't met currently. - - script: | - md "C:\__t\NativeCompilerPrefast" - displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' - - job: BuildFoundation_release_anycpu # For now, this job just builds Microsoft.WindowsAppRuntime.Bootstrap.Net.dll in AnyCPU # Can be expanded to add any other binary as needed @@ -140,81 +64,20 @@ stages: md "C:\__t\NativeCompilerPrefast" displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' - - job: BuildMRT - pool: - # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs - ${{ if parameters.IsOneBranch }}: - type: windows - ${{ if not( parameters.IsOneBranch ) }}: - type: windows - isCustom: true - name: 'ProjectReunionESPool-2022' - timeoutInMinutes: 120 - strategy: - maxParallel: 10 - matrix: - Release_x86: - buildPlatform: 'x86' - buildConfiguration: 'Release' - normalizedConfiguration: 'fre' - PGOBuildMode: 'Optimize' - Release_x64: - buildPlatform: 'x64' - buildConfiguration: 'Release' - normalizedConfiguration: 'fre' - PGOBuildMode: 'Optimize' - Release_Arm64: - buildPlatform: 'arm64' - buildConfiguration: 'Release' - normalizedConfiguration: 'fre' - variables: - - name: ob_outputDirectory - value: '$(REPOROOT)\out' - - name: ob_sdl_codeSignValidation_excludes - value: '-|**\Release\**' - - name: ob_sdl_suppression_suppressionSet - value: default - - name: ob_artifactBaseName - value: "MrtBinaries_$(buildConfiguration)_$(buildPlatform)" - - name: ob_sdl_apiscan_enabled - ${{ if parameters.runStaticAnalysis }}: - value: true - ${{ else }}: - value: false - - name: ob_sdl_apiscan_softwareFolder - value: '$(build.SourcesDirectory)\APIScanTarget' - - name: ob_sdl_apiscan_symbolsFolder - value: '$(build.SourcesDirectory)\APIScanTarget;SRV*https://symweb.azurefd.net' - - template: AzurePipelinesTemplates/WindowsAppSDK-Global-LKGVersions.yml@WindowsAppSDKConfigSourceBranch - - name: localCompilerOverridePackageName - value: $[coalesce(variables.compilerOverridePackageName, variables.global_CompilerOverridePackageName)] - - name: localCompilerOverridePackageVersion - value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] - - name: localCompilerOverrideNupkgVersion - value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)] - steps: - - script: | - echo Build.SourceBranch=$(Build.SourceBranch) - echo Build.Reason=$(Build.Reason) - echo compilerOverridePackageName=$(compilerOverridePackageName) - echo compilerOverridePackageVersion=$(compilerOverridePackageVersion) - echo global_CompilerOverridePackageName=$(global_CompilerOverridePackageName) - echo global_CompilerOverridePackageVersion=$(global_CompilerOverridePackageVersion) - echo localCompilerOverridePackageName=$(localCompilerOverridePackageName) - echo localCompilerOverridePackageVersion=$(localCompilerOverridePackageVersion) - echo localCompilerOverrideNupkgVersion=$(localCompilerOverrideNupkgVersion) - echo System.PullRequest.targetBranchName=$(System.PullRequest.targetBranchName) - echo mySourceBranch=$(mySourceBranch) +- template: WindowsAppSDK-Build-Stage-Per-Platform.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + IsOneBranch: ${{ parameters.IsOneBranch }} + BuildPlatform: x86 - - template: WindowsAppSDK-BuildMRT-Steps.yml@self - parameters: - SignOutput: ${{ parameters.SignOutput }} - IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} +- template: WindowsAppSDK-Build-Stage-Per-Platform.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + IsOneBranch: ${{ parameters.IsOneBranch }} + BuildPlatform: x64 - # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" - # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- - # requisite of isNative=true isn't met currently. - - script: | - md "C:\__t\NativeCompilerPrefast" - displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' +- template: WindowsAppSDK-Build-Stage-Per-Platform.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + IsOneBranch: ${{ parameters.IsOneBranch }} + BuildPlatform: arm64 \ No newline at end of file diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml index ef702e049e..ad8eaaac84 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml @@ -17,7 +17,10 @@ parameters: stages: - stage: Pack - dependsOn: Build + dependsOn: + - Build_x86 + - Build_x64 + - Build_arm64 condition: eq(variables['useBuildOutputFromBuildId'],'') jobs: @@ -202,4 +205,4 @@ stages: verbosityPush: 'Detailed' nuGetFeedType: 'internal' #Note: The project qualifier is always required when using a feed name. Also, do not use organization scoped feeds. - publishVstsFeed: 'ProjectReunion/Project.Reunion.nuget.internal' + publishVstsFeed: 'ProjectReunion/Project.Reunion.nuget.internal' \ No newline at end of file diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml index f0cfbba949..d59a830cc9 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml @@ -25,4 +25,4 @@ stages: - template: AzurePipelinesTemplates/WindowsAppSDK-PublishToMaestro-Steps.yml@WindowsAppSDKConfig parameters: NuGetArtifactNames: - - 'TransportPackage' + - 'TransportPackage' \ No newline at end of file diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml index 69dfe01256..95ac6e5855 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml @@ -16,6 +16,9 @@ parameters: default: '' jobs: +- job: echoParam + steps: + - script: echo "${{ convertToJson(parameters) }}" - job: ${{ parameters.jobName }} strategy: matrix: ${{ parameters.testMatrix }} diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml index 571da9ed30..c2676fbfac 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml @@ -1,6 +1,9 @@ stages: - stage: Test - dependsOn: Build + dependsOn: + - Build_x86 + - Build_x64 + - Build_arm64 condition: not(failed()) jobs: # Arm64 uses a different VM type than x64, thus requiring them to be in different From 2baca33f44a8591198c9ef3756b2bddeac870cd6 Mon Sep 17 00:00:00 2001 From: "Haonan Tang (from Dev Box)" Date: Wed, 23 Apr 2025 15:30:17 +0800 Subject: [PATCH 02/31] debug --- .../WindowsAppSDK-RunTestsInPipeline-Job.yml | 38 +++++++++---------- .../WindowsAppSDK-Test-Stage.yml | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml index 95ac6e5855..be72e0cbf0 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml @@ -19,22 +19,22 @@ jobs: - job: echoParam steps: - script: echo "${{ convertToJson(parameters) }}" -- job: ${{ parameters.jobName }} - strategy: - matrix: ${{ parameters.testMatrix }} - pool: - type: windows - isCustom: true - name: $(poolName) - demands: ImageOverride -equals $(imageName) - timeoutInMinutes: 120 - variables: - testPayloadArtifactDir: $(Build.SourcesDirectory)\BuildOutput\$(buildConfiguration)\$(buildPlatform) - AZURE_PIPELINES_DEDUP_PARALLELISM: 16 - steps: - - template: WindowsAppSDK-RunTests-Steps.yml - parameters: - buildPlatform: $(buildPlatform) - buildConfiguration: $(buildConfiguration) - testLocale: $(testLocale) - ImageName: $(imageName) +# - job: ${{ parameters.jobName }} +# strategy: +# matrix: ${{ parameters.testMatrix }} +# pool: +# type: windows +# isCustom: true +# name: $(poolName) +# demands: ImageOverride -equals $(imageName) +# timeoutInMinutes: 120 +# variables: +# testPayloadArtifactDir: $(Build.SourcesDirectory)\BuildOutput\$(buildConfiguration)\$(buildPlatform) +# AZURE_PIPELINES_DEDUP_PARALLELISM: 16 +# steps: +# - template: WindowsAppSDK-RunTests-Steps.yml +# parameters: +# buildPlatform: $(buildPlatform) +# buildConfiguration: $(buildConfiguration) +# testLocale: $(testLocale) +# ImageName: $(imageName) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml index c2676fbfac..3b4318dbba 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml @@ -11,4 +11,4 @@ stages: - template: WindowsAppSDK-RunTestsInPipeline-Job.yml@self parameters: jobName: PipelineTests - testMatrix: $[ variables.PipelineTests ] # testMatrix is supplied by WindowsAppSDKConfig/WindowsAppSDK-Foundation-TestConfig.yml + testMatrix: ${{ variables.PipelineTests }} # testMatrix is supplied by WindowsAppSDKConfig/WindowsAppSDK-Foundation-TestConfig.yml From 157a19dc3f757a8898b0b3ceed192157748b9206 Mon Sep 17 00:00:00 2001 From: "Haonan Tang (from Dev Box)" Date: Wed, 23 Apr 2025 15:50:45 +0800 Subject: [PATCH 03/31] debug --- .../WindowsAppSDK-Publish-Stage.yml | 4 ++- .../WindowsAppSDK-RunTestsInPipeline-Job.yml | 28 ++++++++++++--- .../WindowsAppSDK-Test-Stage.yml | 34 +++++++++++++++---- build/ProjectReunion-BuildFoundation.yml | 2 ++ 4 files changed, 57 insertions(+), 11 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml index d59a830cc9..09d5695573 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml @@ -8,7 +8,9 @@ parameters: stages: - stage: Publish dependsOn: - - Test + - Test_x86 + - Test_x64 + - Test_arm64 - StaticValidationTest condition: not(failed()) jobs: diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml index be72e0cbf0..a745b2a2f4 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml @@ -14,14 +14,34 @@ parameters: - name: testMatrix type: object default: '' +- name: buildPlatform + type: string + default: x64 jobs: -- job: echoParam +- job: FilterMatrix steps: - - script: echo "${{ convertToJson(parameters) }}" + - powershell: | + Write-Host "This is ${{ convertToJson(parameters.testMatrix) }}" // This is + $testMatrix = "${{ parameters.testMatrix }}" | ConvertFrom-Json + $targetPlatform = "${{ parameters.buildPlatform }}" + Write-Host "That is ${{ parameters.buildPlatform }}" // That is x86 + $filteredMatrix = @{} + foreach ($entry in $testMatrix.PSObject.Properties) { + if ($entry.Value.buildPlatform -eq $targetPlatform) { + $filteredMatrix[$entry.Name] = $entry.Value + } + } + $filteredMatrixJson = $filteredMatrix | ConvertTo-Json -Compress + Write-Host "##vso[task.setvariable variable=filteredMatrixJson;isOutput=true]$filteredMatrixJson" + name: setFilteredMatrixStep + - script: echo $(setFilteredMatrixStep.filteredMatrixJson) + name: echoMatrix + # - job: ${{ parameters.jobName }} +# dependsOn: FilterMatrix # strategy: -# matrix: ${{ parameters.testMatrix }} +# matrix: $[ dependencies.FilterMatrix.outputs['setFilteredMatrixStep.filteredMatrixJson'] ] # pool: # type: windows # isCustom: true @@ -37,4 +57,4 @@ jobs: # buildPlatform: $(buildPlatform) # buildConfiguration: $(buildConfiguration) # testLocale: $(testLocale) -# ImageName: $(imageName) +# ImageName: $(imageName) \ No newline at end of file diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml index 3b4318dbba..d61765187c 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml @@ -1,9 +1,6 @@ stages: -- stage: Test - dependsOn: - - Build_x86 - - Build_x64 - - Build_arm64 +- stage: Test_x86 + dependsOn: Build_x86 condition: not(failed()) jobs: # Arm64 uses a different VM type than x64, thus requiring them to be in different @@ -11,4 +8,29 @@ stages: - template: WindowsAppSDK-RunTestsInPipeline-Job.yml@self parameters: jobName: PipelineTests - testMatrix: ${{ variables.PipelineTests }} # testMatrix is supplied by WindowsAppSDKConfig/WindowsAppSDK-Foundation-TestConfig.yml + testMatrix: ${{ parameters.testMatrix }} # testMatrix is supplied by WindowsAppSDKConfig/WindowsAppSDK-Foundation-TestConfig.yml + buildPlatform: x86 + +- stage: Test_x64 + dependsOn: Build_x64 + condition: not(failed()) + jobs: + # Arm64 uses a different VM type than x64, thus requiring them to be in different + # pools, hence, we split the two scenarios into separate jobs. + - template: WindowsAppSDK-RunTestsInPipeline-Job.yml@self + parameters: + jobName: PipelineTests + testMatrix: ${{ parameters.testMatrix }} # testMatrix is supplied by WindowsAppSDKConfig/WindowsAppSDK-Foundation-TestConfig.yml + buildPlatform: x64 + +- stage: Test_arm64 + dependsOn: Build_arm64 + condition: not(failed()) + jobs: + # Arm64 uses a different VM type than x64, thus requiring them to be in different + # pools, hence, we split the two scenarios into separate jobs. + - template: WindowsAppSDK-RunTestsInPipeline-Job.yml@self + parameters: + jobName: PipelineTests + testMatrix: ${{ parameters.testMatrix }} # testMatrix is supplied by WindowsAppSDKConfig/WindowsAppSDK-Foundation-TestConfig.yml + buildPlatform: arm64 \ No newline at end of file diff --git a/build/ProjectReunion-BuildFoundation.yml b/build/ProjectReunion-BuildFoundation.yml index 7ecf00284b..77b6762815 100644 --- a/build/ProjectReunion-BuildFoundation.yml +++ b/build/ProjectReunion-BuildFoundation.yml @@ -33,6 +33,8 @@ stages: IsOneBranch: false - template: AzurePipelinesTemplates\WindowsAppSDK-Test-Stage.yml@self + parameters: + testMatrix: ${{ variables.PipelineTests }} - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: From ffeb5be9787d182ec70e4ec56677a99de661e72a Mon Sep 17 00:00:00 2001 From: "Haonan Tang (from Dev Box)" Date: Wed, 23 Apr 2025 15:53:53 +0800 Subject: [PATCH 04/31] separate test per platform --- .../WindowsAppSDK-RunTestsInPipeline-Job.yml | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml index a745b2a2f4..4d3ee5803f 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml @@ -22,10 +22,8 @@ jobs: - job: FilterMatrix steps: - powershell: | - Write-Host "This is ${{ convertToJson(parameters.testMatrix) }}" // This is $testMatrix = "${{ parameters.testMatrix }}" | ConvertFrom-Json $targetPlatform = "${{ parameters.buildPlatform }}" - Write-Host "That is ${{ parameters.buildPlatform }}" // That is x86 $filteredMatrix = @{} foreach ($entry in $testMatrix.PSObject.Properties) { if ($entry.Value.buildPlatform -eq $targetPlatform) { @@ -38,23 +36,23 @@ jobs: - script: echo $(setFilteredMatrixStep.filteredMatrixJson) name: echoMatrix -# - job: ${{ parameters.jobName }} -# dependsOn: FilterMatrix -# strategy: -# matrix: $[ dependencies.FilterMatrix.outputs['setFilteredMatrixStep.filteredMatrixJson'] ] -# pool: -# type: windows -# isCustom: true -# name: $(poolName) -# demands: ImageOverride -equals $(imageName) -# timeoutInMinutes: 120 -# variables: -# testPayloadArtifactDir: $(Build.SourcesDirectory)\BuildOutput\$(buildConfiguration)\$(buildPlatform) -# AZURE_PIPELINES_DEDUP_PARALLELISM: 16 -# steps: -# - template: WindowsAppSDK-RunTests-Steps.yml -# parameters: -# buildPlatform: $(buildPlatform) -# buildConfiguration: $(buildConfiguration) -# testLocale: $(testLocale) -# ImageName: $(imageName) \ No newline at end of file +- job: ${{ parameters.jobName }} + dependsOn: FilterMatrix + strategy: + matrix: $[ dependencies.FilterMatrix.outputs['setFilteredMatrixStep.filteredMatrixJson'] ] + pool: + type: windows + isCustom: true + name: $(poolName) + demands: ImageOverride -equals $(imageName) + timeoutInMinutes: 120 + variables: + testPayloadArtifactDir: $(Build.SourcesDirectory)\BuildOutput\$(buildConfiguration)\$(buildPlatform) + AZURE_PIPELINES_DEDUP_PARALLELISM: 16 + steps: + - template: WindowsAppSDK-RunTests-Steps.yml + parameters: + buildPlatform: $(buildPlatform) + buildConfiguration: $(buildConfiguration) + testLocale: $(testLocale) + ImageName: $(imageName) \ No newline at end of file From bce46275a77da065552373a5dd9064027de643dc Mon Sep 17 00:00:00 2001 From: "Haonan Tang (from Dev Box)" Date: Wed, 23 Apr 2025 21:39:50 +0800 Subject: [PATCH 05/31] modify nightly and official pipeline --- build/WindowsAppSDK-Foundation-Nightly.yml | 2 ++ build/WindowsAppSDK-Foundation-Official.yml | 2 ++ build/WindowsAppSDK-Foundation-PR.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/build/WindowsAppSDK-Foundation-Nightly.yml b/build/WindowsAppSDK-Foundation-Nightly.yml index d2ff696763..b2daef0211 100644 --- a/build/WindowsAppSDK-Foundation-Nightly.yml +++ b/build/WindowsAppSDK-Foundation-Nightly.yml @@ -127,6 +127,8 @@ extends: SignOutput: ${{ parameters.SignOutput }} - template: AzurePipelinesTemplates\WindowsAppSDK-Test-Stage.yml@self + parameters: + testMatrix: ${{ variables.PipelineTests }} - template: AzurePipelinesTemplates\WindowsAppSDK-Publish-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-Official.yml b/build/WindowsAppSDK-Foundation-Official.yml index 87f16e0248..6ffdbf6fbc 100644 --- a/build/WindowsAppSDK-Foundation-Official.yml +++ b/build/WindowsAppSDK-Foundation-Official.yml @@ -113,6 +113,8 @@ extends: SignOutput: ${{ parameters.SignOutput }} - template: AzurePipelinesTemplates\WindowsAppSDK-Test-Stage.yml@self + parameters: + testMatrix: ${{ variables.PipelineTests }} - template: AzurePipelinesTemplates\WindowsAppSDK-Publish-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-PR.yml b/build/WindowsAppSDK-Foundation-PR.yml index b727c03826..280d3b667c 100644 --- a/build/WindowsAppSDK-Foundation-PR.yml +++ b/build/WindowsAppSDK-Foundation-PR.yml @@ -104,3 +104,5 @@ extends: SignOutput: false - template: AzurePipelinesTemplates\WindowsAppSDK-Test-Stage.yml@self + parameters: + testMatrix: ${{ variables.PipelineTests }} From a96b6bdf13bf83597b4d26541b5c6de37d40bdaa Mon Sep 17 00:00:00 2001 From: "Haonan Tang (from Dev Box)" Date: Thu, 24 Apr 2025 11:25:53 +0800 Subject: [PATCH 06/31] specify pool for FilterMatrix job --- .../WindowsAppSDK-RunTestsInPipeline-Job.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml index 4d3ee5803f..438f821d43 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml @@ -20,6 +20,11 @@ parameters: jobs: - job: FilterMatrix + pool: + type: windows + isCustom: true + name: $(poolName) + demands: ImageOverride -equals $(imageName) steps: - powershell: | $testMatrix = "${{ parameters.testMatrix }}" | ConvertFrom-Json From 0e52f0284f0868a95b69dd90096d668cc9692d47 Mon Sep 17 00:00:00 2001 From: "Haonan Tang (from Dev Box)" Date: Thu, 24 Apr 2025 13:16:01 +0800 Subject: [PATCH 07/31] specify pool --- .../WindowsAppSDK-RunTestsInPipeline-Job.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml index 438f821d43..d651859479 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml @@ -23,8 +23,7 @@ jobs: pool: type: windows isCustom: true - name: $(poolName) - demands: ImageOverride -equals $(imageName) + name: 'ProjectReunionESPool-2022' steps: - powershell: | $testMatrix = "${{ parameters.testMatrix }}" | ConvertFrom-Json From bb71b0e077512ce98fcc74b9b94feac7f30b5cf6 Mon Sep 17 00:00:00 2001 From: "Haonan Tang (from Dev Box)" Date: Fri, 25 Apr 2025 14:25:31 +0800 Subject: [PATCH 08/31] add comments --- build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml index 3afb5c7f50..3cc1f34363 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml @@ -64,6 +64,7 @@ stages: md "C:\__t\NativeCompilerPrefast" displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' +# extract BuildFoundation and BuildMRT into WindowsAppSDK-Build-Stage-Per-Platform.yml. Separate the build stage per platform - template: WindowsAppSDK-Build-Stage-Per-Platform.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} From 10b03e50a48756aa3f5633029e519917f95ff315 Mon Sep 17 00:00:00 2001 From: "Haonan Tang (from Dev Box)" Date: Fri, 25 Apr 2025 14:40:08 +0800 Subject: [PATCH 09/31] rename yml file and pass runStaticAnalysis parameter into WindowsAppSDK-Build-Per-Platform-Stage.yml --- ...rm.yml => WindowsAppSDK-Build-Per-Platform-Stage.yml} | 0 .../WindowsAppSDK-Build-Stage.yml | 9 ++++++--- 2 files changed, 6 insertions(+), 3 deletions(-) rename build/AzurePipelinesTemplates/{WindowsAppSDK-Build-Stage-Per-Platform.yml => WindowsAppSDK-Build-Per-Platform-Stage.yml} (100%) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml similarity index 100% rename from build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml rename to build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml index 3cc1f34363..285a5d1f29 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml @@ -65,20 +65,23 @@ stages: displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' # extract BuildFoundation and BuildMRT into WindowsAppSDK-Build-Stage-Per-Platform.yml. Separate the build stage per platform -- template: WindowsAppSDK-Build-Stage-Per-Platform.yml@self +- template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} + runStaticAnalysis : ${{ parameters.runStaticAnalysis }} BuildPlatform: x86 -- template: WindowsAppSDK-Build-Stage-Per-Platform.yml@self +- template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} + runStaticAnalysis : ${{ parameters.runStaticAnalysis }} BuildPlatform: x64 -- template: WindowsAppSDK-Build-Stage-Per-Platform.yml@self +- template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} + runStaticAnalysis : ${{ parameters.runStaticAnalysis }} BuildPlatform: arm64 \ No newline at end of file From 7dc760c2f41d4810a142e47bac6c66ed8bc2f4ae Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Fri, 25 Apr 2025 15:21:52 +0800 Subject: [PATCH 10/31] change --- .../WindowsAppSDK-Build-Stage-Per-Platform.yml | 2 +- build/ProjectReunion-BuildFoundation.yml | 6 ++++++ build/WindowsAppSDK-Foundation-Nightly.yml | 6 ++++++ build/WindowsAppSDK-Foundation-Official.yml | 6 ++++++ build/WindowsAppSDK-Foundation-PR.yml | 8 +++++++- 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml index f7ec1a9472..2e2372e821 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml @@ -13,7 +13,7 @@ parameters: default: x64 stages: -- stage: ${{ format('Build_{0}', parameters.buildPlatform) }} +- stage: ${{ format(iif(parameters.runStaticAnalysis, 'BuildWithStaticAnalysis_{0}', 'Build_{0}'), parameters.buildPlatform) }} # Skip the build job if we are reusing the output of a previous build. # useBuildOutputFromBuildId variable is set on the Pipeline at Queue time. condition: diff --git a/build/ProjectReunion-BuildFoundation.yml b/build/ProjectReunion-BuildFoundation.yml index 77b6762815..0164cf4eda 100644 --- a/build/ProjectReunion-BuildFoundation.yml +++ b/build/ProjectReunion-BuildFoundation.yml @@ -27,6 +27,12 @@ stages: - template: AzurePipelinesTemplates\WindowsAppSDK-BuildVSIX-Stage.yml@self +- template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self + parameters: + SignOutput: false + IsOneBranch: false + runStaticAnalysis: false + - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: false diff --git a/build/WindowsAppSDK-Foundation-Nightly.yml b/build/WindowsAppSDK-Foundation-Nightly.yml index b2daef0211..f3f7d09113 100644 --- a/build/WindowsAppSDK-Foundation-Nightly.yml +++ b/build/WindowsAppSDK-Foundation-Nightly.yml @@ -113,6 +113,12 @@ extends: stages: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + runStaticAnalysis : false + + - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: + - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} runStaticAnalysis : ${{ parameters.runStaticAnalysis }} diff --git a/build/WindowsAppSDK-Foundation-Official.yml b/build/WindowsAppSDK-Foundation-Official.yml index 6ffdbf6fbc..4fc58e237e 100644 --- a/build/WindowsAppSDK-Foundation-Official.yml +++ b/build/WindowsAppSDK-Foundation-Official.yml @@ -98,6 +98,12 @@ extends: stages: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + runStaticAnalysis : false + + - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: + - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} runStaticAnalysis : ${{ parameters.runStaticAnalysis }} diff --git a/build/WindowsAppSDK-Foundation-PR.yml b/build/WindowsAppSDK-Foundation-PR.yml index 280d3b667c..9de344961b 100644 --- a/build/WindowsAppSDK-Foundation-PR.yml +++ b/build/WindowsAppSDK-Foundation-PR.yml @@ -92,7 +92,13 @@ extends: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: false - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + runStaticAnalysis: false + + - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: + - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self + parameters: + SignOutput: false + runStaticAnalysis: ${{ parameters.runStaticAnalysis }} - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: From 91d4b00137aa742e3775f41972893af20d034aa4 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Fri, 25 Apr 2025 15:42:24 +0800 Subject: [PATCH 11/31] duplicate stage name fix --- build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml index 285a5d1f29..97deab69e9 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml @@ -10,7 +10,7 @@ parameters: default: true stages: -- stage: Verify_Copyright_Headers_and_Build_anycpu +- stage: ${{ iif(parameters.runStaticAnalysis, 'Verify_Copyright_Headers_and_Build_anycpu_StaticAnalysis', 'Verify_Copyright_Headers_and_Build_anycpu') }} # Skip the build job if we are reusing the output of a previous build. # useBuildOutputFromBuildId variable is set on the Pipeline at Queue time. condition: From b8e0e96efcc92d05dd6f41704e0cdc572dbae92b Mon Sep 17 00:00:00 2001 From: "Haonan Tang (from Dev Box)" Date: Fri, 25 Apr 2025 16:56:57 +0800 Subject: [PATCH 12/31] update dependency for Build_AnyCPU --- build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml | 2 +- .../WindowsAppSDK-PackTransportPackage-Stage.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml index 285a5d1f29..9c8fc4d88a 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml @@ -10,7 +10,7 @@ parameters: default: true stages: -- stage: Verify_Copyright_Headers_and_Build_anycpu +- stage: Build_AnyCPU # Skip the build job if we are reusing the output of a previous build. # useBuildOutputFromBuildId variable is set on the Pipeline at Queue time. condition: diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml index ad8eaaac84..8db0996328 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml @@ -18,6 +18,7 @@ parameters: stages: - stage: Pack dependsOn: + - Build_AnyCPU - Build_x86 - Build_x64 - Build_arm64 From b68653eaae08de4ebd39d8ad1c59c3923e2ad0e1 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Fri, 25 Apr 2025 17:04:45 +0800 Subject: [PATCH 13/31] minor syntax fix --- build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml index 78fd1b863f..294255c7a6 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml @@ -10,7 +10,7 @@ parameters: default: true stages: -- stage: ${{ iif(parameters.runStaticAnalysis, 'Build_AnyCPU_StaticAnalysis', Build_AnyCPU') }} +- stage: ${{ iif(parameters.runStaticAnalysis, 'Build_AnyCPU_StaticAnalysis', 'Build_AnyCPU') }} # Skip the build job if we are reusing the output of a previous build. # useBuildOutputFromBuildId variable is set on the Pipeline at Queue time. condition: From 780b760341a764ce65d019d5f05ae85d2989a0af Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Mon, 28 Apr 2025 16:28:31 +0800 Subject: [PATCH 14/31] resolve comments on formatting --- build/ProjectReunion-BuildFoundation.yml | 1 + build/WindowsAppSDK-Foundation-Nightly.yml | 8 ++++---- build/WindowsAppSDK-Foundation-Official.yml | 8 ++++---- build/WindowsAppSDK-Foundation-PR.yml | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/build/ProjectReunion-BuildFoundation.yml b/build/ProjectReunion-BuildFoundation.yml index 0164cf4eda..9e4ba715ed 100644 --- a/build/ProjectReunion-BuildFoundation.yml +++ b/build/ProjectReunion-BuildFoundation.yml @@ -37,6 +37,7 @@ stages: parameters: SignOutput: false IsOneBranch: false + runStaticAnalysis: true - template: AzurePipelinesTemplates\WindowsAppSDK-Test-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-Nightly.yml b/build/WindowsAppSDK-Foundation-Nightly.yml index f3f7d09113..bcb54fc090 100644 --- a/build/WindowsAppSDK-Foundation-Nightly.yml +++ b/build/WindowsAppSDK-Foundation-Nightly.yml @@ -115,13 +115,13 @@ extends: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis : false + runStaticAnalysis: false - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self - parameters: - SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + parameters: + SignOutput: ${{ parameters.SignOutput }} + runStaticAnalysis: true - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-Official.yml b/build/WindowsAppSDK-Foundation-Official.yml index 4fc58e237e..2cb09bcb00 100644 --- a/build/WindowsAppSDK-Foundation-Official.yml +++ b/build/WindowsAppSDK-Foundation-Official.yml @@ -100,13 +100,13 @@ extends: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis : false + runStaticAnalysis: false - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self - parameters: - SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + parameters: + SignOutput: ${{ parameters.SignOutput }} + runStaticAnalysis: true - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-PR.yml b/build/WindowsAppSDK-Foundation-PR.yml index 9de344961b..4afeee0fa7 100644 --- a/build/WindowsAppSDK-Foundation-PR.yml +++ b/build/WindowsAppSDK-Foundation-PR.yml @@ -96,9 +96,9 @@ extends: - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self - parameters: - SignOutput: false - runStaticAnalysis: ${{ parameters.runStaticAnalysis }} + parameters: + SignOutput: false + runStaticAnalysis: true - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: From 6fdbe5d815eda80d18f2aa8814cb76469770d43c Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Fri, 2 May 2025 17:20:24 +0800 Subject: [PATCH 15/31] run prefast for all arch --- .../WindowsAppSDK-BuildFoundation-Steps.yml | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml index cb31691735..ec4603905e 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml @@ -65,27 +65,28 @@ steps: ucrtFeedPat: $(System.AccessToken) platform: $(buildPlatform) -- task: PowerShell@2 - name: BuildFoundation - inputs: - filePath: 'BuildAll.ps1' - arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildFoundation" - -- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: +- ${{ if and(eq(parameters.runStaticAnalysis, 'true'), eq(variables['buildConfiguration'], 'Release')) }}: - task: SDLNativeRules@3 displayName: Run PREfast SDL Native Rules - condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'), eq(variables['buildPlatform'], 'x64')) + # condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'), eq(variables['buildPlatform'], 'x64')) inputs: setupCommandlines: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat"' - msBuildArchitecture: amd64 - msBuildCommandline: 'msbuild.exe /restore /nologo /nr:false /p:configuration=Release /p:platform=x64 $(Build.SourcesDirectory)\WindowsAppRuntime.sln' + # msBuildArchitecture: amd64 + msBuildCommandline: 'msbuild.exe /restore /nologo /nr:false /p:configuration=Release /p:platform=$(buildPlatform) $(Build.SourcesDirectory)\WindowsAppRuntime.sln' # Generally speaking, we leave it to the external repos to scan the bits in their packages. excludedPaths: | $(Build.SourcesDirectory)\packages env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) continueOnError: true +- ${{ else }}: + - task: PowerShell@2 + name: BuildFoundation + inputs: + filePath: 'BuildAll.ps1' + arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildFoundation" +- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: # Copy build output to folder APIScanTarget for APIScan to scan later, in the mean time, exclude some folders/files. - task: CopyFiles@2 displayName: Populate APIScanTarget From e709270cf80f905eccd40d90e7c11acbf065cfa0 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Fri, 2 May 2025 18:17:30 +0800 Subject: [PATCH 16/31] test run for static analysis for all archs --- .../WindowsAppSDK-BuildFoundation-Steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml index ec4603905e..8b12855560 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml @@ -65,7 +65,7 @@ steps: ucrtFeedPat: $(System.AccessToken) platform: $(buildPlatform) -- ${{ if and(eq(parameters.runStaticAnalysis, 'true'), eq(variables['buildConfiguration'], 'Release')) }}: +- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - task: SDLNativeRules@3 displayName: Run PREfast SDL Native Rules # condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'), eq(variables['buildPlatform'], 'x64')) From 95a0d9760b2d3f7813edb0098c18261f03ce0ff3 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Fri, 2 May 2025 19:27:01 +0800 Subject: [PATCH 17/31] fix errors testing prefast for all arch --- .../WindowsAppSDK-BuildFoundation-Steps.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml index 8b12855560..94d4b645f1 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml @@ -65,13 +65,19 @@ steps: ucrtFeedPat: $(System.AccessToken) platform: $(buildPlatform) +- task: PowerShell@2 + name: BuildFoundation + inputs: + filePath: 'BuildAll.ps1' + arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildFoundation" + - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - task: SDLNativeRules@3 displayName: Run PREfast SDL Native Rules - # condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'), eq(variables['buildPlatform'], 'x64')) + condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release')) inputs: setupCommandlines: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat"' - # msBuildArchitecture: amd64 + # BuildArchitecture: amd64 msBuildCommandline: 'msbuild.exe /restore /nologo /nr:false /p:configuration=Release /p:platform=$(buildPlatform) $(Build.SourcesDirectory)\WindowsAppRuntime.sln' # Generally speaking, we leave it to the external repos to scan the bits in their packages. excludedPaths: | @@ -79,14 +85,7 @@ steps: env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) continueOnError: true -- ${{ else }}: - - task: PowerShell@2 - name: BuildFoundation - inputs: - filePath: 'BuildAll.ps1' - arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildFoundation" -- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: # Copy build output to folder APIScanTarget for APIScan to scan later, in the mean time, exclude some folders/files. - task: CopyFiles@2 displayName: Populate APIScanTarget From 92442c2f994827ed82c659fd97997a1e51792e54 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Wed, 7 May 2025 10:56:33 +0800 Subject: [PATCH 18/31] separate out PREfast and only runs for x64 --- ...WindowsAppSDK-Build-Per-Platform-Stage.yml | 20 ++++++--- .../WindowsAppSDK-Build-Stage.yml | 44 +++++++++++-------- ...owsAppSDK-BuildFoundation-AnyCPU-Steps.yml | 6 +-- .../WindowsAppSDK-BuildFoundation-Steps.yml | 14 +++--- .../WindowsAppSDK-BuildMRT-Steps.yml | 8 +++- build/ProjectReunion-BuildFoundation.yml | 6 ++- build/WindowsAppSDK-Foundation-Nightly.yml | 6 ++- build/WindowsAppSDK-Foundation-Official.yml | 7 ++- build/WindowsAppSDK-Foundation-PR.yml | 6 ++- 9 files changed, 75 insertions(+), 42 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml index 36ec465a35..13aeb10773 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml @@ -8,12 +8,18 @@ parameters: - name: runStaticAnalysis type: boolean default: true +- name: runApiScan + type: boolean + default: true +- name: runPREfast + type: boolean + default: false - name: buildPlatform type: string default: x64 stages: -- stage: ${{ format(iif(parameters.runStaticAnalysis, 'Build_{0}_StaticAnalysis', 'Build_{0}'), parameters.buildPlatform) }} +- stage: ${{ format(iif(parameters.runPREfast, 'PREfast_{0}', 'Build_{0}'), parameters.buildPlatform) }} # Skip the build job if we are reusing the output of a previous build. # useBuildOutputFromBuildId variable is set on the Pipeline at Queue time. condition: @@ -50,7 +56,7 @@ stages: - name: ob_artifactBaseName value: "FoundationBinaries_$(buildConfiguration)_$(buildPlatform)" - name: ob_sdl_apiscan_enabled - ${{ if parameters.runStaticAnalysis }}: + ${{ if parameters.runApiScan }}: value: true ${{ else }}: value: false @@ -62,7 +68,7 @@ stages: - name: localCompilerOverridePackageName value: $[coalesce(variables.compilerOverridePackageName, variables.global_CompilerOverridePackageName)] - name: localCompilerOverridePackageVersion - value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] + value: $[coalesce(variables.compiflerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] - name: localCompilerOverrideNupkgVersion value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)] steps: @@ -83,7 +89,8 @@ stages: parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + runApiScan: ${{ parameters.runApiScan }} + runPREfast: ${{ parameters.runPREfast }} # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- @@ -125,7 +132,7 @@ stages: - name: ob_artifactBaseName value: "MrtBinaries_$(buildConfiguration)_$(buildPlatform)" - name: ob_sdl_apiscan_enabled - ${{ if parameters.runStaticAnalysis }}: + ${{ if parameters.runApiScan }}: value: true ${{ else }}: value: false @@ -158,7 +165,8 @@ stages: parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + runPREfast : ${{ parameters.runPREfast }} + runApiScan : ${{ parameters.runApiScan }} # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml index 294255c7a6..78596326c7 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml @@ -5,12 +5,15 @@ parameters: - name: "IsOneBranch" type: boolean default: true -- name: runStaticAnalysis +- name: runApiScan type: boolean default: true +- name: runPREfast + type: boolean + default: false stages: -- stage: ${{ iif(parameters.runStaticAnalysis, 'Build_AnyCPU_StaticAnalysis', 'Build_AnyCPU') }} +- stage: ${{ iif(parameters.runPREfast, 'PREfast_AnyCPU', 'Build_AnyCPU') }} # Skip the build job if we are reusing the output of a previous build. # useBuildOutputFromBuildId variable is set on the Pipeline at Queue time. condition: @@ -44,9 +47,9 @@ stages: ob_outputDirectory: '$(REPOROOT)\out' ob_sdl_codeSignValidation_excludes: '-|**\Release\**' ob_artifactBaseName: "FoundationBinaries_release_anycpu" - ${{ if parameters.runStaticAnalysis }}: + ${{ if parameters.runApiScan }}: ob_sdl_apiscan_enabled: true - ${{ if not( parameters.runStaticAnalysis ) }}: + ${{ if not( parameters.runApiScan ) }}: ob_sdl_apiscan_enabled: false ob_sdl_apiscan_softwareFolder: '$(build.SourcesDirectory)\BuildOutput\Release\AnyCPU' ob_sdl_apiscan_symbolsFolder: '$(build.SourcesDirectory)\BuildOutput\Release\AnyCPU;SRV*https://symweb.azurefd.net' @@ -55,7 +58,7 @@ stages: parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + runPREfast : ${{ parameters.runPREfast }} # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- @@ -65,23 +68,28 @@ stages: displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' # extract BuildFoundation and BuildMRT into WindowsAppSDK-Build-Stage-Per-Platform.yml. Separate the build stage per platform -- template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self - parameters: - SignOutput: ${{ parameters.SignOutput }} - IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} - BuildPlatform: x86 - template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + runPREfast : ${{ parameters.runPREfast }} + runApiScan : ${{ parameters.runApiScan }} BuildPlatform: x64 -- template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self - parameters: - SignOutput: ${{ parameters.SignOutput }} - IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} - BuildPlatform: arm64 \ No newline at end of file +- ${{ if not(parameters.runPREfast) }}: + - template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + IsOneBranch: ${{ parameters.IsOneBranch }} + runPREfast : ${{ parameters.runPREfast }} + runApiScan : ${{ parameters.runApiScan }} + BuildPlatform: x86 + + - template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + IsOneBranch: ${{ parameters.IsOneBranch }} + runPREfast : ${{ parameters.runPREfast }} + runApiScan : ${{ parameters.runApiScan }} + BuildPlatform: arm64 \ No newline at end of file diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml index cd997c4bcd..41d66881cd 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml @@ -5,9 +5,9 @@ parameters: - name: "IsOneBranch" type: boolean default: true -- name: runStaticAnalysis +- name: runPREfast type: boolean - default: true + default: false steps: - task: NuGetAuthenticate@1 @@ -30,7 +30,7 @@ steps: filePath: 'BuildAll.ps1' arguments: -AzureBuildStep "BuildAnyCPU" -- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: +- ${{ if eq(parameters.runPREfast, 'true') }}: - task: SDLNativeRules@3 displayName: Run PREfast SDL Native Rules inputs: diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml index 94d4b645f1..9f3faf00c3 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml @@ -5,9 +5,12 @@ parameters: - name: "IsOneBranch" type: boolean default: true -- name: runStaticAnalysis +- name: runApiScan type: boolean default: true +- name: runPREfast + type: boolean + default: false steps: - task: NuGetAuthenticate@1 @@ -71,14 +74,14 @@ steps: filePath: 'BuildAll.ps1' arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildFoundation" -- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: +- ${{ if eq(parameters.runPREfast, 'true') }}: - task: SDLNativeRules@3 displayName: Run PREfast SDL Native Rules - condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release')) + condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'), eq(variables['buildPlatform'], 'x64')) inputs: setupCommandlines: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat"' - # BuildArchitecture: amd64 - msBuildCommandline: 'msbuild.exe /restore /nologo /nr:false /p:configuration=Release /p:platform=$(buildPlatform) $(Build.SourcesDirectory)\WindowsAppRuntime.sln' + msBuildArchitecture: amd64 + msBuildCommandline: 'msbuild.exe /restore /nologo /nr:false /p:configuration=Release /p:platform=x64 $(Build.SourcesDirectory)\WindowsAppRuntime.sln' # Generally speaking, we leave it to the external repos to scan the bits in their packages. excludedPaths: | $(Build.SourcesDirectory)\packages @@ -86,6 +89,7 @@ steps: SYSTEM_ACCESSTOKEN: $(System.AccessToken) continueOnError: true +- ${{ if eq(parameters.runApiScan, 'true') }}: # Copy build output to folder APIScanTarget for APIScan to scan later, in the mean time, exclude some folders/files. - task: CopyFiles@2 displayName: Populate APIScanTarget diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml index ee6e6cb978..6c3e2f268b 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml @@ -5,9 +5,12 @@ parameters: - name: "IsOneBranch" type: boolean default: true -- name: runStaticAnalysis +- name: runApiScan type: boolean default: true +- name: runPREfast + type: boolean + default: false steps: - template: WindowsAppSDK-SetupBuildEnvironment-Steps.yml @@ -32,7 +35,7 @@ steps: filePath: 'BuildAll.ps1' arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildMRT" -- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: +- ${{ if eq(parameters.runPREfast, 'true') }}: - task: SDLNativeRules@3 displayName: Run PREfast SDL Native Rules condition: and(succeeded(), eq(variables['buildPlatform'], 'x64'), eq(variables['buildConfiguration'], 'Release')) @@ -47,6 +50,7 @@ steps: SYSTEM_ACCESSTOKEN: $(System.AccessToken) continueOnError: true +- ${{ if eq(parameters.runApiScan, 'true') }}: # Copy build output to folder APIScanTarget for APIScan to scan, in the mean time, exclude some folders/files. - task: CopyFiles@2 displayName: Populate APIScanTarget diff --git a/build/ProjectReunion-BuildFoundation.yml b/build/ProjectReunion-BuildFoundation.yml index 9e4ba715ed..bd224bec1a 100644 --- a/build/ProjectReunion-BuildFoundation.yml +++ b/build/ProjectReunion-BuildFoundation.yml @@ -31,13 +31,15 @@ stages: parameters: SignOutput: false IsOneBranch: false - runStaticAnalysis: false + runApiScan: true + runPREFast: false - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: false IsOneBranch: false - runStaticAnalysis: true + runApiScan: false + runPREFast: true - template: AzurePipelinesTemplates\WindowsAppSDK-Test-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-Nightly.yml b/build/WindowsAppSDK-Foundation-Nightly.yml index bcb54fc090..4f4dd0b2e4 100644 --- a/build/WindowsAppSDK-Foundation-Nightly.yml +++ b/build/WindowsAppSDK-Foundation-Nightly.yml @@ -115,13 +115,15 @@ extends: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis: false + runApiScan: ${{ parameters.runStaticAnalysis }} + runPREFast: false - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis: true + runApiScan: false + runPREFast: true - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-Official.yml b/build/WindowsAppSDK-Foundation-Official.yml index 2cb09bcb00..69f8fa6bc0 100644 --- a/build/WindowsAppSDK-Foundation-Official.yml +++ b/build/WindowsAppSDK-Foundation-Official.yml @@ -97,16 +97,19 @@ extends: break: false stages: + - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis: false + runApiScan: ${{ parameters.runStaticAnalysis }} + runPREFast: false - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis: true + runApiScan: false + runPREFast: true - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-PR.yml b/build/WindowsAppSDK-Foundation-PR.yml index 4afeee0fa7..24920e328f 100644 --- a/build/WindowsAppSDK-Foundation-PR.yml +++ b/build/WindowsAppSDK-Foundation-PR.yml @@ -92,13 +92,15 @@ extends: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: false - runStaticAnalysis: false + runApiScan: ${{ parameters.runStaticAnalysis }} + runPREFast: false - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: false - runStaticAnalysis: true + runApiScan: false + runPREFast: true - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: From 6cb036dc47d4641606e8beea6664ee49ccaa0891 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Wed, 7 May 2025 13:26:06 +0800 Subject: [PATCH 19/31] clean up unused parameter --- .../WindowsAppSDK-Build-Per-Platform-Stage.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml index 13aeb10773..a1cfd67ec3 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml @@ -5,9 +5,6 @@ parameters: - name: "IsOneBranch" type: boolean default: true -- name: runStaticAnalysis - type: boolean - default: true - name: runApiScan type: boolean default: true From 1b6a1f254e2439953dfc3e3a8ad2cdafe9840637 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Wed, 7 May 2025 15:23:24 +0800 Subject: [PATCH 20/31] delete unwanted typo --- .../WindowsAppSDK-Build-Per-Platform-Stage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml index a1cfd67ec3..05dcd55538 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml @@ -65,7 +65,7 @@ stages: - name: localCompilerOverridePackageName value: $[coalesce(variables.compilerOverridePackageName, variables.global_CompilerOverridePackageName)] - name: localCompilerOverridePackageVersion - value: $[coalesce(variables.compiflerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] + value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] - name: localCompilerOverrideNupkgVersion value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)] steps: From 2a1f1af70cb10923f9b555585bdf522940883f3a Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Wed, 7 May 2025 15:33:05 +0800 Subject: [PATCH 21/31] rebase to main --- ...WindowsAppSDK-Build-Stage-Per-Platform.yml | 168 ++++++++++++++++++ .../WindowsAppSDK-Build-Stage.yml | 44 +++-- ...ndowsAppSDK-PackTransportPackage-Stage.yml | 2 +- .../WindowsAppSDK-Publish-Stage.yml | 2 +- 4 files changed, 196 insertions(+), 20 deletions(-) create mode 100644 build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml new file mode 100644 index 0000000000..f7ec1a9472 --- /dev/null +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml @@ -0,0 +1,168 @@ +parameters: +- name: "SignOutput" + type: boolean + default: false +- name: "IsOneBranch" + type: boolean + default: true +- name: runStaticAnalysis + type: boolean + default: true +- name: buildPlatform + type: string + default: x64 + +stages: +- stage: ${{ format('Build_{0}', parameters.buildPlatform) }} + # Skip the build job if we are reusing the output of a previous build. + # useBuildOutputFromBuildId variable is set on the Pipeline at Queue time. + condition: + eq(variables['useBuildOutputFromBuildId'],'') + dependsOn: [] + jobs: + - job: BuildFoundation + pool: + ${{ if parameters.IsOneBranch }}: + type: windows + ${{ if not( parameters.IsOneBranch ) }}: + type: windows + isCustom: true + name: 'ProjectReunionESPool-2022' + timeoutInMinutes: 120 + strategy: + maxParallel: 10 + matrix: + ${{ format('Release_{0}', parameters.buildPlatform) }}: + ${{ if ne(parameters.buildPlatform, 'arm64') }}: + buildPlatform: ${{ parameters.buildPlatform }} + buildConfiguration: 'release' + normalizedConfiguration: 'fre' + PGOBuildMode: 'Optimize' + ${{ else }}: + buildPlatform: ${{ parameters.buildPlatform }} + buildConfiguration: 'release' + normalizedConfiguration: 'fre' + variables: + - name: ob_outputDirectory + value: '$(REPOROOT)\out' + - name: ob_sdl_codeSignValidation_excludes + value: '-|**\Release\**;-|**\packages\**' + - name: ob_artifactBaseName + value: "FoundationBinaries_$(buildConfiguration)_$(buildPlatform)" + - name: ob_sdl_apiscan_enabled + ${{ if parameters.runStaticAnalysis }}: + value: true + ${{ else }}: + value: false + - name: ob_sdl_apiscan_softwareFolder + value: '$(build.SourcesDirectory)\APIScanTarget' + - name: ob_sdl_apiscan_symbolsFolder + value: '$(build.SourcesDirectory)\APIScanTarget;SRV*https://symweb.azurefd.net' + - template: AzurePipelinesTemplates/WindowsAppSDK-Global-LKGVersions.yml@WindowsAppSDKConfigSourceBranch + - name: localCompilerOverridePackageName + value: $[coalesce(variables.compilerOverridePackageName, variables.global_CompilerOverridePackageName)] + - name: localCompilerOverridePackageVersion + value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] + - name: localCompilerOverrideNupkgVersion + value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)] + steps: + - script: | + echo Build.SourceBranch=$(Build.SourceBranch) + echo Build.Reason=$(Build.Reason) + echo compilerOverridePackageName=$(compilerOverridePackageName) + echo compilerOverridePackageVersion=$(compilerOverridePackageVersion) + echo global_CompilerOverridePackageName=$(global_CompilerOverridePackageName) + echo global_CompilerOverridePackageVersion=$(global_CompilerOverridePackageVersion) + echo localCompilerOverridePackageName=$(localCompilerOverridePackageName) + echo localCompilerOverridePackageVersion=$(localCompilerOverridePackageVersion) + echo localCompilerOverrideNupkgVersion=$(localCompilerOverrideNupkgVersion) + echo System.PullRequest.targetBranchName=$(System.PullRequest.targetBranchName) + echo mySourceBranch=$(mySourceBranch) + + - template: WindowsAppSDK-BuildFoundation-Steps.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + IsOneBranch: ${{ parameters.IsOneBranch }} + runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + + # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" + # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- + # requisite of isNative=true isn't met currently. + - script: | + md "C:\__t\NativeCompilerPrefast" + displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' + + - job: BuildMRT + pool: + # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs + ${{ if parameters.IsOneBranch }}: + type: windows + ${{ if not( parameters.IsOneBranch ) }}: + type: windows + isCustom: true + name: 'ProjectReunionESPool-2022' + timeoutInMinutes: 120 + strategy: + maxParallel: 10 + matrix: + ${{ format('Release_{0}', parameters.buildPlatform) }}: + ${{ if ne(parameters.buildPlatform, 'arm64') }}: + buildPlatform: ${{ parameters.buildPlatform }} + buildConfiguration: 'Release' + normalizedConfiguration: 'fre' + PGOBuildMode: 'Optimize' + ${{ else }}: + buildPlatform: ${{ parameters.buildPlatform }} + buildConfiguration: 'Release' + normalizedConfiguration: 'fre' + variables: + - name: ob_outputDirectory + value: '$(REPOROOT)\out' + - name: ob_sdl_codeSignValidation_excludes + value: '-|**\Release\**' + - name: ob_sdl_suppression_suppressionSet + value: default + - name: ob_artifactBaseName + value: "MrtBinaries_$(buildConfiguration)_$(buildPlatform)" + - name: ob_sdl_apiscan_enabled + ${{ if parameters.runStaticAnalysis }}: + value: true + ${{ else }}: + value: false + - name: ob_sdl_apiscan_softwareFolder + value: '$(build.SourcesDirectory)\APIScanTarget' + - name: ob_sdl_apiscan_symbolsFolder + value: '$(build.SourcesDirectory)\APIScanTarget;SRV*https://symweb.azurefd.net' + - template: AzurePipelinesTemplates/WindowsAppSDK-Global-LKGVersions.yml@WindowsAppSDKConfigSourceBranch + - name: localCompilerOverridePackageName + value: $[coalesce(variables.compilerOverridePackageName, variables.global_CompilerOverridePackageName)] + - name: localCompilerOverridePackageVersion + value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] + - name: localCompilerOverrideNupkgVersion + value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)] + steps: + - script: | + echo Build.SourceBranch=$(Build.SourceBranch) + echo Build.Reason=$(Build.Reason) + echo compilerOverridePackageName=$(compilerOverridePackageName) + echo compilerOverridePackageVersion=$(compilerOverridePackageVersion) + echo global_CompilerOverridePackageName=$(global_CompilerOverridePackageName) + echo global_CompilerOverridePackageVersion=$(global_CompilerOverridePackageVersion) + echo localCompilerOverridePackageName=$(localCompilerOverridePackageName) + echo localCompilerOverridePackageVersion=$(localCompilerOverridePackageVersion) + echo localCompilerOverrideNupkgVersion=$(localCompilerOverrideNupkgVersion) + echo System.PullRequest.targetBranchName=$(System.PullRequest.targetBranchName) + echo mySourceBranch=$(mySourceBranch) + + - template: WindowsAppSDK-BuildMRT-Steps.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + IsOneBranch: ${{ parameters.IsOneBranch }} + runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + + # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" + # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- + # requisite of isNative=true isn't met currently. + - script: | + md "C:\__t\NativeCompilerPrefast" + displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' \ No newline at end of file diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml index 9c8fc4d88a..78596326c7 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml @@ -5,12 +5,15 @@ parameters: - name: "IsOneBranch" type: boolean default: true -- name: runStaticAnalysis +- name: runApiScan type: boolean default: true +- name: runPREfast + type: boolean + default: false stages: -- stage: Build_AnyCPU +- stage: ${{ iif(parameters.runPREfast, 'PREfast_AnyCPU', 'Build_AnyCPU') }} # Skip the build job if we are reusing the output of a previous build. # useBuildOutputFromBuildId variable is set on the Pipeline at Queue time. condition: @@ -44,9 +47,9 @@ stages: ob_outputDirectory: '$(REPOROOT)\out' ob_sdl_codeSignValidation_excludes: '-|**\Release\**' ob_artifactBaseName: "FoundationBinaries_release_anycpu" - ${{ if parameters.runStaticAnalysis }}: + ${{ if parameters.runApiScan }}: ob_sdl_apiscan_enabled: true - ${{ if not( parameters.runStaticAnalysis ) }}: + ${{ if not( parameters.runApiScan ) }}: ob_sdl_apiscan_enabled: false ob_sdl_apiscan_softwareFolder: '$(build.SourcesDirectory)\BuildOutput\Release\AnyCPU' ob_sdl_apiscan_symbolsFolder: '$(build.SourcesDirectory)\BuildOutput\Release\AnyCPU;SRV*https://symweb.azurefd.net' @@ -55,7 +58,7 @@ stages: parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + runPREfast : ${{ parameters.runPREfast }} # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- @@ -65,23 +68,28 @@ stages: displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' # extract BuildFoundation and BuildMRT into WindowsAppSDK-Build-Stage-Per-Platform.yml. Separate the build stage per platform -- template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self - parameters: - SignOutput: ${{ parameters.SignOutput }} - IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} - BuildPlatform: x86 - template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + runPREfast : ${{ parameters.runPREfast }} + runApiScan : ${{ parameters.runApiScan }} BuildPlatform: x64 -- template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self - parameters: - SignOutput: ${{ parameters.SignOutput }} - IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} - BuildPlatform: arm64 \ No newline at end of file +- ${{ if not(parameters.runPREfast) }}: + - template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + IsOneBranch: ${{ parameters.IsOneBranch }} + runPREfast : ${{ parameters.runPREfast }} + runApiScan : ${{ parameters.runApiScan }} + BuildPlatform: x86 + + - template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + IsOneBranch: ${{ parameters.IsOneBranch }} + runPREfast : ${{ parameters.runPREfast }} + runApiScan : ${{ parameters.runApiScan }} + BuildPlatform: arm64 \ No newline at end of file diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml index ece9a02f9a..404675dbb8 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml @@ -272,4 +272,4 @@ stages: verbosityPush: 'Detailed' nuGetFeedType: 'internal' #Note: The project qualifier is always required when using a feed name. Also, do not use organization scoped feeds. - publishVstsFeed: 'ProjectReunion/Project.Reunion.nuget.internal' + publishVstsFeed: 'ProjectReunion/Project.Reunion.nuget.internal' \ No newline at end of file diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml index 2c0ff5b78b..09d5695573 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml @@ -27,4 +27,4 @@ stages: - template: AzurePipelinesTemplates/WindowsAppSDK-PublishToMaestro-Steps.yml@WindowsAppSDKConfig parameters: NuGetArtifactNames: - - 'TransportPackage' + - 'TransportPackage' \ No newline at end of file From a7611e83aaee360250791cf1c4e1044f61fb9135 Mon Sep 17 00:00:00 2001 From: "Haonan Tang (from Dev Box)" Date: Wed, 23 Apr 2025 15:30:17 +0800 Subject: [PATCH 22/31] debug --- .../WindowsAppSDK-RunTestsInPipeline-Job.yml | 2 +- build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml index a97d1c130d..099d08bba3 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml @@ -62,4 +62,4 @@ jobs: buildPlatform: $(buildPlatform) buildConfiguration: $(buildConfiguration) testLocale: $(testLocale) - ImageName: $(imageName) \ No newline at end of file + ImageName: $(imageName) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml index 89706f5d08..d7fa43a64e 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml @@ -27,4 +27,4 @@ stages: parameters: jobName: PipelineTests testMatrix: ${{ parameters.testMatrix }} # testMatrix is supplied by WindowsAppSDKConfig/WindowsAppSDK-Foundation-TestConfig.yml - buildPlatform: arm64 \ No newline at end of file + buildPlatform: arm64 From b5eb16170c20c34fc665c6789d1438a725481278 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Fri, 25 Apr 2025 15:21:52 +0800 Subject: [PATCH 23/31] change --- .../WindowsAppSDK-Build-Stage-Per-Platform.yml | 2 +- build/ProjectReunion-BuildFoundation.yml | 6 ++++++ build/WindowsAppSDK-Foundation-Nightly.yml | 6 ++++++ build/WindowsAppSDK-Foundation-Official.yml | 6 ++++++ build/WindowsAppSDK-Foundation-PR.yml | 8 +++++++- 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml index f7ec1a9472..2e2372e821 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml @@ -13,7 +13,7 @@ parameters: default: x64 stages: -- stage: ${{ format('Build_{0}', parameters.buildPlatform) }} +- stage: ${{ format(iif(parameters.runStaticAnalysis, 'BuildWithStaticAnalysis_{0}', 'Build_{0}'), parameters.buildPlatform) }} # Skip the build job if we are reusing the output of a previous build. # useBuildOutputFromBuildId variable is set on the Pipeline at Queue time. condition: diff --git a/build/ProjectReunion-BuildFoundation.yml b/build/ProjectReunion-BuildFoundation.yml index 77b6762815..0164cf4eda 100644 --- a/build/ProjectReunion-BuildFoundation.yml +++ b/build/ProjectReunion-BuildFoundation.yml @@ -27,6 +27,12 @@ stages: - template: AzurePipelinesTemplates\WindowsAppSDK-BuildVSIX-Stage.yml@self +- template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self + parameters: + SignOutput: false + IsOneBranch: false + runStaticAnalysis: false + - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: false diff --git a/build/WindowsAppSDK-Foundation-Nightly.yml b/build/WindowsAppSDK-Foundation-Nightly.yml index b2daef0211..f3f7d09113 100644 --- a/build/WindowsAppSDK-Foundation-Nightly.yml +++ b/build/WindowsAppSDK-Foundation-Nightly.yml @@ -113,6 +113,12 @@ extends: stages: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + runStaticAnalysis : false + + - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: + - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} runStaticAnalysis : ${{ parameters.runStaticAnalysis }} diff --git a/build/WindowsAppSDK-Foundation-Official.yml b/build/WindowsAppSDK-Foundation-Official.yml index 6ffdbf6fbc..4fc58e237e 100644 --- a/build/WindowsAppSDK-Foundation-Official.yml +++ b/build/WindowsAppSDK-Foundation-Official.yml @@ -98,6 +98,12 @@ extends: stages: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self + parameters: + SignOutput: ${{ parameters.SignOutput }} + runStaticAnalysis : false + + - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: + - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} runStaticAnalysis : ${{ parameters.runStaticAnalysis }} diff --git a/build/WindowsAppSDK-Foundation-PR.yml b/build/WindowsAppSDK-Foundation-PR.yml index 280d3b667c..9de344961b 100644 --- a/build/WindowsAppSDK-Foundation-PR.yml +++ b/build/WindowsAppSDK-Foundation-PR.yml @@ -92,7 +92,13 @@ extends: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: false - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + runStaticAnalysis: false + + - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: + - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self + parameters: + SignOutput: false + runStaticAnalysis: ${{ parameters.runStaticAnalysis }} - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: From a63c3eb8d0f63046cf0a060627fba9e985e878ce Mon Sep 17 00:00:00 2001 From: "Haonan Tang (from Dev Box)" Date: Fri, 25 Apr 2025 14:40:08 +0800 Subject: [PATCH 24/31] rename yml file and pass runStaticAnalysis parameter into WindowsAppSDK-Build-Per-Platform-Stage.yml --- ...WindowsAppSDK-Build-Stage-Per-Platform.yml | 168 ------------------ .../WindowsAppSDK-Build-Stage.yml | 2 +- 2 files changed, 1 insertion(+), 169 deletions(-) delete mode 100644 build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml deleted file mode 100644 index 2e2372e821..0000000000 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage-Per-Platform.yml +++ /dev/null @@ -1,168 +0,0 @@ -parameters: -- name: "SignOutput" - type: boolean - default: false -- name: "IsOneBranch" - type: boolean - default: true -- name: runStaticAnalysis - type: boolean - default: true -- name: buildPlatform - type: string - default: x64 - -stages: -- stage: ${{ format(iif(parameters.runStaticAnalysis, 'BuildWithStaticAnalysis_{0}', 'Build_{0}'), parameters.buildPlatform) }} - # Skip the build job if we are reusing the output of a previous build. - # useBuildOutputFromBuildId variable is set on the Pipeline at Queue time. - condition: - eq(variables['useBuildOutputFromBuildId'],'') - dependsOn: [] - jobs: - - job: BuildFoundation - pool: - ${{ if parameters.IsOneBranch }}: - type: windows - ${{ if not( parameters.IsOneBranch ) }}: - type: windows - isCustom: true - name: 'ProjectReunionESPool-2022' - timeoutInMinutes: 120 - strategy: - maxParallel: 10 - matrix: - ${{ format('Release_{0}', parameters.buildPlatform) }}: - ${{ if ne(parameters.buildPlatform, 'arm64') }}: - buildPlatform: ${{ parameters.buildPlatform }} - buildConfiguration: 'release' - normalizedConfiguration: 'fre' - PGOBuildMode: 'Optimize' - ${{ else }}: - buildPlatform: ${{ parameters.buildPlatform }} - buildConfiguration: 'release' - normalizedConfiguration: 'fre' - variables: - - name: ob_outputDirectory - value: '$(REPOROOT)\out' - - name: ob_sdl_codeSignValidation_excludes - value: '-|**\Release\**;-|**\packages\**' - - name: ob_artifactBaseName - value: "FoundationBinaries_$(buildConfiguration)_$(buildPlatform)" - - name: ob_sdl_apiscan_enabled - ${{ if parameters.runStaticAnalysis }}: - value: true - ${{ else }}: - value: false - - name: ob_sdl_apiscan_softwareFolder - value: '$(build.SourcesDirectory)\APIScanTarget' - - name: ob_sdl_apiscan_symbolsFolder - value: '$(build.SourcesDirectory)\APIScanTarget;SRV*https://symweb.azurefd.net' - - template: AzurePipelinesTemplates/WindowsAppSDK-Global-LKGVersions.yml@WindowsAppSDKConfigSourceBranch - - name: localCompilerOverridePackageName - value: $[coalesce(variables.compilerOverridePackageName, variables.global_CompilerOverridePackageName)] - - name: localCompilerOverridePackageVersion - value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] - - name: localCompilerOverrideNupkgVersion - value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)] - steps: - - script: | - echo Build.SourceBranch=$(Build.SourceBranch) - echo Build.Reason=$(Build.Reason) - echo compilerOverridePackageName=$(compilerOverridePackageName) - echo compilerOverridePackageVersion=$(compilerOverridePackageVersion) - echo global_CompilerOverridePackageName=$(global_CompilerOverridePackageName) - echo global_CompilerOverridePackageVersion=$(global_CompilerOverridePackageVersion) - echo localCompilerOverridePackageName=$(localCompilerOverridePackageName) - echo localCompilerOverridePackageVersion=$(localCompilerOverridePackageVersion) - echo localCompilerOverrideNupkgVersion=$(localCompilerOverrideNupkgVersion) - echo System.PullRequest.targetBranchName=$(System.PullRequest.targetBranchName) - echo mySourceBranch=$(mySourceBranch) - - - template: WindowsAppSDK-BuildFoundation-Steps.yml@self - parameters: - SignOutput: ${{ parameters.SignOutput }} - IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} - - # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" - # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- - # requisite of isNative=true isn't met currently. - - script: | - md "C:\__t\NativeCompilerPrefast" - displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' - - - job: BuildMRT - pool: - # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs - ${{ if parameters.IsOneBranch }}: - type: windows - ${{ if not( parameters.IsOneBranch ) }}: - type: windows - isCustom: true - name: 'ProjectReunionESPool-2022' - timeoutInMinutes: 120 - strategy: - maxParallel: 10 - matrix: - ${{ format('Release_{0}', parameters.buildPlatform) }}: - ${{ if ne(parameters.buildPlatform, 'arm64') }}: - buildPlatform: ${{ parameters.buildPlatform }} - buildConfiguration: 'Release' - normalizedConfiguration: 'fre' - PGOBuildMode: 'Optimize' - ${{ else }}: - buildPlatform: ${{ parameters.buildPlatform }} - buildConfiguration: 'Release' - normalizedConfiguration: 'fre' - variables: - - name: ob_outputDirectory - value: '$(REPOROOT)\out' - - name: ob_sdl_codeSignValidation_excludes - value: '-|**\Release\**' - - name: ob_sdl_suppression_suppressionSet - value: default - - name: ob_artifactBaseName - value: "MrtBinaries_$(buildConfiguration)_$(buildPlatform)" - - name: ob_sdl_apiscan_enabled - ${{ if parameters.runStaticAnalysis }}: - value: true - ${{ else }}: - value: false - - name: ob_sdl_apiscan_softwareFolder - value: '$(build.SourcesDirectory)\APIScanTarget' - - name: ob_sdl_apiscan_symbolsFolder - value: '$(build.SourcesDirectory)\APIScanTarget;SRV*https://symweb.azurefd.net' - - template: AzurePipelinesTemplates/WindowsAppSDK-Global-LKGVersions.yml@WindowsAppSDKConfigSourceBranch - - name: localCompilerOverridePackageName - value: $[coalesce(variables.compilerOverridePackageName, variables.global_CompilerOverridePackageName)] - - name: localCompilerOverridePackageVersion - value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] - - name: localCompilerOverrideNupkgVersion - value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)] - steps: - - script: | - echo Build.SourceBranch=$(Build.SourceBranch) - echo Build.Reason=$(Build.Reason) - echo compilerOverridePackageName=$(compilerOverridePackageName) - echo compilerOverridePackageVersion=$(compilerOverridePackageVersion) - echo global_CompilerOverridePackageName=$(global_CompilerOverridePackageName) - echo global_CompilerOverridePackageVersion=$(global_CompilerOverridePackageVersion) - echo localCompilerOverridePackageName=$(localCompilerOverridePackageName) - echo localCompilerOverridePackageVersion=$(localCompilerOverridePackageVersion) - echo localCompilerOverrideNupkgVersion=$(localCompilerOverrideNupkgVersion) - echo System.PullRequest.targetBranchName=$(System.PullRequest.targetBranchName) - echo mySourceBranch=$(mySourceBranch) - - - template: WindowsAppSDK-BuildMRT-Steps.yml@self - parameters: - SignOutput: ${{ parameters.SignOutput }} - IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} - - # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" - # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- - # requisite of isNative=true isn't met currently. - - script: | - md "C:\__t\NativeCompilerPrefast" - displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast' \ No newline at end of file diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml index 78596326c7..a4b179a8e8 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml @@ -92,4 +92,4 @@ stages: IsOneBranch: ${{ parameters.IsOneBranch }} runPREfast : ${{ parameters.runPREfast }} runApiScan : ${{ parameters.runApiScan }} - BuildPlatform: arm64 \ No newline at end of file + BuildPlatform: arm64 From d840e88b5504e03f1d6de6ed79d5dddc549d99ca Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Mon, 28 Apr 2025 16:28:31 +0800 Subject: [PATCH 25/31] resolve comments on formatting --- build/ProjectReunion-BuildFoundation.yml | 1 + build/WindowsAppSDK-Foundation-Nightly.yml | 8 ++++---- build/WindowsAppSDK-Foundation-Official.yml | 8 ++++---- build/WindowsAppSDK-Foundation-PR.yml | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/build/ProjectReunion-BuildFoundation.yml b/build/ProjectReunion-BuildFoundation.yml index 0164cf4eda..9e4ba715ed 100644 --- a/build/ProjectReunion-BuildFoundation.yml +++ b/build/ProjectReunion-BuildFoundation.yml @@ -37,6 +37,7 @@ stages: parameters: SignOutput: false IsOneBranch: false + runStaticAnalysis: true - template: AzurePipelinesTemplates\WindowsAppSDK-Test-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-Nightly.yml b/build/WindowsAppSDK-Foundation-Nightly.yml index f3f7d09113..bcb54fc090 100644 --- a/build/WindowsAppSDK-Foundation-Nightly.yml +++ b/build/WindowsAppSDK-Foundation-Nightly.yml @@ -115,13 +115,13 @@ extends: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis : false + runStaticAnalysis: false - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self - parameters: - SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + parameters: + SignOutput: ${{ parameters.SignOutput }} + runStaticAnalysis: true - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-Official.yml b/build/WindowsAppSDK-Foundation-Official.yml index 4fc58e237e..2cb09bcb00 100644 --- a/build/WindowsAppSDK-Foundation-Official.yml +++ b/build/WindowsAppSDK-Foundation-Official.yml @@ -100,13 +100,13 @@ extends: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis : false + runStaticAnalysis: false - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self - parameters: - SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + parameters: + SignOutput: ${{ parameters.SignOutput }} + runStaticAnalysis: true - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-PR.yml b/build/WindowsAppSDK-Foundation-PR.yml index 9de344961b..4afeee0fa7 100644 --- a/build/WindowsAppSDK-Foundation-PR.yml +++ b/build/WindowsAppSDK-Foundation-PR.yml @@ -96,9 +96,9 @@ extends: - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self - parameters: - SignOutput: false - runStaticAnalysis: ${{ parameters.runStaticAnalysis }} + parameters: + SignOutput: false + runStaticAnalysis: true - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: From b41e43a288510e2479be6c420139706eaff760c9 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Fri, 2 May 2025 17:20:24 +0800 Subject: [PATCH 26/31] run prefast for all arch --- .../WindowsAppSDK-BuildFoundation-Steps.yml | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml index cb31691735..ec4603905e 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml @@ -65,27 +65,28 @@ steps: ucrtFeedPat: $(System.AccessToken) platform: $(buildPlatform) -- task: PowerShell@2 - name: BuildFoundation - inputs: - filePath: 'BuildAll.ps1' - arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildFoundation" - -- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: +- ${{ if and(eq(parameters.runStaticAnalysis, 'true'), eq(variables['buildConfiguration'], 'Release')) }}: - task: SDLNativeRules@3 displayName: Run PREfast SDL Native Rules - condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'), eq(variables['buildPlatform'], 'x64')) + # condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'), eq(variables['buildPlatform'], 'x64')) inputs: setupCommandlines: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat"' - msBuildArchitecture: amd64 - msBuildCommandline: 'msbuild.exe /restore /nologo /nr:false /p:configuration=Release /p:platform=x64 $(Build.SourcesDirectory)\WindowsAppRuntime.sln' + # msBuildArchitecture: amd64 + msBuildCommandline: 'msbuild.exe /restore /nologo /nr:false /p:configuration=Release /p:platform=$(buildPlatform) $(Build.SourcesDirectory)\WindowsAppRuntime.sln' # Generally speaking, we leave it to the external repos to scan the bits in their packages. excludedPaths: | $(Build.SourcesDirectory)\packages env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) continueOnError: true +- ${{ else }}: + - task: PowerShell@2 + name: BuildFoundation + inputs: + filePath: 'BuildAll.ps1' + arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildFoundation" +- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: # Copy build output to folder APIScanTarget for APIScan to scan later, in the mean time, exclude some folders/files. - task: CopyFiles@2 displayName: Populate APIScanTarget From 00b80f40dcecac1be22eb85a62a94e7b0a514838 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Fri, 2 May 2025 18:17:30 +0800 Subject: [PATCH 27/31] test run for static analysis for all archs --- .../WindowsAppSDK-BuildFoundation-Steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml index ec4603905e..8b12855560 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml @@ -65,7 +65,7 @@ steps: ucrtFeedPat: $(System.AccessToken) platform: $(buildPlatform) -- ${{ if and(eq(parameters.runStaticAnalysis, 'true'), eq(variables['buildConfiguration'], 'Release')) }}: +- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - task: SDLNativeRules@3 displayName: Run PREfast SDL Native Rules # condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'), eq(variables['buildPlatform'], 'x64')) From 1fd2dfeac4d1128381bcfac21d1472e0986eb8c1 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Fri, 2 May 2025 19:27:01 +0800 Subject: [PATCH 28/31] fix errors testing prefast for all arch --- .../WindowsAppSDK-BuildFoundation-Steps.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml index 8b12855560..94d4b645f1 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml @@ -65,13 +65,19 @@ steps: ucrtFeedPat: $(System.AccessToken) platform: $(buildPlatform) +- task: PowerShell@2 + name: BuildFoundation + inputs: + filePath: 'BuildAll.ps1' + arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildFoundation" + - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - task: SDLNativeRules@3 displayName: Run PREfast SDL Native Rules - # condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'), eq(variables['buildPlatform'], 'x64')) + condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release')) inputs: setupCommandlines: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat"' - # msBuildArchitecture: amd64 + # BuildArchitecture: amd64 msBuildCommandline: 'msbuild.exe /restore /nologo /nr:false /p:configuration=Release /p:platform=$(buildPlatform) $(Build.SourcesDirectory)\WindowsAppRuntime.sln' # Generally speaking, we leave it to the external repos to scan the bits in their packages. excludedPaths: | @@ -79,14 +85,7 @@ steps: env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) continueOnError: true -- ${{ else }}: - - task: PowerShell@2 - name: BuildFoundation - inputs: - filePath: 'BuildAll.ps1' - arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildFoundation" -- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: # Copy build output to folder APIScanTarget for APIScan to scan later, in the mean time, exclude some folders/files. - task: CopyFiles@2 displayName: Populate APIScanTarget From e758afec69fb1b485a319a8727a8fc13844024ee Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Wed, 7 May 2025 10:56:33 +0800 Subject: [PATCH 29/31] separate out PREfast and only runs for x64 --- .../WindowsAppSDK-Build-Per-Platform-Stage.yml | 18 +++++++++++++----- ...dowsAppSDK-BuildFoundation-AnyCPU-Steps.yml | 6 +++--- .../WindowsAppSDK-BuildFoundation-Steps.yml | 14 +++++++++----- .../WindowsAppSDK-BuildMRT-Steps.yml | 8 ++++++-- build/ProjectReunion-BuildFoundation.yml | 6 ++++-- build/WindowsAppSDK-Foundation-Nightly.yml | 6 ++++-- build/WindowsAppSDK-Foundation-Official.yml | 7 +++++-- build/WindowsAppSDK-Foundation-PR.yml | 6 ++++-- 8 files changed, 48 insertions(+), 23 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml index f7ec1a9472..aaff107c46 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml @@ -8,6 +8,12 @@ parameters: - name: runStaticAnalysis type: boolean default: true +- name: runApiScan + type: boolean + default: true +- name: runPREfast + type: boolean + default: false - name: buildPlatform type: string default: x64 @@ -50,7 +56,7 @@ stages: - name: ob_artifactBaseName value: "FoundationBinaries_$(buildConfiguration)_$(buildPlatform)" - name: ob_sdl_apiscan_enabled - ${{ if parameters.runStaticAnalysis }}: + ${{ if parameters.runApiScan }}: value: true ${{ else }}: value: false @@ -62,7 +68,7 @@ stages: - name: localCompilerOverridePackageName value: $[coalesce(variables.compilerOverridePackageName, variables.global_CompilerOverridePackageName)] - name: localCompilerOverridePackageVersion - value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] + value: $[coalesce(variables.compiflerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] - name: localCompilerOverrideNupkgVersion value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)] steps: @@ -83,7 +89,8 @@ stages: parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + runApiScan: ${{ parameters.runApiScan }} + runPREfast: ${{ parameters.runPREfast }} # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- @@ -125,7 +132,7 @@ stages: - name: ob_artifactBaseName value: "MrtBinaries_$(buildConfiguration)_$(buildPlatform)" - name: ob_sdl_apiscan_enabled - ${{ if parameters.runStaticAnalysis }}: + ${{ if parameters.runApiScan }}: value: true ${{ else }}: value: false @@ -158,7 +165,8 @@ stages: parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} - runStaticAnalysis : ${{ parameters.runStaticAnalysis }} + runPREfast : ${{ parameters.runPREfast }} + runApiScan : ${{ parameters.runApiScan }} # This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found" # errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre- diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml index cd997c4bcd..41d66881cd 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml @@ -5,9 +5,9 @@ parameters: - name: "IsOneBranch" type: boolean default: true -- name: runStaticAnalysis +- name: runPREfast type: boolean - default: true + default: false steps: - task: NuGetAuthenticate@1 @@ -30,7 +30,7 @@ steps: filePath: 'BuildAll.ps1' arguments: -AzureBuildStep "BuildAnyCPU" -- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: +- ${{ if eq(parameters.runPREfast, 'true') }}: - task: SDLNativeRules@3 displayName: Run PREfast SDL Native Rules inputs: diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml index 94d4b645f1..9f3faf00c3 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml @@ -5,9 +5,12 @@ parameters: - name: "IsOneBranch" type: boolean default: true -- name: runStaticAnalysis +- name: runApiScan type: boolean default: true +- name: runPREfast + type: boolean + default: false steps: - task: NuGetAuthenticate@1 @@ -71,14 +74,14 @@ steps: filePath: 'BuildAll.ps1' arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildFoundation" -- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: +- ${{ if eq(parameters.runPREfast, 'true') }}: - task: SDLNativeRules@3 displayName: Run PREfast SDL Native Rules - condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release')) + condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'), eq(variables['buildPlatform'], 'x64')) inputs: setupCommandlines: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat"' - # BuildArchitecture: amd64 - msBuildCommandline: 'msbuild.exe /restore /nologo /nr:false /p:configuration=Release /p:platform=$(buildPlatform) $(Build.SourcesDirectory)\WindowsAppRuntime.sln' + msBuildArchitecture: amd64 + msBuildCommandline: 'msbuild.exe /restore /nologo /nr:false /p:configuration=Release /p:platform=x64 $(Build.SourcesDirectory)\WindowsAppRuntime.sln' # Generally speaking, we leave it to the external repos to scan the bits in their packages. excludedPaths: | $(Build.SourcesDirectory)\packages @@ -86,6 +89,7 @@ steps: SYSTEM_ACCESSTOKEN: $(System.AccessToken) continueOnError: true +- ${{ if eq(parameters.runApiScan, 'true') }}: # Copy build output to folder APIScanTarget for APIScan to scan later, in the mean time, exclude some folders/files. - task: CopyFiles@2 displayName: Populate APIScanTarget diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml index ee6e6cb978..6c3e2f268b 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml @@ -5,9 +5,12 @@ parameters: - name: "IsOneBranch" type: boolean default: true -- name: runStaticAnalysis +- name: runApiScan type: boolean default: true +- name: runPREfast + type: boolean + default: false steps: - template: WindowsAppSDK-SetupBuildEnvironment-Steps.yml @@ -32,7 +35,7 @@ steps: filePath: 'BuildAll.ps1' arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildMRT" -- ${{ if eq(parameters.runStaticAnalysis, 'true') }}: +- ${{ if eq(parameters.runPREfast, 'true') }}: - task: SDLNativeRules@3 displayName: Run PREfast SDL Native Rules condition: and(succeeded(), eq(variables['buildPlatform'], 'x64'), eq(variables['buildConfiguration'], 'Release')) @@ -47,6 +50,7 @@ steps: SYSTEM_ACCESSTOKEN: $(System.AccessToken) continueOnError: true +- ${{ if eq(parameters.runApiScan, 'true') }}: # Copy build output to folder APIScanTarget for APIScan to scan, in the mean time, exclude some folders/files. - task: CopyFiles@2 displayName: Populate APIScanTarget diff --git a/build/ProjectReunion-BuildFoundation.yml b/build/ProjectReunion-BuildFoundation.yml index 9e4ba715ed..bd224bec1a 100644 --- a/build/ProjectReunion-BuildFoundation.yml +++ b/build/ProjectReunion-BuildFoundation.yml @@ -31,13 +31,15 @@ stages: parameters: SignOutput: false IsOneBranch: false - runStaticAnalysis: false + runApiScan: true + runPREFast: false - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: false IsOneBranch: false - runStaticAnalysis: true + runApiScan: false + runPREFast: true - template: AzurePipelinesTemplates\WindowsAppSDK-Test-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-Nightly.yml b/build/WindowsAppSDK-Foundation-Nightly.yml index bcb54fc090..4f4dd0b2e4 100644 --- a/build/WindowsAppSDK-Foundation-Nightly.yml +++ b/build/WindowsAppSDK-Foundation-Nightly.yml @@ -115,13 +115,15 @@ extends: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis: false + runApiScan: ${{ parameters.runStaticAnalysis }} + runPREFast: false - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis: true + runApiScan: false + runPREFast: true - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-Official.yml b/build/WindowsAppSDK-Foundation-Official.yml index 2cb09bcb00..69f8fa6bc0 100644 --- a/build/WindowsAppSDK-Foundation-Official.yml +++ b/build/WindowsAppSDK-Foundation-Official.yml @@ -97,16 +97,19 @@ extends: break: false stages: + - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis: false + runApiScan: ${{ parameters.runStaticAnalysis }} + runPREFast: false - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} - runStaticAnalysis: true + runApiScan: false + runPREFast: true - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: diff --git a/build/WindowsAppSDK-Foundation-PR.yml b/build/WindowsAppSDK-Foundation-PR.yml index 4afeee0fa7..24920e328f 100644 --- a/build/WindowsAppSDK-Foundation-PR.yml +++ b/build/WindowsAppSDK-Foundation-PR.yml @@ -92,13 +92,15 @@ extends: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: false - runStaticAnalysis: false + runApiScan: ${{ parameters.runStaticAnalysis }} + runPREFast: false - ${{ if eq(parameters.runStaticAnalysis, 'true') }}: - template: AzurePipelinesTemplates\WindowsAppSDK-Build-Stage.yml@self parameters: SignOutput: false - runStaticAnalysis: true + runApiScan: false + runPREFast: true - template: AzurePipelinesTemplates\WindowsAppSDK-PackTransportPackage-Stage.yml@self parameters: From b24a7c0d507b9af2e6b3992224016b202ab4e666 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Wed, 7 May 2025 13:26:06 +0800 Subject: [PATCH 30/31] clean up unused parameter --- .../WindowsAppSDK-Build-Per-Platform-Stage.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml index aaff107c46..fb382f6939 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml @@ -5,9 +5,6 @@ parameters: - name: "IsOneBranch" type: boolean default: true -- name: runStaticAnalysis - type: boolean - default: true - name: runApiScan type: boolean default: true From bcb282702d90ae9a43a9e45a34ca7e63c192b511 Mon Sep 17 00:00:00 2001 From: "Muyuan Li (from Dev Box)" Date: Wed, 7 May 2025 15:23:24 +0800 Subject: [PATCH 31/31] delete unwanted typo --- .../WindowsAppSDK-Build-Per-Platform-Stage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml index fb382f6939..528e6b30d0 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml @@ -65,7 +65,7 @@ stages: - name: localCompilerOverridePackageName value: $[coalesce(variables.compilerOverridePackageName, variables.global_CompilerOverridePackageName)] - name: localCompilerOverridePackageVersion - value: $[coalesce(variables.compiflerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] + value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)] - name: localCompilerOverrideNupkgVersion value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)] steps: