Skip to content

Commit

Permalink
[vioscsi] Conditionally manage DVL copying
Browse files Browse the repository at this point in the history
1. Refactors the CustomBuildStep Command to manage DVL file creation.
   We now create DVL files in the Project (driver) folder with version
   numbers in the file name for DVL files created with legacy EWDKs,
   and with the "latest" label for current EWDKs. These files are
   then copied to the relevant .\Install folders and renamed for
   extant WHCP submission operations.

2. New build\makeLegacyDVLs.bat now creates all legacy DVL files.
   This functionally replaces build\dvl1903.bat and extends it to
   service any legacy DVL build. It provides a framework to manage
   legacy DVL creation and a common place to lay out version-specific
   DVL operations and manipulations. Logging is also enabled to
   provide feedback when read at the tail of root\buildAll.bat.
   Please see PR virtio-win#1212 for details on these changes.

3. Enables Win10_SDV for local (vioscsi) buildAll.bat script.

Signed-off-by: benyamin-codez <[email protected]>
  • Loading branch information
benyamin-codez committed Dec 29, 2024
1 parent 13de4f0 commit ba9d513
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 6 deletions.
84 changes: 84 additions & 0 deletions build/makeLegacyDVLs.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
@echo off
setlocal enabledelayedexpansion

rem Add Legacy DVL folders here, seperated by a space, in the format
rem DVLbbbb, where bbbb is the Windows version, e.g. DVL1903.
rem If you do not wish to build any Legacy DVLs, leave the
rem _legacy_dvls_ variable equal to NULL.
set _legacy_dvls_=DVL1903 DVL1607

if "%_legacy_dvls_%"=="" (
echo INFO : No Legacy DVLs were selected for building.
goto :eof
)
if "%DVL1607%"=="" set DVL1607=C:\DVL1607
if "%DVL1903%"=="" set DVL1903=C:\DVL1903
set "ProjDir=%~1"
set "IntDir_DVL=%~1%~2"
set "TargetName_DVL=%~3"
set "CONFIGURATION_DVL=%~4"
set "PLATFORM_DVL=%~5"
if exist "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt" (
del /f "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt"
)
echo.
call :proc_legacy_dvls %_legacy_dvls_%
endlocal
goto :eof

:proc_legacy_dvls
if "%~1"=="" goto :eof
call :do_dvl %1
shift
goto :proc_legacy_dvls

:do_dvl
set dvl_ver=%1
set dvl_ver=%dvl_ver:~-4%
if exist !%~1! (
echo Found !%~1!. Building Driver Verification Log for Windows 10 version !dvl_ver!...
!%~1!\dvl.exe
if "!errorlevel!" NEQ "0" (
echo ERROR building Driver Verification Log for Windows 10 version !dvl_ver!.
echo The DVL file %ProjDir%%TargetName_DVL%.DVL-win10-!dvl_ver!.XML will NOT exist.
echo.
echo !dvl_ver!,fail >> "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt"
goto :eof
)
echo Copying DVL to %ProjDir%%TargetName_DVL%.DVL-win10-!dvl_ver!.XML.
copy /y "%ProjDir%%TargetName_DVL%.DVL.XML" "%ProjDir%%TargetName_DVL%.DVL-win10-!dvl_ver!.XML"
echo !dvl_ver!,!dvl_ver! >> "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt"
) else (
echo The !%~1! directory was not found. Unable to build Driver Verification Log.
if "%~1"=="DVL1607" (
if exist "%ProjDir%%TargetName_DVL%.DVL-win10-1903.XML" (
echo Creating Driver Verification Log for Windows 10 version !dvl_ver! from alternate DVL instead.
echo Alternate DVL : %TargetName_DVL%.DVL-win10-1903.XML
findstr /v /c:"General.Checksum" "%ProjDir%%TargetName_DVL%.DVL-win10-1903.XML" > "%ProjDir%%TargetName_DVL%.DVL-win10-!dvl_ver!.XML"
echo 1607,1903 >> "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt"
) else (
if exist "%ProjDir%%TargetName_DVL%.DVL-win10-latest.XML" (
echo Creating Driver Verification Log for Windows 10 version !dvl_ver! from alternate DVL instead.
echo Alternate DVL : %TargetName_DVL%.DVL-win10-latest.XML
findstr /v /c:"General.Checksum" "%ProjDir%%TargetName_DVL%.DVL-win10-latest.XML" | findstr /v /c:".Semmle." > "%ProjDir%%TargetName_DVL%.DVL-win10-!dvl_ver!.XML"
echo 1607,latest >> "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt"
) else (
echo Unable to create Driver Verification Log from alternates as no suitable alternate exists.
echo.
echo 1607,fail >> "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt"
goto :eof
)
)
echo Driver Verification Log Created. You can locate the Driver Verification Log file at:
echo %ProjDir%%TargetName_DVL%.DVL-win10-!dvl_ver!.XML
)
if "%~1"=="DVL1903" (
echo Unable to create Driver Verification Log from alternates as no suitable alternate exists.
echo.
echo 1903,fail >> "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt"
goto :eof
)
)
echo Finished creating Driver Verification Log for Windows 10 version !dvl_ver!.
echo.
goto :eof
2 changes: 1 addition & 1 deletion vioscsi/buildAll.bat
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ if "%VIRTIO_WIN_NO_ARM%"=="" call ..\build\build.bat vioscsi.sln "Win10 Win11" A
if errorlevel 1 goto :eof
call ..\build\build.bat vioscsi.sln "Win10 Win11" %*
if errorlevel 1 goto :eof
call ..\build\build.bat vioscsi.vcxproj "Win11_SDV" %*
call ..\build\build.bat vioscsi.vcxproj "Win10_SDV Win11_SDV" %*
36 changes: 31 additions & 5 deletions vioscsi/vioscsi.vcxproj
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,39 @@
<ItemDefinitionGroup>
<CustomBuildStep>
<Command>
copy /Y $(ProjectDir)vioscsi.DVL.XML $(ProjectDir)Install\$(TargetOS)\$(TargetArch)
echo Copying $(TargetName).DVL.XML to Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL.XML
copy /Y $(ProjectDir)$(TargetName).DVL.XML^
$(ProjectDir)Install\$(TargetOS)\$(TargetArch)
echo Copying $(IntDir)vc.nativecodeanalysis.all.xml to $(ProjectDir)
copy /Y $(IntDir)vc.nativecodeanalysis.all.xml $(ProjectDir)
call "..\build\dvl1903.bat" "$(ProjectDir)\$(IntDir)" "$(TargetName)" "$(Configuration)" "$(Platform)"
copy /Y $(ProjectDir)vioscsi.DVL.XML $(ProjectDir)Install\$(TargetOS)\$(TargetArch)\vioscsi.DVL-win10.XML
if "$(TargetOS)"=="Win10" (
echo Copying $(TargetName).DVL.XML to $(ProjectDir)$(TargetName).DVL-win10-latest.XML
copy /Y $(ProjectDir)$(TargetName).DVL.XML^
$(ProjectDir)$(TargetName).DVL-win10-latest.XML
)
if "$(TargetOS)"=="Win11" (
echo Copying $(TargetName).DVL.XML to $(ProjectDir)$(TargetName).DVL-win11-latest.XML
copy /Y $(ProjectDir)$(TargetName).DVL.XML^
$(ProjectDir)$(TargetName).DVL-win11-latest.XML
)
call "..\build\makeLegacyDVLs.bat" "$(ProjectDir)" "$(IntDir)" "$(TargetName)" "$(Configuration)" "$(Platform)"
if exist "$(ProjectDir)$(TargetName).DVL-win10-1903.XML" (
echo Copying $(TargetName).DVL-win10-1903.XML to Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL-win10.XML
copy /Y $(ProjectDir)$(TargetName).DVL-win10-1903.XML^
$(ProjectDir)Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL-win10.XML
) else (
echo Unable to copy Win10 DVL $(ProjectDir)$(TargetName).DVL-win10-1903.XML - it does not exist.
)
if exist "$(ProjectDir)$(TargetName).DVL-win10-1607.XML" (
echo Copying $(TargetName).DVL-win10-1607.XML to Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL-compat.XML
copy /Y $(ProjectDir)$(TargetName).DVL-win10-1607.XML^
$(ProjectDir)Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL-compat.XML
) else (
echo Unable to copy COMPAT DVL $(ProjectDir)$(TargetName).DVL-win10-1607.XML - it does not exist.
)
</Command>
<Inputs>$(IntDir)vc.nativecodeanalysis.all.xml;$(ProjectDir)vioscsi.DVL.XML</Inputs>
<Outputs>$(ProjectDir)Install\$(TargetOS)\$(TargetArch)\vioscsi.DVL.XML;$(ProjectDir)Install\$(TargetOS)\$(TargetArch)\vioscsi.DVL-win10.XML</Outputs>
<Inputs>$(IntDir)vc.nativecodeanalysis.all.xml;$(ProjectDir)$(TargetName).DVL.XML</Inputs>
<Outputs>$(ProjectDir)Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL.XML;$(ProjectDir)Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL-win10.XML</Outputs>
</CustomBuildStep>
<ClCompile>
<WppEnabled Condition="'$(Configuration)|$(Platform)'=='Win10 Release|Win32'">true</WppEnabled>
Expand Down

0 comments on commit ba9d513

Please sign in to comment.