[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xenvbd PATCH 1/3] Refactor msbuild.ps1



On 17/11/2025 09:30, Owen Smith wrote:
> Moves all repo specific data to a 'Globals' section, and simplifies the
> structure so that it can be common across all drivers.
> 
> Also seperates DVL log generation from SDV build, so that DVL logs
> can be created for CodeQL builds without SDV.
> 
> Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>

All 3 patches:

Reviewed-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>

> ---
>   msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
>   1 file changed, 43 insertions(+), 20 deletions(-)
> 
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 8028f25..3226610 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -12,6 +12,16 @@ param(
>       [switch]$CodeAnalysis
>   )
>   
> +#
> +# Globals
> +#
> +$SolutionName = "xenvbd.sln"
> +$ArchivePath = "xenvbd"
> +$ProjectList = @( "xencrsh", "xendisk", "xenvbd" )
> +
> +#
> +# Functions
> +#
>   Function Run-MSBuild {
>       param(
>               [string]$SolutionPath,
> @@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
>       Run-MSBuild $projpath $project $Configuration $Platform "Build"
>       Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
>       Run-MSBuild $projpath $project $Configuration $Platform "sdv" 
> "/check:default.sdv /debug"
> +
> +     Set-Location $basepath
> +}
> +
> +Function Run-MSBuildDVL {
> +     param(
> +             [string]$SolutionPath,
> +             [string]$Name,
> +             [string]$Configuration,
> +             [string]$Platform
> +     )
> +
> +     $basepath = Get-Location
> +     $projpath = Join-Path -Path $SolutionPath -ChildPath $Name
> +     Set-Location $projpath
> +
> +     $project = [string]::Format("{0}.vcxproj", $Name)
>       Run-MSBuild $projpath $project $Configuration $Platform "Build" 
> -CodeAnalysis
>       Run-MSBuild $projpath $project $Configuration $Platform "dvl"
>   
> @@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase 
> Release"; "checked" = "$Configu
>   $platform = @{ "x86" = "Win32"; "x64" = "x64" }
>   $solutionpath = Resolve-Path $SolutionDir
>   
> -$archivepath = "xenvbd"
> -$projectlist = @( "xencrsh", "xendisk", "xenvbd" )
> -
>   Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
>   
> -if ($Type -eq "free") {
> -     Run-MSBuild $solutionpath "xenvbd.sln" $configuration["free"] 
> $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +if (-Not (Test-Path -Path $archivepath)) {
> +     New-Item -Name $archivepath -ItemType Directory | Out-Null
>   }
> -elseif ($Type -eq "checked") {
> -     Run-MSBuild $solutionpath "xenvbd.sln" $configuration["checked"] 
> $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +
> +if (($Type -eq "free") -or ($Type -eq "checked")) {
> +     Run-MSBuild $solutionpath $SolutionName $configuration[$Type] 
> $platform[$Arch] -CodeAnalysis:$CodeAnalysis
>   }
> -elseif ($Type -eq "codeql") {
> -     if (-Not (Test-Path -Path $archivepath)) {
> -             New-Item -Name $archivepath -ItemType Directory | Out-Null
> -     }
>   
> +if ($Type -eq "codeql") {
>       if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
>               $searchpath = Resolve-Path ".."
>       } else {
> @@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
>       }
>       New-Item -ItemType Directory "database" | Out-Null
>   
> -     $projectlist | ForEach {
> -             Run-CodeQL $solutionpath $_ $configuration["codeql"] 
> $platform[$Arch] $searchpath
> +     ForEach ($project in $ProjectList) {
> +             Run-CodeQL $solutionpath $project $configuration["codeql"] 
> $platform[$Arch] $searchpath
>       }
> -
>       Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") 
> -Destination $archivepath
>   }
> -elseif ($Type -eq "sdv") {
> -     if (-Not (Test-Path -Path $archivepath)) {
> -             New-Item -Name $archivepath -ItemType Directory | Out-Null
> -     }
>   
> -     $projectlist | ForEach {
> -             Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] 
> $platform[$Arch]
> +if ($Type -eq "sdv") {
> +     ForEach ($project in $ProjectList) {
> +             Run-MSBuildSDV $solutionpath $project $configuration["sdv"] 
> $platform[$Arch]
>       }
> +}
>   
> +if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
> +     ForEach ($project in $ProjectList) {
> +             Run-MSBuildDVL $solutionpath $project $configuration["sdv"] 
> $platform[$Arch]
> +     }
>       Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") 
> -Destination $archivepath
>   }



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.