Skip to content

Commit

Permalink
user/jakobl/fine_grained_exclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobL-MSFT committed Jan 15, 2024
1 parent 920221c commit 64acb82
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Build-AllSamples.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ foreach ($file in $solutionFiles) {
$dir = (Get-Item $file).DirectoryName
$dir_norm = $dir.Replace($root, '').Trim('\').Replace('\', '.').ToLower()
if ($dir_norm -match ($Samples)) {
Write-Verbose "`u{1F50E} Found and included sample [$dir_norm] at $dir"
Write-Verbose "`u{1F50E} Found and filtered in sample [$dir_norm] at $dir"
$sampleSet[$dir_norm] = $dir
}
else {
Write-Verbose "`u{1F50E} Found and excluded sample [$dir_norm] at $dir"
Write-Verbose "`u{1F50E} Found and filtered out sample [$dir_norm] at $dir"
}
}

Expand Down
57 changes: 52 additions & 5 deletions Build-SampleSet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,61 @@ finally {
$ErrorActionPreference = $oldPreference
}

#
# Determine whether WDK or EWDK build environment (not currently used)
# Determine WDK/EWDK build number (used for exclusions)
#
$build_environment=""
$build_number=0
#
# EWDK sets environment variable Version_Number. For example '10.0.22621.0'.
#
if($env:Version_Number -match '10.0.(?<build>.*).0') {
$build_environment="EWDK"
$build_number=$Matches.build
}
#
# WDK sets environment variable UCRTVersion. For example '10.0.22621.0'.
#
elseif ($env:UCRTVersion -match '10.0.(?<build>.*).0') {
$build_environment="WDK"
$build_number=$Matches.build
}
else {
Write-Error "Could not determine build environment."
exit 1
}

#
# Determine exclusions.
#
# Exclusions are loaded from .\exclusions.csv.
# Each line has form:
# Path,Configurations,MinBuild,MaxBuild,Reason
# Where:
# Path: Is the path to folder containing solution(s) using backslashes. For example: 'audio\acx\samples\audiocodec\driver' .
# Configurations: Are the configurations to exclude. For example: '*|arm64' .
# MinBuild: Is the minimum WDK/EWDK build number the exclusion is applicable for. For example: '22621' .
# MaxBuild: Is the maximum WDK/EWDK build number the exclusion is applicable for. For example: '26031' .
# Reason: Is plain text documenting the reason for the exclusion. For example: 'error C1083: Cannot open include file: 'acx.h': No such file or directory' .
#
$exclusionConfigurations = @{}
$exclusionReasons = @{}
Import-Csv 'exclusions.csv' | ForEach-Object {
if ($_.Configurations) {
$exclusionConfigurations[$_.Path.Replace($root, '').Trim('\').Replace('\', '.').ToLower()] = $_.Configurations
$excluded_driver=$_.Path.Replace($root, '').Trim('\').Replace('\', '.').ToLower()
$excluded_configurations=($_.configurations -eq '' ? '*' : $_.configurations)
$excluded_minbuild=($_.MinBuild -eq '' ? 00000 : $_.MinBuild)
$excluded_maxbuild=($_.MaxBuild -eq '' ? 99999 : $_.MaxBuild)
if (($excluded_minbuild -le $build_number) -and ($build_number -le $excluded_maxbuild) )
{
$exclusionConfigurations[$excluded_driver] = $excluded_configurations
$exclusionReasons[$excluded_driver] = $_.Reason
Write-Verbose "Exclusion.csv entry applied for '$excluded_driver' for configuration '$excluded_configurations'."
}
else {
$exclusionConfigurations[$_.Path.Replace($root, '').Trim('\').Replace('\', '.').ToLower()] = '*'
else
{
Write-Verbose "Exclusion.csv entry not applied for '$excluded_driver' due to build number."
}
$exclusionReasons[$_.Path.Replace($root, '').Trim('\').Replace('\', '.').ToLower()] = $_.Reason
}

$jresult = @{
Expand All @@ -67,6 +112,8 @@ $jresult = @{

$SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count

Write-Output ("Build Environment: " + $build_environment)
Write-Output ("Build Number: " + $build_number)
Write-Output ("Samples: " + $sampleSet.Count)
Write-Output ("Configurations: " + $Configurations.Count + " (" + $Configurations + ")")
Write-Output ("Platforms: " + $Platforms.Count + " (" + $Platforms + ")")
Expand Down
18 changes: 9 additions & 9 deletions exclusions.csv
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Path,Reason
audio\acx\samples\audiocodec\driver,error C1083: Cannot open include file: 'acx.h': No such file or directory
general\dchu\osrfx2_dchu_extension_loose,Needs fix for project not found
general\dchu\osrfx2_dchu_extension_tight,LINK : error LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification
general\winhec 2017 lab\toaster driver,Needs input from end user
general\winhec 2017 lab\toaster support app,Needs input from end user
network\trans\wfpsampler,Missing INF section; missing libs
tree,Missing headers
video\indirectdisplay,ARM64 Warning C4530: C++ exception handler used but unwind semantics are not enabled
Path,Configurations,MinBuild,MaxBuild,Reason
audio\acx\samples\audiocodec\driver,*,,22621,Only 22621: error C1083: Cannot open include file: 'acx.h': No such file or directory
general\dchu\osrfx2_dchu_extension_loose,*,,,Needs fix for project not found
general\dchu\osrfx2_dchu_extension_tight,*,,,LINK : error LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification
general\winhec 2017 lab\toaster driver,*,,,Needs input from end user
general\winhec 2017 lab\toaster support app,*,,,Needs input from end user
network\trans\wfpsampler,*,,,Missing INF section; missing libs
tree,*,,,Missing headers
video\indirectdisplay,*|arm64,,,Only arm64: Warning C4530: C++ exception handler used but unwind semantics are not enabled

0 comments on commit 64acb82

Please sign in to comment.