diff options
| author | JakobL-MSFT <[email protected]> | 2024-06-28 09:56:29 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-06-28 09:56:29 -0700 |
| commit | 263b19b4347fcda2e236c14a9daf41e7d518625d (patch) | |
| tree | 200236a019eeee7e0b4e08cb0b23839ea0d7e611 /Build-SampleSet.ps1 | |
| parent | 41b5bca9edf38ca02d5d034e9dd2afb99777a609 (diff) | |
RI develop to main (#1189)
* Memory leakage in message
"sizeof(SCANNER_MESSAGE) * threadCount * requestCount" bytes long memory is allocated but only "sizeof(SCANNER_MESSAGE) * threadCount" bytes long of it is freed.
* Handles malloc function fail case
* Refactors comment line
* Solves the miscalculation of the message index
* simbatt: Fix broken registry read-back
The GetSimBattStateFromRegistry function is currently using default settings if GetSimBattStateFromRegistry succeeds, whereas settings from registry are only applied if GetSimBattStateFromRegistry fails. This does not make sense to me.
Therefore proposing to remove the `!` negation from `if (!NT_SUCCESS(Status)) {` on the line after `Status = GetSimBattStateFromRegistry(Device, RegState);` so that default settings are loaded when registry read-back fails.
* Issue of freeing memory without waiting completion of threads accessing it is fixed
* Fixes information leakage warning
Fixes the issue of possible information leakage from uninitialized padding bytes
* Avoids possible multiplication overflow warning
* Avoids possible multiplication overflow warning
* CI Pipelines build with WDK Nuget Packages (#1179)
Integrate nuget into the workflow pipelines
* FI from main to develop (#1188)
Fix text and minor issues in Winget configuration files
Co-authored-by: Adonais Romero Gonzalez <[email protected]>
* Improve version info, vsix installation, and update building locally readme
* Fix printing vsix version
* Refactored vsix install and cleaned up build sampleset
---------
Co-authored-by: İsa Yurdagül <[email protected]>
Co-authored-by: Fredrik Orderud <[email protected]>
Co-authored-by: Christian Allred <[email protected]>
Co-authored-by: tristanb-ntdev <[email protected]>
Co-authored-by: Matt <[email protected]>
Co-authored-by: Adonais Romero Gonzalez <[email protected]>
Diffstat (limited to 'Build-SampleSet.ps1')
| -rw-r--r-- | Build-SampleSet.ps1 | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index b0da097a..adae8bb0 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -9,6 +9,14 @@ param( ) $root = Get-Location + +# launch developer powershell (if necessary to prevent multiple developer sessions) +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 +} + $ThrottleFactor = 5 $LogicalProcessors = (Get-CIMInstance -Class 'CIM_Processor' -Verbose:$false).NumberOfLogicalProcessors @@ -45,27 +53,34 @@ finally { } # -# Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. Only used to determine build number. +# Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. # Determine build number (used for exclusions based on build number). Five digits. Say, '22621'. +# Determine NuGet package version (if applicable). +# Determine WDK vsix version. # $build_environment="" $build_number=0 +$nuget_package_version=0 +$vsix_version="" # -# WDK NuGet will require presence of a folder 'packages' +# In Github we build using NuGet and get the version from packages and vsix version from env var set from the install vsix step. # -# -# 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 '') { +if ($env:GITHUB_REPOSITORY) { $build_environment="GitHub" - $build_number=22621 + $nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value + $build_number=$nuget_package_version.split('.')[2] + $vsix_version = $env:SAMPLES_VSIX_VERSION } # -# Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named .\packages. +# WDK NuGet will require presence of a folder 'packages'. The version is sourced from repo .\Env-Vars.ps1. +# +# Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named '.\packages'. +# Further, we need to test that the directory has been hydrated using '.\packages\*'. # -elseif(Test-Path(".\packages")) { +elseif(Test-Path(".\packages\*")) { $build_environment=("NuGet") - $build_number=26100 + $nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value + $build_number=$nuget_package_version.split('.')[2] } # # EWDK sets environment variable BuildLab. For example 'ni_release_svc_prod1.22621.2428'. @@ -91,7 +106,19 @@ else { Write-Error "Could not determine build environment." exit 1 } - +# +# Get the vsix version from packages if not set +if (-not $vsix_version) { + $vsix_version = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name + if ($vsix_version) { + $vsix_version = $vsix_version.split('=')[1] + } + else { + Write-Error "No version of the WDK VSIX could be found. The WDK VSIX is not installed." + exit 1 + } +} +# # # InfVerif_AdditionalOptions # @@ -155,6 +182,8 @@ $SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count Write-Output ("Build Environment: " + $build_environment) Write-Output ("Build Number: " + $build_number) +if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { Write-Output ("Nuget Package Version: " + $nuget_package_version) } +Write-Output ("WDK VSIX Version: " + $vsix_version) Write-Output ("Samples: " + $sampleSet.Count) Write-Output ("Configurations: " + $Configurations.Count + " (" + $Configurations + ")") Write-Output ("Platforms: " + $Platforms.Count + " (" + $Platforms + ")") |
