diff options
| author | 5an7y <[email protected]> | 2026-06-22 13:54:56 -0700 |
|---|---|---|
| committer | 5an7y <[email protected]> | 2026-06-22 13:54:56 -0700 |
| commit | a659bfc6b48a908a0b244d32de575bcf30033e7b (patch) | |
| tree | 624d1b2ce07ae0ef7490bfb5ecd0168b34f9e8bc | |
| parent | 167a11ba7b1fd981755921f604106b6dbce6ec99 (diff) | |
Support TargetVersion-scoped rules in exclusions.csv
Add an optional TargetVersions column to exclusions.csv so an exclusion can
be limited to specific target OS versions (e.g. exclude ARM only when
building Windows8). The column holds a ';'-separated list of -like patterns
matched against -TargetVersion; blank or '*' means all versions, so every
existing row stays applicable to all targets.
Import-SampleExclusions now takes -TargetVersion and filters rows by it at
load time (alongside the existing MinBuild/MaxBuild range); a missing column
is treated as '*' for backward compatibility. Document the new column and an
example in Building-Locally.md.
Co-authored-by: Copilot <[email protected]>
| -rw-r--r-- | Build-Samples.ps1 | 30 | ||||
| -rw-r--r-- | Building-Locally.md | 31 | ||||
| -rw-r--r-- | exclusions.csv | 24 |
3 files changed, 65 insertions, 20 deletions
diff --git a/Build-Samples.ps1 b/Build-Samples.ps1 index c63d4d55..bb250a2f 100644 --- a/Build-Samples.ps1 +++ b/Build-Samples.ps1 @@ -119,15 +119,21 @@ function Import-SampleExclusions { - Configurations: semicolon-separated config|platform patterns (or '*' for all) - Reason: human-readable explanation - Only exclusions whose [MinBuild, MaxBuild] range includes the given build number - are returned. Exclusions outside the range are silently skipped. + A row is only returned when BOTH of the following match the current build: + - its [MinBuild, MaxBuild] range includes the given build number, and + - its TargetVersions list matches the given TargetVersion. TargetVersions is + blank/'*' for all versions, or a ';'-separated list of -like patterns + (e.g. 'Windows8', 'Windows7;Windows8', 'Windows*'). + Rows outside the build range, or whose TargetVersions does not match, are skipped. .NOTES - CSV format: Path,Configurations,MinBuild,MaxBuild,Reason - Example row: network\wlan\wdi,*,,27100,"failure introduced in VS17.14" + CSV format: Path,Configurations,TargetVersions,MinBuild,MaxBuild,Reason + Example row: network\wlan\wdi,*,,,27100,"failure introduced in VS17.14" + Target-specific: somepath,*|ARM64,Windows8,,,"ARM not supported when targeting Windows 8" #> param( [string]$CsvPath, - [int]$BuildNumber + [int]$BuildNumber, + [string]$TargetVersion = 'Windows10' ) if (-not (Test-Path $CsvPath)) { @@ -139,16 +145,24 @@ function Import-SampleExclusions { Import-Csv $CsvPath | ForEach-Object { $pattern = $_.Path.Trim('\').Replace('\', '.').ToLower() $configs = if ([string]::IsNullOrWhiteSpace($_.Configurations)) { '*' } else { $_.Configurations } + # TargetVersions column is optional; blank or missing means "all target versions". + $targets = if ([string]::IsNullOrWhiteSpace($_.TargetVersions)) { '*' } else { $_.TargetVersions } $minBuild = if ([string]::IsNullOrWhiteSpace($_.MinBuild)) { 0 } else { [int]$_.MinBuild } $maxBuild = if ([string]::IsNullOrWhiteSpace($_.MaxBuild)) { 99999 } else { [int]$_.MaxBuild } - if ($minBuild -le $BuildNumber -and $BuildNumber -le $maxBuild) { + # TargetVersion is constant for the whole run, so (like the build number) filter here. + $targetMatches = $targets.Split(';') | Where-Object { $TargetVersion -like $_.Trim() } + + if (-not $targetMatches) { + Write-Verbose "Exclusion skipped: '$pattern' - target '$TargetVersion' not in '$targets'" + } + elseif ($minBuild -le $BuildNumber -and $BuildNumber -le $maxBuild) { [void]$exclusions.Add([PSCustomObject]@{ Pattern = $pattern Configurations = $configs Reason = $_.Reason }) - Write-Verbose "Exclusion applied: '$pattern' configs='$configs' reason='$($_.Reason)'" + Write-Verbose "Exclusion applied: '$pattern' configs='$configs' targets='$targets' reason='$($_.Reason)'" } else { Write-Verbose "Exclusion skipped: '$pattern' - build $BuildNumber outside [$minBuild, $maxBuild]" @@ -414,7 +428,7 @@ else { # Step 6 - Load Exclusions # ============================================================================= -$exclusions = Import-SampleExclusions -CsvPath (Join-Path $root 'exclusions.csv') -BuildNumber $buildNumber +$exclusions = Import-SampleExclusions -CsvPath (Join-Path $root 'exclusions.csv') -BuildNumber $buildNumber -TargetVersion $TargetVersion # ============================================================================= # Step 7 - Print Build Plan diff --git a/Building-Locally.md b/Building-Locally.md index a4db0747..5b746a64 100644 --- a/Building-Locally.md +++ b/Building-Locally.md @@ -137,6 +137,37 @@ newest-first. The default is the latest, `Windows10`: --- +## Excluding samples from the build + +Samples that are known not to build for a given environment are listed in `exclusions.csv` +at the repo root. Each row excludes a path (with wildcards) for specific +configuration/platform combinations, an optional WDK build-number range, and an optional +set of target versions: + +``` +Path,Configurations,TargetVersions,MinBuild,MaxBuild,Reason +``` + +| Column | Meaning | +| ---------------- | ---------------------------------------------------------------------------------------- | +| `Path` | Sample path (backslashes); supports `*`/`?` wildcards. | +| `Configurations` | `;`-separated `Config\|Platform` patterns, or `*` for all (e.g. `*\|ARM64`, `Debug\|x64`). | +| `TargetVersions` | `;`-separated `-like` patterns matched against `-TargetVersion`; blank or `*` = all (e.g. `Windows8`, `Windows7;Windows8`, `Windows*`). | +| `MinBuild`/`MaxBuild` | Inclusive WDK build-number range; blank = unbounded. | +| `Reason` | Human-readable explanation (keep this column last; quote it if it contains commas). | + +A row is applied only when every populated condition matches the current run (path, +configuration/platform, build-number range, and target version are AND-ed together). Leave +`TargetVersions` blank to exclude regardless of target version (the default for most rows). + +For example, to exclude all ARM platforms only when building for Windows 8: + +``` +somepath,*|ARM64,Windows8,,,"ARM not supported when targeting Windows 8" +``` + +--- + ## Additional Notes ### Pre-release WDK: disable strong name validation diff --git a/exclusions.csv b/exclusions.csv index df12335d..b3d8a50a 100644 --- a/exclusions.csv +++ b/exclusions.csv @@ -1,12 +1,12 @@ -Path,Configurations,MinBuild,MaxBuild,Reason -audio\acx\samples\audiocodec\driver,*,,22621,Only NI: error C1083: Cannot open include file: 'acx.h': No such file or directory -general\dchu\osrfx2_dchu_extension_loose,*|x64,,22621,Only NI: Only x64: Fails to build -general\dchu\osrfx2_dchu_extension_tight,*|x64,,22621,Only NI: Only x64: Fails to build -network\trans\WFPSampler,Debug|ARM64,,22621,Only NI: Only ARM: Fails to build on EWDK 22621 with VS 17.1.5 - CallingConvention=StdCall not supported -prm,*,,22621,Only NI: Not supported on NI. -powerlimit\plclient,*,,22621,Only NI: Not supported on NI. -powerlimit\plpolicy,*,,22621,Only NI: Not supported on NI. -general\pcidrv,*,26100,,"failure introduced in VS17.14, suppressed until fix" -serial\serial,*,26100,,"failure introduced in VS17.14, suppressed until fix" -network\wlan\wdi,*,26100,,"failure introduced in VS17.14, suppressed until fix" -tools\kasan\samples\kasandemo-wdm,*|x64,26100,,"failure introduced in VS17.14, suppressed until fix" +Path,Configurations,TargetVersions,MinBuild,MaxBuild,Reason +audio\acx\samples\audiocodec\driver,*,,,22621,Only NI: error C1083: Cannot open include file: 'acx.h': No such file or directory +general\dchu\osrfx2_dchu_extension_loose,*|x64,,,22621,Only NI: Only x64: Fails to build +general\dchu\osrfx2_dchu_extension_tight,*|x64,,,22621,Only NI: Only x64: Fails to build +network\trans\WFPSampler,Debug|ARM64,,,22621,Only NI: Only ARM: Fails to build on EWDK 22621 with VS 17.1.5 - CallingConvention=StdCall not supported +prm,*,,,22621,Only NI: Not supported on NI. +powerlimit\plclient,*,,,22621,Only NI: Not supported on NI. +powerlimit\plpolicy,*,,,22621,Only NI: Not supported on NI. +general\pcidrv,*,,26100,,"failure introduced in VS17.14, suppressed until fix" +serial\serial,*,,26100,,"failure introduced in VS17.14, suppressed until fix" +network\wlan\wdi,*,,26100,,"failure introduced in VS17.14, suppressed until fix" +tools\kasan\samples\kasandemo-wdm,*|x64,,26100,,"failure introduced in VS17.14, suppressed until fix" |
