Skip to content

Commit

Permalink
[build] Fix and extend build scripting
Browse files Browse the repository at this point in the history
a) Fixed various syntax issues, e.g. unquoted variables
b) Unwrapped nested IF statements to ensure no jumping out of loops
c) Extended colour pallette to stdout
d) Introduced environment variable SKIP_SDV_ACTUAL to skip
   Static Driver Verifier (SDV) during analysis builds. CodeQL,
   Code Analysis (CA) and DVL operations are still executed.
   Default is to perform the SDV build (unchanged behaviour).
e) Make actual SDV build conditional (Win10_SDV only)
f) Introduced managed CodeQL package cache and test suite versioning
   control. If the CodeQL binary is detected at CODEQL_BIN a CodeQL
   build commences, otherwise it is skipped (unchanged behaviour).
   The package cache versions are set in the :config_ql_whcp
   function (new). Test suite versioning is via git hash of the
   WDK Developer Supplemental Tools repository (new, depends on git).
   The versions are determined by the value of the WHCP_LEVEL variable,
   which can be either WHCP_LEGACY or WHCP_24H2. Provision for future
   WHCP versions is templated as WHCP_NEXT.
g) Introduced environment variable CODEQL_OFFLINE_ONLY to perform
   package cache and suite version checking but NOT download any needed
   updates. Exits on error expecting resolution. Requires git.
h) Introduced environment variable CODEQL_RUN_BLIND to retain legacy
   behaviour and perform no package cache or suite version checking.
   It presumes the prerequisites are present. Removes git dependency.
i) Pre-builds x86 viosock libraries when building virtio-win.sln or
   viosock.sln for amd64 in the circumstances the required x86 libraries
   do not already exist.
j) If running in a Germanium EWDK environment, the script will instantiate
   a Cobalt EWDK environment to build Win10 SDV operations, and will
   return to Germanium EWDK when done.
k) Use Germanium EWDK to sign Win11 drivers.
l) Enforce echo off after calling SetupBuildEnv.cmd
m) Provide some extra EWDK details when EnterpriseWDK=True
n) Prettify last leg of build and provide SUCCESS / FAIL feedback.

Signed-off-by: benyamin-codez <[email protected]>
  • Loading branch information
benyamin-codez committed Dec 5, 2024
1 parent 13de4f0 commit da96c89
Show file tree
Hide file tree
Showing 4 changed files with 661 additions and 78 deletions.
9 changes: 8 additions & 1 deletion build/SetVsEnv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ if not "%EnterpriseWDK%"=="" goto ready
if "%1"=="Win11" (
if "%EWDK11_24H2_DIR%"=="" set EWDK11_24H2_DIR=c:\ewdk11_24h2
call %EWDK11_24H2_DIR%\BuildEnv\SetupBuildEnv.cmd
@echo off
goto :eof
) else (
if "%EWDK11_DIR%"=="" set EWDK11_DIR=c:\ewdk11
:: call :add_path "%EWDK11_DIR%\Program Files\Microsoft Visual Studio\2019\BuildTools\VC\Redist\MSVC\14.28.29910\onecore\x86\Microsoft.VC142.OPENMP\vcomp140.dll"
call %EWDK11_DIR%\BuildEnv\SetupBuildEnv.cmd
@echo off
goto :eof
)

Expand All @@ -23,5 +25,10 @@ set path=%path%;%~dp1
goto :eof

:ready
echo We are already in EWDK version: %Version_Number%
for /f "tokens=4 usebackq delims=\'" %%i in (`echo %%VSINSTALLDIR%%`) do @set vs_year=%%i
echo **********************************************************************
echo ** We are already in an Enterprise WDK build environment
echo ** Version %BuildLab% ^| %Version_Number%
echo ** Visual Studio %vs_year% Developer Command Prompt v%VSCMD_VER%
echo **********************************************************************
goto :eof
Loading

0 comments on commit da96c89

Please sign in to comment.