Re: Build failures Windows10, VS2019


Andrew Fish
 

I’ve not built on Windows in a long time but ……

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:
edksetup.bat Rebuild

To setup a terminal window for a build you need to:
edksetup.bat


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.

Thanks,

Andrew Fish

On Aug 13, 2021, at 10:44 AM, dss.v1.0@gmail.com wrote:

Friends,

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:

```
(.venv)>edk2_build
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


Processing meta-data
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]
PlatVarCleanup.vfr
"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'
Stop.
```

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.
thanks,
Dan




Join discuss@edk2.groups.io to automatically receive all group messages.