From 64acb82a2e923df7aae0b6291be8e88202f257df Mon Sep 17 00:00:00 2001 From: "Jakob Lichtenberg (170957)" Date: Sun, 14 Jan 2024 20:36:44 -0800 Subject: [PATCH] user/jakobl/fine_grained_exclusions --- Build-AllSamples.ps1 | 4 ++-- Build-SampleSet.ps1 | 57 ++++++++++++++++++++++++++++++++++++++++---- exclusions.csv | 18 +++++++------- 3 files changed, 63 insertions(+), 16 deletions(-) diff --git a/Build-AllSamples.ps1 b/Build-AllSamples.ps1 index 24113c5fd..353d95a3a 100644 --- a/Build-AllSamples.ps1 +++ b/Build-AllSamples.ps1 @@ -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" } } diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index e89f3d105..b6cb44c9a 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -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.(?.*).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.(?.*).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 = @{ @@ -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 + ")") diff --git a/exclusions.csv b/exclusions.csv index bfc2fa9b0..bd683a71c 100644 --- a/exclusions.csv +++ b/exclusions.csv @@ -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 \ No newline at end of file +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