tandasat / MiniVisorPkg

The research UEFI hypervisor that supports booting an operating system.
https://standa-note.blogspot.com/2020/03/introduction-and-design-considerations.html
MIT License
556 stars 88 forks source link

Instance of library class [RegisterFilterLib] is not found #10

Closed M0n7y5 closed 2 years ago

M0n7y5 commented 2 years ago

Hello, i tried to follow building guide, but i am getting this error:

build.py...
c:\edk2\MiniVisorPkg\Builds\Platform\EFI\MiniVisorPkg.dsc(...): error 4000: Instance of library class [RegisterFilterLib] is not found
        in [c:\edk2\MdePkg\Library\BaseLib\BaseLib.inf] [X64]
        consumed by module [c:\edk2\MiniVisorPkg\Builds\Platform\EFI\MiniVisorDxe.inf]
tandasat commented 2 years ago

Try adding RegisterFilterLibNull.inf into .dsc file.

[LibraryClasses]
...
  RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
M0n7y5 commented 2 years ago

Now i am getting this

build.py...
 : error C0DE: Unknown fatal error when processing [c:\edk2\MiniVisorPkg\Builds\Platform\EFI\MiniVisorPkg.dsc]

(Please send email to devel@edk2.groups.io for help, attaching following call stack trace!)

(Python 3.10.0 on win32) Traceback (most recent call last):
  File "C:\edk2\BaseTools\Source\Python\build\build.py", line 2695, in Main
    MyBuild.Launch()
  File "C:\edk2\BaseTools\Source\Python\build\build.py", line 2490, in Launch
    self._MultiThreadBuildPlatform()
  File "C:\edk2\BaseTools\Source\Python\build\build.py", line 2282, in _MultiThreadBuildPlatform
    Wa, self.BuildModules = self.PerformAutoGen(BuildTarget,ToolChain)
  File "C:\edk2\BaseTools\Source\Python\build\build.py", line 2133, in PerformAutoGen
    Wa = WorkspaceAutoGen(
  File "C:\edk2\BaseTools\Source\Python\AutoGen\WorkspaceAutoGen.py", line 43, in __init__
    self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
  File "C:\edk2\BaseTools\Source\Python\AutoGen\WorkspaceAutoGen.py", line 117, in _InitWorker
    self.ProcessPcdType()
  File "C:\edk2\BaseTools\Source\Python\AutoGen\WorkspaceAutoGen.py", line 264, in ProcessPcdType
    Platform.Pcds
  File "C:\edk2\BaseTools\Source\Python\Workspace\DscBuildData.py", line 1205, in Pcds
    self._Pcds.update(self._GetPcd(MODEL_PCD_FIXED_AT_BUILD))
  File "C:\edk2\BaseTools\Source\Python\Workspace\DscBuildData.py", line 1722, in _GetPcd
    PcdValue, DatumType, MaxDatumSize = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)
  File "C:\edk2\BaseTools\Source\Python\Workspace\DscBuildData.py", line 924, in _ValidatePcd
    self._DecPcds, self._GuidDict = GetDeclaredPcd(self, self._Bdb, self._Arch, self._Target, self._Toolchain, PkgSet)
  File "C:\edk2\BaseTools\Source\Python\Workspace\WorkspaceCommon.py", line 60, in GetDeclaredPcd
    PkgList = GetPackageList(Platform, BuildDatabase, Arch, Target, Toolchain)
  File "C:\edk2\BaseTools\Source\Python\Workspace\WorkspaceCommon.py", line 45, in GetPackageList
    for Lib in GetLiabraryInstances(Data, Platform, BuildDatabase, Arch, Target, Toolchain):
  File "C:\edk2\BaseTools\Source\Python\Workspace\WorkspaceCommon.py", line 91, in GetLiabraryInstances
    return GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain,Platform.MetaFile,EdkLogger)
  File "C:\edk2\BaseTools\Source\Python\Workspace\WorkspaceCommon.py", line 140, in GetModuleLibInstances
    LibraryModule = BuildDatabase[LibraryPath, Arch, Target, Toolchain]
  File "C:\edk2\BaseTools\Source\Python\Workspace\WorkspaceDatabase.py", line 104, in __getitem__
    BuildObject = self.CreateBuildObject(FilePath, Arch, Target, Toolchain)
  File "C:\edk2\BaseTools\Source\Python\Workspace\WorkspaceDatabase.py", line 108, in CreateBuildObject
    Ext = FilePath.Type
AttributeError: 'str' object has no attribute 'Type'

Looks like its a bug in EDK2?

M0n7y5 commented 2 years ago

Is it working on your side? Or are you using older version of EDK?

tandasat commented 2 years ago

It is working fine on my side. I just confirmed the project built fine with edk2-stable202111 and pushed a change I made locally for your sanity check.

M0n7y5 commented 2 years ago

Hmm thats weird ... i am gonna try clear everything up and follow your guide again.

M0n7y5 commented 2 years ago

Ok so ... what i basically did was cloning and building whole edk2 repo because released zip file of edk2-stable202111 is corrupted. Is there a way to report this issue? And also where did you get uncurrupted zip file? Or did you clone the whole repo too?

tandasat commented 2 years ago

I clone all repo including submodules. the zip file is pretty small and appears not to include submodules.

M0n7y5 commented 2 years ago

Fixed by deleting and redownloading edk2 repo