Skip to content

Commit f306fcb

Browse files
committed
Merge branch 'main' of github.com:microsoft/WindowsAppSDK into user/DinahK-2SO/StoragePickers_errorHandling
2 parents ae1e279 + 6549492 commit f306fcb

18 files changed

+148
-87
lines changed

build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ parameters:
1414
- name: buildPlatform
1515
type: string
1616
default: x64
17+
- name: testMatrix
18+
type: string
19+
default: ''
1720

1821
stages:
1922
- stage: ${{ format(iif(parameters.runPREfast, 'PREfast_{0}', 'Build_{0}'), parameters.buildPlatform) }}
@@ -75,6 +78,12 @@ stages:
7578
value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)]
7679
- name: localCompilerOverrideNupkgVersion
7780
value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)]
81+
- name: ob_sdl_checkCompliantCompilerWarnings
82+
value: true # This setting has no effect unless ob_sdl_msbuildOverride below is also set to true.
83+
- name: ob_sdl_prefast_runDuring
84+
value: 'Guardian' # The default 'Build' setting does not match the fact that we are calling msbuild.exe directly.
85+
- name: ob_sdl_msbuildOverride
86+
value: true # Because we are calling MSBuild directly instead of through the MSBuild@1 or VSBuild@1 tasks.
7887
steps:
7988
- script: |
8089
echo Build.SourceBranch=$(Build.SourceBranch)
@@ -88,6 +97,9 @@ stages:
8897
echo localCompilerOverrideNupkgVersion=$(localCompilerOverrideNupkgVersion)
8998
echo System.PullRequest.targetBranchName=$(System.PullRequest.targetBranchName)
9099
echo mySourceBranch=$(mySourceBranch)
100+
echo ob_sdl_msbuildOverride=$(ob_sdl_msbuildOverride)
101+
echo ob_sdl_prefast_runDuring=$(ob_sdl_prefast_runDuring)
102+
echo ob_sdl_checkCompliantCompilerWarnings=$(ob_sdl_checkCompliantCompilerWarnings)
91103
92104
- template: WindowsAppSDK-BuildFoundation-Steps.yml@self
93105
parameters:
@@ -96,13 +108,6 @@ stages:
96108
runApiScan: ${{ parameters.runApiScan }}
97109
runPREfast: ${{ parameters.runPREfast }}
98110

99-
# This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found"
100-
# errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre-
101-
# requisite of isNative=true isn't met currently.
102-
- script: |
103-
md "C:\__t\NativeCompilerPrefast"
104-
displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast'
105-
106111
- job: BuildMRT
107112
pool:
108113
# read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs
@@ -158,6 +163,12 @@ stages:
158163
value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)]
159164
- name: localCompilerOverrideNupkgVersion
160165
value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)]
166+
- name: ob_sdl_checkCompliantCompilerWarnings
167+
value: true # This setting has no effect unless ob_sdl_msbuildOverride below is also set to true.
168+
- name: ob_sdl_prefast_runDuring
169+
value: 'Guardian' # The default 'Build' setting does not match the fact that we are calling msbuild.exe directly.
170+
- name: ob_sdl_msbuildOverride
171+
value: true # Because we are calling MSBuild directly instead of through the MSBuild@1 or VSBuild@1 tasks.
161172
steps:
162173
- script: |
163174
echo Build.SourceBranch=$(Build.SourceBranch)
@@ -171,6 +182,9 @@ stages:
171182
echo localCompilerOverrideNupkgVersion=$(localCompilerOverrideNupkgVersion)
172183
echo System.PullRequest.targetBranchName=$(System.PullRequest.targetBranchName)
173184
echo mySourceBranch=$(mySourceBranch)
185+
echo ob_sdl_msbuildOverride=$(ob_sdl_msbuildOverride)
186+
echo ob_sdl_prefast_runDuring=$(ob_sdl_prefast_runDuring)
187+
echo ob_sdl_checkCompliantCompilerWarnings=$(ob_sdl_checkCompliantCompilerWarnings)
174188
175189
- template: WindowsAppSDK-BuildMRT-Steps.yml@self
176190
parameters:
@@ -179,9 +193,25 @@ stages:
179193
runPREfast : ${{ parameters.runPREfast }}
180194
runApiScan : ${{ parameters.runApiScan }}
181195

182-
# This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found"
183-
# errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre-
184-
# requisite of isNative=true isn't met currently.
185-
- script: |
186-
md "C:\__t\NativeCompilerPrefast"
187-
displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast'
196+
- job: ExtractMatrix
197+
pool:
198+
type: windows
199+
isCustom: true
200+
name: 'ProjectReunionESPool-2022'
201+
steps:
202+
- powershell: |
203+
$testMatrix = "${{ parameters.testMatrix }}" | ConvertFrom-Json
204+
$targetPlatform = "${{ parameters.buildPlatform }}"
205+
$filteredMatrix = @{}
206+
foreach ($entry in $testMatrix.PSObject.Properties) {
207+
if ($entry.Value.buildPlatform -eq $targetPlatform) {
208+
$filteredMatrix[$entry.Name] = $entry.Value
209+
}
210+
}
211+
$matrixJson = $filteredMatrix | ConvertTo-Json -Compress
212+
Write-Host "##vso[task.setvariable variable=filteredTestMatrix;isOutput=true]$matrixJson"
213+
name: filterByPlatformStep
214+
displayName: "Extract matrix as json value filtering by build platform"
215+
- script: echo $(filterByPlatformStep.filteredTestMatrix)
216+
name: echoMatrix
217+
displayName: "Echo filtered matrix"

build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ parameters:
1111
- name: runPREfast
1212
type: boolean
1313
default: false
14+
- name: testMatrix
15+
type: string
16+
default: ''
1417

1518
stages:
1619
- stage: ${{ iif(parameters.runPREfast, 'PREfast_AnyCPU', 'Build_AnyCPU') }}
@@ -56,20 +59,16 @@ stages:
5659
ob_sdl_apiscan_enabled: false
5760
ob_sdl_apiscan_softwareFolder: '$(build.SourcesDirectory)\BuildOutput\Release\AnyCPU'
5861
ob_sdl_apiscan_symbolsFolder: '$(build.SourcesDirectory)\BuildOutput\Release\AnyCPU;SRV*https://symweb.azurefd.net'
62+
ob_sdl_checkCompliantCompilerWarnings: true # This setting has no effect unless ob_sdl_msbuildOverride below is also set to true.
63+
ob_sdl_prefast_runDuring: 'Guardian' # The default 'Build' setting does not match the fact that we are calling msbuild.exe directly.
64+
ob_sdl_msbuildOverride: true # Because we are calling MSBuild directly instead of through the MSBuild@1 or VSBuild@1 tasks.
5965
steps:
6066
- template: WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml@self
6167
parameters:
6268
SignOutput: ${{ parameters.SignOutput }}
6369
IsOneBranch: ${{ parameters.IsOneBranch }}
6470
runPREfast : ${{ parameters.runPREfast }}
6571

66-
# This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found"
67-
# errors from the Guardian PREfast task, which shouldn't even be run in the first place, because its pre-
68-
# requisite of isNative=true isn't met currently.
69-
- script: |
70-
md "C:\__t\NativeCompilerPrefast"
71-
displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast'
72-
7372
# extract BuildFoundation and BuildMRT into WindowsAppSDK-Build-Stage-Per-Platform.yml. Separate the build stage per platform
7473

7574
- template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self
@@ -79,6 +78,7 @@ stages:
7978
runPREfast : ${{ parameters.runPREfast }}
8079
runApiScan : ${{ parameters.runApiScan }}
8180
BuildPlatform: x64
81+
testMatrix: ${{ parameters.testMatrix }}
8282

8383
- ${{ if not(parameters.runPREfast) }}:
8484
- template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self
@@ -88,6 +88,7 @@ stages:
8888
runPREfast : ${{ parameters.runPREfast }}
8989
runApiScan : ${{ parameters.runApiScan }}
9090
BuildPlatform: x86
91+
testMatrix: ${{ parameters.testMatrix }}
9192

9293
- template: WindowsAppSDK-Build-Per-Platform-Stage.yml@self
9394
parameters:
@@ -96,3 +97,4 @@ stages:
9697
runPREfast : ${{ parameters.runPREfast }}
9798
runApiScan : ${{ parameters.runApiScan }}
9899
BuildPlatform: arm64
100+
testMatrix: ${{ parameters.testMatrix }}

build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ steps:
3939
# Generally speaking, we leave it to the external repos to scan the bits in their packages.
4040
excludedPaths: |
4141
$(Build.SourcesDirectory)\packages
42+
# Explicitly specify the EO-compliant rule set, as the default Sdl.Recommended.Warning.ruleset is not EO-compliant.
43+
rulesetName: Custom
44+
customRuleset: $(Agent.ToolsDirectory)\NativeCompilerStaticAnalysisRuleset\mandatory_to_fix.ruleset
4245
continueOnError: true
4346
env:
4447
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
@@ -77,4 +80,4 @@ steps:
7780
- task: PublishBuildArtifacts@1
7881
inputs:
7982
PathtoPublish: '$(ob_outputDirectory)'
80-
artifactName: '$(ob_artifactBaseName)'
83+
artifactName: '$(ob_artifactBaseName)'

build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ steps:
8585
# Generally speaking, we leave it to the external repos to scan the bits in their packages.
8686
excludedPaths: |
8787
$(Agent.ToolsDirectory)\uCRT\#$(Build.SourcesDirectory)\obj\$(buildConfiguration)\$(buildPlatform)#$(Build.SourcesDirectory)\packages
88+
# Explicitly specify the EO-compliant rule set, as the default Sdl.Recommended.Warning.ruleset is not EO-compliant.
89+
rulesetName: Custom
90+
customRuleset: $(Agent.ToolsDirectory)\NativeCompilerStaticAnalysisRuleset\mandatory_to_fix.ruleset
8891
env:
8992
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
9093
continueOnError: true

build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Stage.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ stages:
4040
value: $[coalesce(variables.compilerOverridePackageVersion, variables.global_CompilerOverridePackageVersion)]
4141
- name: localCompilerOverrideNupkgVersion
4242
value: $[coalesce(variables.compilerOverrideNupkgVersion, variables.global_CompilerOverrideNupkgVersion)]
43+
- name: ob_sdl_checkCompliantCompilerWarnings
44+
value: true
45+
- name: ob_sdl_prefast_runDuring
46+
value: 'Build'
47+
- name: ob_sdl_msbuildOverride
48+
value: true
4349
condition: ne(variables.LatestOfficialBuildID, '')
4450
steps:
4551
- script: |
@@ -52,7 +58,9 @@ stages:
5258
echo localCompilerOverridePackageName=$(localCompilerOverridePackageName)
5359
echo localCompilerOverridePackageVersion=$(localCompilerOverridePackageVersion)
5460
echo localCompilerOverrideNupkgVersion=$(localCompilerOverrideNupkgVersion)
55-
echo System.PullRequest.targetBranchName=$(System.PullRequest.targetBranchName)
56-
echo mySourceBranch=$(mySourceBranch)
57-
61+
echo System.PullRequest.targetBranchName=$(System.PullRequest.targetBranchName)
62+
echo ob_sdl_checkCompliantCompilerWarnings=$(ob_sdl_checkCompliantCompilerWarnings)
63+
echo ob_sdl_prefast_runDuring=$(ob_sdl_prefast_runDuring)
64+
echo ob_sdl_msbuildOverride=$(ob_sdl_msbuildOverride)
65+
5866
- template: WindowsAppSDK-BuildInstaller-Steps.yml@self

build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -224,19 +224,24 @@ steps:
224224
${{ if eq( parameters.runStaticAnalysis, 'true') }}:
225225
createLogFile: true
226226

227-
- ${{ if eq(parameters.runStaticAnalysis, 'true') }}:
228-
- task: SDLNativeRules@3
229-
condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'), eq(variables['buildPlatform'], 'x64'))
230-
displayName: Run the PREfast SDL Native Rules
231-
inputs:
232-
userProvideBuildInfo: auto
233-
toolVersion: Latest
234-
# Generally speaking, we leave it to the external repos to scan the bits in their packages.
235-
excludedPaths: |
236-
$(Build.SourcesDirectory)\packages
237-
continueOnError: true
238-
env:
239-
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
227+
# The VSBuild@1 task above seems to be able to do inline PREfast scanning with the EO-compliant ruleset now. So, we don't seem to
228+
# need the following any more. Commenting it out for now and observe a bit more. Remove it when we feel comfortable.
229+
#- ${{ if eq(parameters.runStaticAnalysis, 'true') }}:
230+
# - task: SDLNativeRules@3
231+
# condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'), eq(variables['buildPlatform'], 'x64'))
232+
# displayName: Run the PREfast SDL Native Rules
233+
# inputs:
234+
# userProvideBuildInfo: auto
235+
# toolVersion: Latest
236+
# # Generally speaking, we leave it to the external repos to scan the bits in their packages.
237+
# excludedPaths: |
238+
# $(Build.SourcesDirectory)\packages
239+
# # Explicitly specify the EO-compliant rule set, as the default Sdl.Recommended.Warning.ruleset is not EO-compliant.
240+
# rulesetName: Custom
241+
# customRuleset: $(Agent.ToolsDirectory)\NativeCompilerStaticAnalysisRuleset\mandatory_to_fix.ruleset
242+
# continueOnError: true
243+
# env:
244+
# SYSTEM_ACCESSTOKEN: $(System.AccessToken)
240245

241246
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
242247
displayName: 'Component Governance Detection'

build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ steps:
4646
# Generally speaking, we leave it to the external repos to scan the bits in their packages.
4747
excludedPaths: |
4848
$(Build.SourcesDirectory)\packages
49+
# Explicitly specify the EO-compliant rule set, as the default Sdl.Recommended.Warning.ruleset is not EO-compliant.
50+
rulesetName: Custom
51+
customRuleset: $(Agent.ToolsDirectory)\NativeCompilerStaticAnalysisRuleset\mandatory_to_fix.ruleset
4952
env:
5053
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
5154
continueOnError: true

build/AzurePipelinesTemplates/WindowsAppSDK-BuildVSIX-Stage.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ stages:
1717
# it is not under $(Build.SourcesDirectory)\WindowsAppSDK
1818
foundationRepoPath: ""
1919
buildConfiguration: "Release"
20+
ob_sdl_checkCompliantCompilerWarnings: true
21+
ob_sdl_prefast_runDuring: 'Build'
22+
ob_sdl_msbuildOverride: true
2023
condition: ne(variables.LatestOfficialBuildID, '')
2124
steps:
2225
- template: WindowsAppSDK-BuildVSIX-Steps.yml@self

build/AzurePipelinesTemplates/WindowsAppSDK-BuildVSIX-Steps.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ steps:
118118
# Generally speaking, we leave it to the external repos to scan the bits in their packages.
119119
excludedPaths: |
120120
$(Build.SourcesDirectory)\packages
121+
# Explicitly specify the EO-compliant rule set, as the default Sdl.Recommended.Warning.ruleset is not EO-compliant.
122+
rulesetName: Custom
123+
customRuleset: $(Agent.ToolsDirectory)\NativeCompilerStaticAnalysisRuleset\mandatory_to_fix.ruleset
121124
continueOnError: true
122125
env:
123126
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
@@ -150,6 +153,9 @@ steps:
150153
# Generally speaking, we leave it to the external repos to scan the bits in their packages.
151154
excludedPaths: |
152155
$(Build.SourcesDirectory)\packages
156+
# Explicitly specify the EO-compliant rule set, as the default Sdl.Recommended.Warning.ruleset is not EO-compliant.
157+
rulesetName: Custom
158+
customRuleset: $(Agent.ToolsDirectory)\NativeCompilerStaticAnalysisRuleset\mandatory_to_fix.ruleset
153159
continueOnError: true
154160
env:
155161
SYSTEM_ACCESSTOKEN: $(System.AccessToken)

build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,5 @@ steps:
210210
condition: succeededOrFailed()
211211
inputs:
212212
targetPath: '$(Build.SourcesDirectory)\TestOutput'
213-
artifact: '$(System.StageName)_${{ parameters.ImageName }}_$(buildConfiguration)$(buildPlatform)_$(Agent.JobStatus)$(artifactAttempt)'
213+
artifact: '$(System.StageName)_${{ parameters.ImageName }}_$(buildConfiguration)$(buildPlatform)_$(Agent.JobStatus)$(artifactAttempt)'
214+
Parallel: true

0 commit comments

Comments
 (0)