Skip to content

Commit

Permalink
Fixes for sample build errors and updates to the execution script to …
Browse files Browse the repository at this point in the history
…use new build flags (#1078)

* Fixes for sample build errors

* Fix additional sample

* Add additional sample

* Updated comments in Build-Sample.ps1

* Adjusting exclusions.csv to be accurate for GE. Still issues for NI that we need to understand better

* Merge from develop branch

* Merge from develop branch

* Merge from develop branch

* Delete WPD samples

* Separate infverif additional options for old vs new WDK

* Delete WPD samples entry in our CODEOWNERS file

* Fix spelling error

* For 22621 WDK Remove the /samples flag

---------

Co-authored-by: Zac Lockard <zlockard@microsoft.com>
Co-authored-by: Jakob Lichtenberg (170957) <jakobl@microsoft.com>
  • Loading branch information
3 people authored Jan 31, 2024
1 parent c657bc7 commit 24f280d
Show file tree
Hide file tree
Showing 231 changed files with 37 additions and 50,407 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,3 @@

# Windows Internet of Things
/pos/ @microsoft/winiotdev
/wpd/ @microsoft/winiotdev
13 changes: 5 additions & 8 deletions Build-Sample.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -43,6 +46,7 @@ param(
[string]$SampleName,
[string]$Configuration = "Debug",
[string]$Platform = "x64",
[string]$InfVerif_AdditionalOptions = "/samples",
$LogFilesDirectory = (Get-Location)
)

Expand Down Expand Up @@ -139,14 +143,7 @@ $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 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 /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:clean,build -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)))
Expand Down
43 changes: 31 additions & 12 deletions Build-SampleSet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,23 @@ else {
exit 1
}

#
# InfVerif_AdditionalOptions
#
# Samples must build cleanly and even without warnings.
#
# An exception is for infverif where specific warnings are acceptable. Those
# specific warnings indicates issues intentially present in the samples, that
# anyone that clones the samples must fix as part of productizing a driver.
#
# In 22621 those warnings are: /sw1284 /sw1285 /sw1293 /sw2083 /sw2086
#
# After 22621 those warnings are put under a common flag: /samples
#
# Additionally after 22621 we have to temporarily suppress /sw1402 due to one specific sample "biometrics".
#
$InfVerif_AdditionalOptions=($build_number -le 22621 ? "/sw1284 /sw1285 /sw1293 /sw2083 /sw2086" : "/samples /sw1402")

#
# Determine exclusions.
#
Expand Down Expand Up @@ -127,17 +144,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"
Expand All @@ -161,6 +179,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
Expand All @@ -185,7 +204,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"
Expand Down
Binary file modified TrEE/Miniport/TrEEMiniportSample.inf
Binary file not shown.
2 changes: 1 addition & 1 deletion exclusions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ 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,*,,,Missing INF section; missing libs
network\trans\wfpsampler,*,,,missing libs
tree,*,,,Missing headers
video\indirectdisplay,*|arm64,,,Only arm64: Warning C4530: C++ exception handler used but unwind semantics are not enabled
Binary file modified network/trans/WFPSampler/sys/WFPSamplerCalloutDriver.InX
Binary file not shown.
Binary file modified network/trans/ddproxy/sys/ddproxy.inf
Binary file not shown.
Binary file modified network/trans/inspect/sys/inspect.inf
Binary file not shown.
Binary file modified network/trans/msnmntr/sys/msnmntr.inf
Binary file not shown.
Binary file modified network/trans/stmedit/sys/stmedit.inf
Binary file not shown.
Binary file modified storage/class/disk/src/diskdev.inf
Binary file not shown.
Binary file modified storage/msdsm/src/SampleDSM.inf
Binary file not shown.
Loading

0 comments on commit 24f280d

Please sign in to comment.