From 24f280dc4a700f00f5fbb8f13815b941620adb8e Mon Sep 17 00:00:00 2001 From: zlockard Date: Wed, 31 Jan 2024 13:45:54 -0800 Subject: Fixes for sample build errors and updates to the execution script to 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 Co-authored-by: Jakob Lichtenberg (170957) --- Build-Sample.ps1 | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'Build-Sample.ps1') diff --git a/Build-Sample.ps1 b/Build-Sample.ps1 index 365656ef..4fdf93b8 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) ) @@ -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))) -- cgit v1.3.1 From aff38669771c597fbd008a7a018993f4e2814d62 Mon Sep 17 00:00:00 2001 From: JakobL-MSFT <110699333+JakobL-MSFT@users.noreply.github.com> Date: Tue, 6 Feb 2024 18:07:09 -0800 Subject: Simplify MSBuild Flags (#1093) * user/jakobl/simplify_flags * user/jakobl/simplify_flags * Update Build-Sample.ps1 * Merge with upcoming PR https://github.com/microsoft/Windows-driver-samples/pull/1088 * white space only change --- Build-Sample.ps1 | 3 +-- .../windows-drivertemplate-nfc.vcxproj | 12 ++++++++++++ thermal/simsensor/simsensor.vcxproj | 11 ++++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) (limited to 'Build-Sample.ps1') diff --git a/Build-Sample.ps1 b/Build-Sample.ps1 index 4fdf93b8..0ef9d051 100644 --- a/Build-Sample.ps1 +++ b/Build-Sample.ps1 @@ -142,8 +142,7 @@ $warnLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.wrn" $OutLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.out" Write-Verbose "Building Sample: $SampleName; Configuration: $Configuration; Platform: $Platform {" - -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 +msbuild $solutionFile -clp:Verbosity=m -t:rebuild -property:Configuration=$Configuration -property:Platform=$Platform -p:TargetVersion=Windows10 -p:InfVerif_AdditionalOptions="$InfVerif_AdditionalOptions" -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/nfc/NfcCxSample/windows-drivertemplate-nfc/windows-drivertemplate-nfc.vcxproj b/nfc/NfcCxSample/windows-drivertemplate-nfc/windows-drivertemplate-nfc.vcxproj index ce9fe362..38113dbd 100644 --- a/nfc/NfcCxSample/windows-drivertemplate-nfc/windows-drivertemplate-nfc.vcxproj +++ b/nfc/NfcCxSample/windows-drivertemplate-nfc/windows-drivertemplate-nfc.vcxproj @@ -78,6 +78,18 @@ true + + sha256 + + + sha256 + + + sha256 + + + sha256 + diff --git a/thermal/simsensor/simsensor.vcxproj b/thermal/simsensor/simsensor.vcxproj index a155d12a..1d77a7de 100644 --- a/thermal/simsensor/simsensor.vcxproj +++ b/thermal/simsensor/simsensor.vcxproj @@ -106,7 +106,7 @@ %(AdditionalIncludeDirectories);..\inc\ - SHA256 + sha256 @@ -126,6 +126,9 @@ %(PreprocessorDefinitions);DRIVER=1;STRICT=1 %(AdditionalIncludeDirectories);..\inc\ + + sha256 + @@ -144,6 +147,9 @@ %(PreprocessorDefinitions);DRIVER=1;STRICT=1 %(AdditionalIncludeDirectories);..\inc\ + + sha256 + @@ -162,6 +168,9 @@ %(PreprocessorDefinitions);DRIVER=1;STRICT=1 %(AdditionalIncludeDirectories);..\inc\ + + sha256 + -- cgit v1.3.1 From ee0a1ee73dde5be876dbd25ee5ab4b467530a215 Mon Sep 17 00:00:00 2001 From: JakobL-MSFT <110699333+JakobL-MSFT@users.noreply.github.com> Date: Tue, 20 Feb 2024 23:41:46 -0800 Subject: Build System: Catch Sporadic Failures (#1123) * Build System: Catch Sporadic Failures * Build System: Catch Sporadic Failures --------- Co-authored-by: Jakob Lichtenberg --- Build-Sample.ps1 | 70 ++++++++++++++++++++++++++++++++++++++++++++--------- Build-SampleSet.ps1 | 39 ++++++++++++++++++++++++++--- 2 files changed, 93 insertions(+), 16 deletions(-) (limited to 'Build-Sample.ps1') diff --git a/Build-Sample.ps1 b/Build-Sample.ps1 index 0ef9d051..8c614bd2 100644 --- a/Build-Sample.ps1 +++ b/Build-Sample.ps1 @@ -134,23 +134,60 @@ foreach ($line in Get-Content -Path $solutionFile) if (-not $configurationIsSupported) { Write-Verbose "[$SampleName] `u{23E9} Skipped. Configuration $Configuration|$Platform not supported." - exit 2 + exit 3 } -$errorLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.err" -$warnLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.wrn" -$OutLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.out" - Write-Verbose "Building Sample: $SampleName; Configuration: $Configuration; Platform: $Platform {" -msbuild $solutionFile -clp:Verbosity=m -t:rebuild -property:Configuration=$Configuration -property:Platform=$Platform -p:TargetVersion=Windows10 -p:InfVerif_AdditionalOptions="$InfVerif_AdditionalOptions" -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))) - Get-ChildItem -path $Directory -Recurse -Include x64|Remove-Item -Recurse - Get-ChildItem -path $Directory -Recurse -Include arm64|Remove-Item -Recurse + +$myexit=0 + +# +# Let us build up to three times (0th, 1st, and 2nd attempt). +# If we succeed at first, then it is a success. +# If we fail at first, but succeed at either of next two attempts, then it is a sporadic failure. +# If we even at third attempt fail, then it is a true failure. +# +for ($i=0; $i -le 2; $i++) { + $errorLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.$i.err" + $warnLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.$i.wrn" + $OutLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.$i.out" + + msbuild $solutionFile -clp:Verbosity=m -t:rebuild -property:Configuration=$Configuration -property:Platform=$Platform -p:TargetVersion=Windows10 -p:InfVerif_AdditionalOptions="$InfVerif_AdditionalOptions" -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))) + Get-ChildItem -path $Directory -Recurse -Include x64|Remove-Item -Recurse + Get-ChildItem -path $Directory -Recurse -Include arm64|Remove-Item -Recurse + } + if ($LASTEXITCODE -eq 0) + { + # We succeeded building. + # If at first attempt, then $myexit=0 + # If at later attempt, then $myexit=2 + if ($i -eq 0) + { + $myexit=0 + } + else + { + $myexit=2 + } + break; + } + else + { + # We failed building. + # Let us sleep for a bit. + # Then let the while loop do its thing and re-run. + sleep 1 + if ($Verbose) + { + Write-Warning "`u{274C} Build failed. Retrying to see if sporadic..." + } + } } -if ($LASTEXITCODE -ne 0) +if ($myexit -eq 1) { if ($Verbose) { @@ -159,4 +196,13 @@ if ($LASTEXITCODE -ne 0) exit 1 } +if ($myexit -eq 2) +{ + if ($Verbose) + { + Write-Warning "`u{274C} Build sporadically failed. Log available at $errorLogFilePath" + } + exit 2 +} + Write-Verbose "Building Sample: $SampleName; Configuration: $Configuration; Platform: $Platform }" diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index ffbb9b0b..a8876d60 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -145,6 +145,7 @@ $jresult = @{ SolutionsExcluded = 0 SolutionsUnsupported = 0 SolutionsFailed = 0 + SolutionsSporadic = 0 Results = @() FailSet = @() lock = [System.Threading.Mutex]::new($false) @@ -174,6 +175,7 @@ Write-Output "S: Built and result was 'Succeeded'" Write-Output "E: Built and result was 'Excluded'" Write-Output "U: Built and result was 'Unsupported' (Platform and Configuration combination)" Write-Output "F: Built and result was 'Failed'" +Write-Output "O: Built and result was 'Sporadic'" Write-Output "" Write-Output "Building all combinations..." @@ -200,10 +202,12 @@ $SampleSet.GetEnumerator() | ForEach-Object -ThrottleLimit $ThrottleLimit -Paral foreach ($platform in $Platforms) { $thisunsupported = 0 $thisfailed = 0 + $thissporadic = 0 $thisexcluded = 0 $thissucceeded = 0 $thisresult = "Not run" $thisfailset = @() + $thissporadicset = @() if ($exclusionConfigurations.ContainsKey($sampleName) -and ($exclusionConfigurations[$sampleName].Split(';') | Where-Object { "$configuration|$platform" -like $_ })) { # Verbose @@ -222,8 +226,13 @@ $SampleSet.GetEnumerator() | ForEach-Object -ThrottleLimit $ThrottleLimit -Paral $thisfailed += 1 $thisresult = "Failed" } + elseif ($LASTEXITCODE -eq 2) { + $thissporadicset += "$sampleName $configuration|$platform" + $thissporadic += 1 + $thisresult = "Sporadic" + } else { - # ($LASTEXITCODE -eq 2) + # ($LASTEXITCODE -eq 3) $thisunsupported += 1 $thisresult = "Unsupported" } @@ -237,7 +246,9 @@ $SampleSet.GetEnumerator() | ForEach-Object -ThrottleLimit $ThrottleLimit -Paral ($using:jresult).SolutionsExcluded += $thisexcluded ($using:jresult).SolutionsUnsupported += $thisunsupported ($using:jresult).SolutionsFailed += $thisfailed + ($using:jresult).SolutionsSporadic += $thissporadic ($using:jresult).FailSet += $thisfailset + ($using:jresult).SporadicSet += $thissporadicset $SolutionsTotal = $using:SolutionsTotal $ThrottleLimit = $using:ThrottleLimit $SolutionsBuilt = ($using:jresult).SolutionsBuilt @@ -246,7 +257,7 @@ $SampleSet.GetEnumerator() | ForEach-Object -ThrottleLimit $ThrottleLimit -Paral $SolutionsPending = if ($SolutionsRemaining -ge $ThrottleLimit) { ($SolutionsRemaining - $ThrottleLimit) } else { 0 } $SolutionsBuiltPercent = [Math]::Round(100 * ($SolutionsBuilt / $using:SolutionsTotal)) $TBRP = "T:" + ($SolutionsTotal) + "; B:" + (($using:jresult).SolutionsBuilt) + "; R:" + ($SolutionsRunning) + "; P:" + ($SolutionsPending) - $rstr = "S:" + (($using:jresult).SolutionsSucceeded) + "; E:" + (($using:jresult).SolutionsExcluded) + "; U:" + (($using:jresult).SolutionsUnsupported) + "; F:" + (($using:jresult).SolutionsFailed) + $rstr = "S:" + (($using:jresult).SolutionsSucceeded) + "; E:" + (($using:jresult).SolutionsExcluded) + "; U:" + (($using:jresult).SolutionsUnsupported) + "; F:" + (($using:jresult).SolutionsFailed) + "; O:" + (($using:jresult).SolutionsSporadic) Write-Progress -Activity "Building combinations" -Status "$SolutionsBuilt of $using:SolutionsTotal combinations built ($SolutionsBuiltPercent%) | $TBRP | $rstr" -PercentComplete $SolutionsBuiltPercent } finally { @@ -265,6 +276,8 @@ $SampleSet.GetEnumerator() | ForEach-Object -ThrottleLimit $ThrottleLimit -Paral $sw.Stop() +Write-Output "" + if ($jresult.FailSet.Count -gt 0) { Write-Output "Some combinations were built with errors:" $jresult.FailSet = $jresult.FailSet | Sort-Object @@ -274,10 +287,27 @@ if ($jresult.FailSet.Count -gt 0) { $failConfiguration = $Matches[2] $failPlatform = $Matches[3] Write-Output "Build errors in Sample $failName; Configuration: $failConfiguration; Platform: $failPlatform {" - Get-Content "$LogFilesDirectory\$failName.$failConfiguration.$failPlatform.err" | Write-Output + Get-Content "$LogFilesDirectory\$failName.$failConfiguration.$failPlatform.0.err" | Write-Output Write-Output "} $failedSample" } Write-Error "Some combinations were built with errors." + Write-Output "" +} + +if ($jresult.SporadicSet.Count -gt 0) { + Write-Output "Some combinations were built with sporadic error:" + $jresult.SporadicSet = $jresult.SporadicSet | Sort-Object + foreach ($sporadicSample in $jresult.SporadicSet) { + $sporadicSample -match "^(.*) (\w*)\|(\w*)$" | Out-Null + $sporadicName = $Matches[1] + $sporadicConfiguration = $Matches[2] + $sporadicPlatform = $Matches[3] + Write-Output "Build sporadic errors in Sample $sporadicName; Configuration: $sporadicConfiguration; Platform: $sporadicPlatform {" + Get-Content "$LogFilesDirectory\$sporadicName.$sporadicConfiguration.$sporadicPlatform.0.err" | Write-Output + Write-Output "} $sporadicSample" + } + Write-Error "Some combinations were built with sporadic errors." + Write-Output "" } # Display timer statistics to host @@ -288,9 +318,9 @@ $SolutionsSucceeded = $jresult.SolutionsSucceeded $SolutionsExcluded = $jresult.SolutionsExcluded $SolutionsUnsupported = $jresult.SolutionsUnsupported $SolutionsFailed = $jresult.SolutionsFailed +$SolutionsSporadic = $jresult.SolutionsSporadic $Results = $jresult.Results -Write-Output "" Write-Output "Built all combinations." Write-Output "" Write-Output "Elapsed time: $min minutes, $seconds seconds." @@ -303,6 +333,7 @@ Write-Output "Succeeded: $SolutionsSucceeded" Write-Output "Excluded: $SolutionsExcluded" Write-Output "Unsupported: $SolutionsUnsupported" Write-Output "Failed: $SolutionsFailed" +Write-Output "Sporadic: $SolutionsSporadic" Write-Output "Log files directory: $LogFilesDirectory" Write-Output "Overview report: $reportFilePath" Write-Output "" -- cgit v1.3.1 From 6889bc8ede841fbee442dd668906f2798cd9936d Mon Sep 17 00:00:00 2001 From: Adonais Romero González Date: Tue, 21 Jan 2025 17:33:30 -0800 Subject: Miscellaneous improvements to build scripts (#1240) * Refactor Build-SampleSet to remove warnings & support EWDK * Improved readability and logging on Build-Sample script --- Build-Sample.ps1 | 27 +++++++++++++++------------ Build-SampleSet.ps1 | 18 ++++++++++++------ 2 files changed, 27 insertions(+), 18 deletions(-) (limited to 'Build-Sample.ps1') diff --git a/Build-Sample.ps1 b/Build-Sample.ps1 index 8c614bd2..093ba1ed 100644 --- a/Build-Sample.ps1 +++ b/Build-Sample.ps1 @@ -147,39 +147,42 @@ $myexit=0 # If we fail at first, but succeed at either of next two attempts, then it is a sporadic failure. # If we even at third attempt fail, then it is a true failure. # -for ($i=0; $i -le 2; $i++) { +for ($i = 0; $i -lt 3; $i++) +{ + $binLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.$i.binlog" $errorLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.$i.err" $warnLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.$i.wrn" $OutLogFilePath = "$LogFilesDirectory\$SampleName.$Configuration.$Platform.$i.out" - msbuild $solutionFile -clp:Verbosity=m -t:rebuild -property:Configuration=$Configuration -property:Platform=$Platform -p:TargetVersion=Windows10 -p:InfVerif_AdditionalOptions="$InfVerif_AdditionalOptions" -warnaserror -flp1:errorsonly`;logfile=$errorLogFilePath -flp2:WarningsOnly`;logfile=$warnLogFilePath -noLogo > $OutLogFilePath - if ($env:WDS_WipeOutputs -ne $null) + msbuild $solutionFile -clp:Verbosity=m -t:rebuild -property:Configuration=$Configuration -property:Platform=$Platform -p:TargetVersion=Windows10 -p:InfVerif_AdditionalOptions="$InfVerif_AdditionalOptions" -warnaserror -binaryLogger:LogFile=$binLogFilePath`;ProjectImports=None -flp1:errorsonly`;logfile=$errorLogFilePath -flp2:WarningsOnly`;logfile=$warnLogFilePath -noLogo > $OutLogFilePath + if ($null -ne $env:WDS_WipeOutputs) { - Write-Verbose ("WipeOutputs: "+$Directory+" "+(((Get-Volume ($DriveLetter=(Get-Item ".").PSDrive.Name)).SizeRemaining/1GB))) - Get-ChildItem -path $Directory -Recurse -Include x64|Remove-Item -Recurse - Get-ChildItem -path $Directory -Recurse -Include arm64|Remove-Item -Recurse + Write-Verbose ("WipeOutputs: " + $Directory + " " + (((Get-Volume (Get-Item ".").PSDrive.Name).SizeRemaining / 1GB))) + Get-ChildItem -path $Directory -Recurse -Include x64 | Remove-Item -Recurse + Get-ChildItem -path $Directory -Recurse -Include arm64 | Remove-Item -Recurse } if ($LASTEXITCODE -eq 0) { # We succeeded building. - # If at first attempt, then $myexit=0 - # If at later attempt, then $myexit=2 + # If it was at a later attempt, let the caller know with a different exit code. if ($i -eq 0) { - $myexit=0 + $myexit = 0 } else { - $myexit=2 + $myexit = 2 } - break; + # Remove binlog on success to save space; keep otherwise to diagnose issues. + Remove-Item $binLogFilePath + break; } else { # We failed building. # Let us sleep for a bit. # Then let the while loop do its thing and re-run. - sleep 1 + Start-Sleep 1 if ($Verbose) { Write-Warning "`u{274C} Build failed. Retrying to see if sporadic..." diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index f6765395..270a7eaa 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -14,7 +14,7 @@ $root = Get-Location if (-not $env:VSCMD_VER) { Import-Module (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\Common7\Tools\Microsoft.VisualStudio.DevShell.dll") Enter-VsDevShell -VsInstallPath (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*") - cd $root + Set-Location $root } $ThrottleFactor = 5 @@ -97,7 +97,7 @@ else { # Dump all environment variables so as to help debug error: Write-Output "Environment variables {" - gci env:* | sort-object name + Get-ChildItem env:* | Sort-Object name Write-Output "Environment variables }" Write-Error "Could not determine build environment." @@ -105,11 +105,17 @@ else { } # # Get the WDK extension version from installed packages -$wdk_extension_ver = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name +$wdk_extension_ver = Get-ChildItem "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select-Object -ExpandProperty Name $wdk_extension_ver = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($wdk_extension_ver).Value if (-not $wdk_extension_ver) { - Write-Error "No version of the WDK Visual Studio Extension could be found. The WDK Extension is not installed." - exit 1 + # Be lenient with EWDK builds that do not include the package information + if ($build_environment -match '^EWDK') { + $wdk_extension_ver = "(package not found)" + } + else { + Write-Error "No version of the WDK Visual Studio Extension could be found. The WDK Extension is not installed." + exit 1 + } } # # @@ -348,7 +354,7 @@ $Results = $jresult.Results Write-Output "Built all combinations." Write-Output "" Write-Output "Elapsed time: $min minutes, $seconds seconds." -Write-Output ("Disk Remaining (GB): " + (((Get-Volume ($DriveLetter = (Get-Item ".").PSDrive.Name)).SizeRemaining / 1GB))) +Write-Output ("Disk Remaining (GB): " + (((Get-Volume (Get-Item ".").PSDrive.Name).SizeRemaining / 1GB))) Write-Output ("Samples: " + $sampleSet.Count) Write-Output ("Configurations: " + $Configurations.Count + " (" + $Configurations + ")") Write-Output ("Platforms: " + $Platforms.Count + " (" + $Platforms + ")") -- cgit v1.3.1