summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakobL-MSFT <[email protected]>2024-02-18 22:26:04 -0800
committerGitHub <[email protected]>2024-02-18 22:26:04 -0800
commit7638cc34aeb7f71b8679d940bd24d8d44972f335 (patch)
treeff369f5ba7ae4f2677dfa21d7002b6398fafcece
parentdcf6265102838bdd29899037a6fc630ae455f80d (diff)
Update main branch infverif flags (#1118)
-rw-r--r--Build-AllSamples.ps15
-rw-r--r--Build-Sample.ps115
-rw-r--r--Build-SampleSet.ps173
-rw-r--r--exclusions.csv23
4 files changed, 70 insertions, 46 deletions
diff --git a/Build-AllSamples.ps1 b/Build-AllSamples.ps1
index 353d95a3..6b3a1976 100644
--- a/Build-AllSamples.ps1
+++ b/Build-AllSamples.ps1
@@ -56,7 +56,10 @@ $sampleSet = @{}
foreach ($file in $solutionFiles) {
$dir = (Get-Item $file).DirectoryName
$dir_norm = $dir.Replace($root, '').Trim('\').Replace('\', '.').ToLower()
- if ($dir_norm -match ($Samples)) {
+ if ($dir_norm -match ("^packages.")) {
+ Write-Verbose "`u{1F50E} Found and ignored non-sample [$dir_norm] at $dir"
+ }
+ elseif ($dir_norm -match ($Samples)) {
Write-Verbose "`u{1F50E} Found and filtered in sample [$dir_norm] at $dir"
$sampleSet[$dir_norm] = $dir
}
diff --git a/Build-Sample.ps1 b/Build-Sample.ps1
index a7c9deb2..cb927d3f 100644
--- a/Build-Sample.ps1
+++ b/Build-Sample.ps1
@@ -17,6 +17,9 @@ Configuration name that will be used to build the solution. Common available val
.PARAMETER Platform
Platform to build the solution for (e.g. "x64", "arm64").
+.PARAMETER InfVerif_AdditionalOptions
+Additional options for infverif (e.g. "/samples").
+
.PARAMETER LogFilesDirectoy
Path to a directory where the log files will be written to. If not provided, outputs will be logged to the current working directory.
@@ -43,6 +46,7 @@ param(
[string]$SampleName,
[string]$Configuration = "Debug",
[string]$Platform = "x64",
+ [string]$InfVerif_AdditionalOptions = "/samples",
$LogFilesDirectory = (Get-Location)
)
@@ -138,16 +142,7 @@ $warnLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.wrn"
$OutLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.out"
Write-Verbose "Building Sample: $SampleName; Configuration: $Configuration; Platform: $Platform {"
-
-# Exclude certain InfVerif exceptions to allow samples to build and detect other errors.
-# error 1205: Section [xxx] referenced from DelFiles and CopyFiles directive - network\trans
-# error 1144: Device software with SoftwareType 1 may not execute on all product types - general\dchu\osrfx2_dchu_extension_tight
-# error 1233: Missing directive CatalogFile required for digital signature - storage\class\disk
-# error 2083: Section [xxx] not referenced or used - network\trans, storage\msdsm
-# error 2084: Service binary 'xxx' should reference a CopyFiles destination file - network\trans, wpd\wpdservicesampledriver
-# errors 1324, 1420, 1421, 1402 will be excluded in main branch only until the fixes are merged.
-# error 2086 will be excluded until the WDK used in GitHub is updated.
-msbuild $solutionFile -clp:Verbosity=m -t:clean,build -property:Configuration=$Configuration -property:Platform=$Platform -p:TargetVersion=Windows10 -p:InfVerif_AdditionalOptions="/samples /msft /sw1144 /sw1199 /sw1205 /sw1233 /sw1324 /sw1420 /sw1421 /sw2083 /sw2084 /sw2086 /sw1402" -p:SignToolWS=/fdws -p:DriverCFlagAddOn=/wd4996 -warnaserror -flp1:errorsonly`;logfile=$errorLogFilePath -flp2:WarningsOnly`;logfile=$warnLogFilePath -noLogo > $OutLogFilePath
+msbuild $solutionFile -clp:Verbosity=m -t:rebuild -property:Configuration=$Configuration -property:Platform=$Platform -p:TargetVersion=Windows10 -p:InfVerif_AdditionalOptions="$InfVerif_AdditionalOptions" -p:SignToolWS=/fdws -p:DriverCFlagAddOn=/wd4996 -warnaserror -flp1:errorsonly`;logfile=$errorLogFilePath -flp2:WarningsOnly`;logfile=$warnLogFilePath -noLogo > $OutLogFilePath
if ($env:WDS_WipeOutputs -ne $null)
{
Write-Verbose ("WipeOutputs: "+$Directory+" "+(((Get-Volume ($DriveLetter=(Get-Item ".").PSDrive.Name)).SizeRemaining/1GB)))
diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1
index 535ac6db..6e9a3b17 100644
--- a/Build-SampleSet.ps1
+++ b/Build-SampleSet.ps1
@@ -45,15 +45,32 @@ finally {
}
#
-# Determine build environment: 'WDK', 'EWDK', or 'GitHub'. Only used to determine build number.
+# Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. 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
#
+# WDK NuGet will require presence of a folder 'packages'
+#
+#
+# Hack: In GitHub we do not have an environment variable where we can see WDK build number, so we have it hard coded.
+#
+if (-not $env:GITHUB_REPOSITORY -eq '') {
+ $build_environment="GitHub"
+ $build_number=22621
+}
+#
+# Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named .\packages.
+#
+elseif(Test-Path(".\packages")) {
+ $build_environment=("NuGet")
+ $build_number=26061
+}
+#
# EWDK sets environment variable BuildLab. For example 'ni_release_svc_prod1.22621.2428'.
#
-if($env:BuildLab -match '(?<branch>[^.]*).(?<build>[^.]*).(?<qfe>[^.]*)') {
+elseif($env:BuildLab -match '(?<branch>[^.]*).(?<build>[^.]*).(?<qfe>[^.]*)') {
$build_environment=("EWDK."+$Matches.branch+"."+$Matches.build+"."+$Matches.qfe)
$build_number=$Matches.build
}
@@ -64,13 +81,6 @@ 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:
@@ -83,6 +93,25 @@ else {
}
#
+# InfVerif_AdditionalOptions
+#
+# Samples must build cleanly and even without warnings.
+#
+# For this branch we handle this with infverif exclusions.
+#
+# In NI WDK the /msft flag excludes expected warnings.
+# This flag not to be used after NI. Instead use /samples.
+#
+$InfVerif_AdditionalOptions=
+ (
+ $build_number -le 22621 ?
+ "/msft" :
+ "/samples /sw1199 /sw1204 /sw1208 /sw1233 /sw1402 /sw1423 /sw2084"
+ ) +
+ " " +
+ "/sw1203 /sw1205 /sw1296 /sw1324 /sw1420 /sw1421 /sw1422 /sw2083"
+
+#
# Determine exclusions.
#
# Exclusions are loaded from .\exclusions.csv.
@@ -127,17 +156,18 @@ $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 + ")")
-Write-Output "Combinations: $SolutionsTotal"
-Write-Output "LogicalProcessors: $LogicalProcessors"
-Write-Output "ThrottleFactor: $ThrottleFactor"
-Write-Output "ThrottleLimit: $ThrottleLimit"
-Write-Output "WDS_WipeOutputs: $env:WDS_WipeOutputs"
-Write-Output ("Disk Remaining (GB): " + (((Get-Volume ($DriveLetter = (Get-Item ".").PSDrive.Name)).SizeRemaining / 1GB)))
+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 + ")")
+Write-Output "InfVerif_AdditionalOptions: $InfVerif_AdditionalOptions"
+Write-Output "Combinations: $SolutionsTotal"
+Write-Output "LogicalProcessors: $LogicalProcessors"
+Write-Output "ThrottleFactor: $ThrottleFactor"
+Write-Output "ThrottleLimit: $ThrottleLimit"
+Write-Output "WDS_WipeOutputs: $env:WDS_WipeOutputs"
+Write-Output ("Disk Remaining (GB): " + (((Get-Volume ($DriveLetter = (Get-Item ".").PSDrive.Name)).SizeRemaining / 1GB)))
Write-Output ""
Write-Output "T: Combinations"
Write-Output "B: Built"
@@ -161,6 +191,7 @@ $SampleSet.GetEnumerator() | ForEach-Object -ThrottleLimit $ThrottleLimit -Paral
$exclusionReasons = $using:exclusionReasons
$Configurations = $using:Configurations
$Platforms = $using:Platforms
+ $InfVerif_AdditionalOptions = $using:InfVerif_AdditionalOptions
$Verbose = $using:Verbose
$sampleName = $_.Key
@@ -185,7 +216,7 @@ $SampleSet.GetEnumerator() | ForEach-Object -ThrottleLimit $ThrottleLimit -Paral
$thisresult = "Excluded"
}
else {
- .\Build-Sample -Directory $directory -SampleName $sampleName -LogFilesDirectory $LogFilesDirectory -Configuration $configuration -Platform $platform -Verbose:$Verbose
+ .\Build-Sample -Directory $directory -SampleName $sampleName -LogFilesDirectory $LogFilesDirectory -Configuration $configuration -Platform $platform -InfVerif_AdditionalOptions $InfVerif_AdditionalOptions -Verbose:$Verbose
if ($LASTEXITCODE -eq 0) {
$thissucceeded += 1
$thisresult = "Succeeded"
diff --git a/exclusions.csv b/exclusions.csv
index ebaea66a..4820f615 100644
--- a/exclusions.csv
+++ b/exclusions.csv
@@ -1,17 +1,12 @@
Path,Configurations,MinBuild,MaxBuild,Reason
-avstream\sampledevicemft,*,26031,,Only GE: Fails to build
-general\dchu\osrfx2_dchu_base,*,,,Wrong Toolset - needs migration
-general\dchu\osrfx2_dchu_extension_loose,*,,,Needs fix for project not found
-general\dchu\osrfx2_dchu_extension_tight,*,,,Wrong Toolset - needs migration
-general\filehistory,*,,,Deprecated APIs
+avstream\sampledevicemft,*|x64,26000,,Only GE: Only x64: Fails to build
+general\dchu\osrfx2_dchu_base,*|x64,,,Only x64: Wrong Toolset - needs migration
+general\dchu\osrfx2_dchu_extension_loose,*|x64,,,Only x64: Needs fix for project not found
+general\dchu\osrfx2_dchu_extension_tight,*|x64,,,Only x64: Wrong Toolset - needs migration
+general\filehistory,*|x64,,,Only x64: Deprecated APIs
general\simplemediasource,Debug|arm64,,,Only Debug|arm64: LNK1181: cannot open input file 'SimpleMediaSource.lib'
-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\stmedit,*,,,Invalid Win32 architecture
-network\trans\wfpsampler,*,,,Missing INF section; missing libs
-network\wlan\wdi,*,,,Invalid architecture
-print\oem printer customization plug-in samples\c++,*,,,Invalid architecture
-print\v4printdriversamples\printerextensionsample,*,,,Invalid architecture
-storage\class\cdrom,*,26031,,Only GE: Fails to build
-tree,*,,,Missing headers
+general\winhec 2017 lab\toaster support app,*|x64,,,Only x64: Needs input from end user
+network\trans\stmedit,Debug|x64,,,Only x64: Only Debug: Invalid architecture
+network\trans\wfpsampler,*|x64,,,Only x64: Missing libs
+tree,*|x64,,,Only x64: Missing headers
video\indirectdisplay,*|arm64,,,Only arm64: Warning C4530: C++ exception handler used but unwind semantics are not enabled