diff options
| author | JakobL-MSFT <[email protected]> | 2024-01-15 12:25:53 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-01-15 12:25:53 -0800 |
| commit | 1d8033229e98a688907e3d11ad122565e960714f (patch) | |
| tree | c6794fbfb277febe9fdb6b2e8961aa47119eeffc | |
| parent | 734e40ba51939a9950e387207c23d73c7c85567d (diff) | |
Add support for fine grained exclusions (#1074)
* user/jakobl/fine_grained_exclusions
* user/jakobl/fine_grained_exclusions
* user/jakobl/fine_grained_exclusions
* user/jakobl/fine_grained_exclusions
* user/jakobl/fine_grained_exclusions
* user/jakobl/fine_grained_exclusions
* Update exclusions.csv
| -rw-r--r-- | Build-AllSamples.ps1 | 4 | ||||
| -rw-r--r-- | Build-SampleSet.ps1 | 70 | ||||
| -rw-r--r-- | exclusions.csv | 18 |
3 files changed, 76 insertions, 16 deletions
diff --git a/Build-AllSamples.ps1 b/Build-AllSamples.ps1 index 24113c5f..353d95a3 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 e89f3d10..2c75143a 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -44,16 +44,74 @@ finally { $ErrorActionPreference = $oldPreference } +# +# Determine build environment: 'WDK', 'EWDK', or 'GitHub'. Only used to determine build number. +# Determine build number (used for exclusions based on build number). Five digits. Say, '22621'. +# +$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 +} +# +# Hack: In GitHub we do not have an environment variable where we can see WDK build number, so we have it hard coded. +# +elseif (-not $env:GITHUB_REPOSITORY -eq '') { + $build_environment="GitHub" + $build_number=22621 +} +else { + + # Dump all environment variables so as to help debug error: + Write-Output "Environment variables {" + gci env:* | sort-object name + Write-Output "Environment variables }" + + 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 +125,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 bfc2fa9b..cce85c05 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 GE: 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 |
