Build failures Windows10, VS2019
Does anyone have a link to a single and consistent description of a build of edk2 starting from scratch on a new Windows 10 machine using the python BaseTools etc? The several recipes I have tried have all ultimately failed me.
Currently this is my breaking point:
Build environment: Windows-10-10.0.19042-SP0
Build start time: 13:29:22, Aug.13 2021
WORKSPACE = c:\users\dss\dev\mc\edk2
EDK_TOOLS_PATH = c:\users\dss\dev\mc\edk2\basetools
EDK_TOOLS_BIN = c:\users\dss\dev\mc\edk2\basetools\bin\win32
CONF_PATH = c:\users\dss\dev\mc\edk2\conf
PYTHON_COMMAND = py -3
Architecture(s) = X64
Build target = DEBUG
.Toolchain = VS2019
Active Platform = c:\users\dss\dev\mc\edk2\MdeModulePkg\MdeModulePkg.dsc
(many inf's built here)
Building ... c:\users\dss\dev\mc\edk2\MdeModulePkg\Library\PlatformVarCleanupLib\PlatformVarCleanupLib.inf [X64]
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.20.27508\bin\Hostx86\x64\cl.exe" /showIncludes /nologo /E /TC /DVFRCOMPILE /FIPlatformVarCleanupLibStrDefs.h /Ic:\users\dss\dev\mc\edk2\MdeModulePkg\Library\PlatformVarCleanupLib /Ic:\users\dss\dev\mc\edk2\Build\MdeModule\DEBUG_VS2019\X64\MdeModulePkg\Library\PlatformVarCleanupLib\PlatformVarCleanupLib\DEBUG /Ic:\users\dss\dev\mc\edk2\MdePkg /Ic:\users\dss\dev\mc\edk2\MdePkg\Include /Ic:\users\dss\dev\mc\edk2\MdePkg\Test\UnitTest\Include /Ic:\users\dss\dev\mc\edk2\MdePkg\Include\X64 /Ic:\users\dss\dev\mc\edk2\MdeModulePkg /Ic:\users\dss\dev\mc\edk2\MdeModulePkg\Include /Ic:\users\dss\dev\mc\edk2\MdeModulePkg\Library\BrotliCustomDecompressLib\brotli\c\include c:\users\dss\dev\mc\edk2\MdeModulePkg\Library\PlatformVarCleanupLib\PlatVarCleanup.vfr > c:\users\dss\dev\mc\edk2\Build\MdeModule\DEBUG_VS2019\X64\MdeModulePkg\Library\PlatformVarCleanupLib\PlatformVarCleanupLib\OUTPUT\PlatVarCleanup.i
Building ... c:\users\dss\dev\mc\edk2\MdeModulePkg\Library\DxePrintLibPrint2Protocol\DxePrintLibPrint2Protocol.inf [X64]
"VfrCompile" -l -n --string-db c:\users\dss\dev\mc\edk2\Build\MdeModule\DEBUG_VS2019\X64\MdeModulePkg\Library\PlatformVarCleanupLib\PlatformVarCleanupLib\OUTPUT\PlatformVarCleanupLibStrDefs.hpk --output-directory c:\users\dss\dev\mc\edk2\Build\MdeModule\DEBUG_VS2019\X64\MdeModulePkg\Library\PlatformVarCleanupLib\PlatformVarCleanupLib\DEBUG\. c:\users\dss\dev\mc\edk2\Build\MdeModule\DEBUG_VS2019\X64\MdeModulePkg\Library\PlatformVarCleanupLib\PlatformVarCleanupLib\OUTPUT\PlatVarCleanup.i
Building ... c:\users\dss\dev\mc\edk2\MdeModulePkg\Library\PeiReportStatusCodeLib\PeiReportStatusCodeLib.inf [X64]
'VfrCompile' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: '"VfrCompile' : return code '0x1'
I have made a number of passes at it from various wiki's, README.rst's with no luck. Many months ago I chanced upon an install sequence that gave me a development workspace which would build .EFI apps, HelloWorld and such with some precompiled win32 basetools binaries. But that is now not reproducible.
Using the somewhat inconsistent instructions from the wiki, windows_build, https://pypi.org/project/edk2-basetools/ (which humorously explains edk2-basetools is not on pyPI, yes I see it was just added). I also looked at the CI implementation, but it is so containerized I could not glean my path through it. Mathew Carlsons repo and comments in discussions have moved me much closer to success than I was. But as seen above that was still not enough for me.
Anyhow, any help is appreciated.
I’ve not built on Windows in a long time but ……toggle quoted messageShow quoted text
VfrCompile is a C tool from the BaseTools project. So it requires that you build the BaseTools, and have the BaseTools executables in your path.
From the root of your edk2 git tree you need to...
To build the C BaseTools you:
To setup a terminal window for a build you need to:
If you are not modifying the build tools you only need to build the BaseTools if you update the source code for the BaseTools.
You need to run edksetup.bat once for your terminal window. It should setup the path for you, and you should be good.
Not sure what `edk2_build` does in your example.
On Aug 13, 2021, at 10:44 AM, dss.v1.0@... wrote:
Hello Dan,toggle quoted messageShow quoted text
VfrCompile is a c based barstools and should be compiled (I think edk2 setup does this). Do you see that? I think it will be under Basetools/Source/C/bin
On Aug 13, 2021, at 12:44 PM, dss.v1.0@... wrote:
Just to add yet another way and more info about how the CI does all this for every commit (I hate batch files and the junk in "edksetup")toggle quoted messageShow quoted text
If you follow this:
You can build CI which will build and test packages like MdeModulePkg.dsc and others.
But there is one missing step between step 4 and Step 5.
You need to build the edk2 basetools. My preferred method is:
python BaseTools/Edk2ToolsBuild.py -t VS2019
If you want to build a platform like OVMF or EmulatorPkg they also have ReadMe.md files with pretty good details that include this required step.
Hope that helps.
On 8/13/2021 10:44 AM, dss.v1.0@... wrote: