Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vioscsi] Conditionally manage DVL copying #1210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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