Well NintendoSwitchPkg is a project we are not involved in….

Looks like you are missing a line in your DSC file:

VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf


The build failure is VariableRuntimeDxe.inf has a dependency on on a VariableFlashInfoLib instance and the DSC does not have a mapping for one. The VariableFlashInfoLib is just the library class just implies the library API, it does not imply which library to link against. The DSC file picks the correct library instance for your platforms build. 

My guess is your edk2 version is newer and you need to sync with some changes. Here is an example of the fix you need for the OVMF project. Basically an extra dependency got added to the Variable driver so you need to update the DSC.

commit a7d3d4e7c4343c478ec8a57c6ae1ae64286d866b

Author: Michael Kubacki <michael.kubacki@microsoft.com>

Date:   Fri Apr 8 16:05:38 2022 -0400


    OvmfPkg: Add VariableFlashInfoLib

    

    REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3479

    

    Adds an instance of VariableFlashInfoLib to the platform build as

    it is a new library class introduced in MdeModulePkg.

    

    Cc: Anthony Perard <anthony.perard@citrix.com>

    Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>

    Cc: Brijesh Singh <brijesh.singh@amd.com>

    Cc: Erdem Aktas <erdemaktas@google.com>

    Cc: Gerd Hoffmann <kraxel@redhat.com>

    Cc: James Bottomley <jejb@linux.ibm.com>

    Cc: Jiewen Yao <jiewen.yao@intel.com>

    Cc: Jordan Justen <jordan.l.justen@intel.com>

    Cc: Julien Grall <julien@xen.org>

    Cc: Min Xu <min.m.xu@intel.com>

    Cc: Peter Grehan <grehan@freebsd.org>

    Cc: Rebecca Cran <rebecca@bsdio.com>

    Cc: Sebastien Boeuf <sebastien.boeuf@intel.com>

    Cc: Tom Lendacky <thomas.lendacky@amd.com>

    Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

    Acked-by: Ard Biesheuvel <ardb@kernel.org>

    Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

    Reviewed-by: Rebecca Cran <rebecca@bsdio.com>

    Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>


diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc

index f0700035c1..bead9722ea 100644

--- a/OvmfPkg/AmdSev/AmdSevX64.dsc

+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc

@@ -196,6 +196,7 @@

   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf

   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf

   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf

+  VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

 

 !if $(BUILD_SHELL) == TRUE

   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf

diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc

index 002cef32a3..f0166e136c 100644

--- a/OvmfPkg/Bhyve/BhyveX64.dsc

+++ b/OvmfPkg/Bhyve/BhyveX64.dsc

@@ -206,6 +206,7 @@

   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf

   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf

   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf

+  VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

 

   #

   # Network libraries

diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc

index d1c85f60c7..92664f319b 100644

--- a/OvmfPkg/CloudHv/CloudHvX64.dsc

+++ b/OvmfPkg/CloudHv/CloudHvX64.dsc

@@ -217,6 +217,7 @@

   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf

   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf

   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf

+  VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

 

 

   #

diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc

index 80c331ea23..00bc1255bc 100644

--- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc

+++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc

@@ -190,6 +190,7 @@

   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf

   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf

   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf

+  VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

 

   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf

   ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf

diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc

index 20c3c9c4d8..f8fc977cb2 100644

--- a/OvmfPkg/Microvm/MicrovmX64.dsc

+++ b/OvmfPkg/Microvm/MicrovmX64.dsc

@@ -207,6 +207,7 @@

   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf

   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf

   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf

+  VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

 

 

   #

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc

index 533bbdb435..c16a840fff 100644

--- a/OvmfPkg/OvmfPkgIa32.dsc

+++ b/OvmfPkg/OvmfPkgIa32.dsc

@@ -214,6 +214,7 @@

   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf

   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf

   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf

+  VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

 

 

   #

diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc

index cb68e612bd..d3a80cb568 100644

--- a/OvmfPkg/OvmfPkgIa32X64.dsc

+++ b/OvmfPkg/OvmfPkgIa32X64.dsc

@@ -218,6 +218,7 @@

   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf

   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf

   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf

+  VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

 

 

   #

diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc

index 71526bba31..c01355e5c7 100644

--- a/OvmfPkg/OvmfPkgX64.dsc

+++ b/OvmfPkg/OvmfPkgX64.dsc

@@ -232,6 +232,7 @@

   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf

   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf

   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf

+  VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

 

 

   #

diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc

index a1626d06df..6ba4bd729a 100644

--- a/OvmfPkg/OvmfXen.dsc

+++ b/OvmfPkg/OvmfXen.dsc

@@ -196,6 +196,7 @@

   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf

   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf

   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf

+  VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

 

 

   #


Happy hacking….

Thanks,

Andrew Fish

On Sep 11, 2023, at 4:17 AM, Im from ohio <artomkrivorucko@gmail.com> wrote:

I want build edk2 for aarch64 but i got this error:
-------------------------------------------------------------------------------------------------------------------

[Builder] Configure environment.
Using EDK2 in-source Basetools
WORKSPACE: /mnt/c/Users/ximi/Downloads/exploit/edk2
EDK_TOOLS_PATH: /mnt/c/Users/ximi/Downloads/exploit/edk2/BaseTools
CONF_PATH: /mnt/c/Users/ximi/Downloads/exploit/edk2/Conf
Copying $EDK_TOOLS_PATH/Conf/build_rule.template
     to /mnt/c/Users/ximi/Downloads/exploit/edk2/Conf/build_rule.txt
Copying $EDK_TOOLS_PATH/Conf/tools_def.template
     to /mnt/c/Users/ximi/Downloads/exploit/edk2/Conf/tools_def.txt
Copying $EDK_TOOLS_PATH/Conf/target.template
     to /mnt/c/Users/ximi/Downloads/exploit/edk2/Conf/target.txt
Task: EDK2 build
Use GCC at /usr/bin/aarch64-linux-gnu- to run builds.
Stamp build.
fatal: not a git repository (or any parent up to mount point /mnt)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Build NintendoSwitchPkg for NintendoSwitch (DEBUG).
Build environment: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Build start time: 13:58:23, Sep.11 2023

WORKSPACE        = /mnt/c/Users/ximi/Downloads/exploit/edk2
EDK_TOOLS_PATH   = /mnt/c/Users/ximi/Downloads/exploit/edk2/BaseTools
CONF_PATH        = /mnt/c/Users/ximi/Downloads/exploit/edk2/Conf


Processing meta-data .
Architecture(s)  = AARCH64
Build target     = DEBUG
Toolchain        = GCC5

Active Platform          = /mnt/c/Users/ximi/Downloads/exploit/edk2/NintendoSwitchPkg/NintendoSwitch.dsc
.....

build.py...
/mnt/c/Users/ximi/Downloads/exploit/edk2/NintendoSwitchPkg/NintendoSwitch.dsc(...): error 4000: Instance of library class [VariableFlashInfoLib] is not found
        in [/mnt/c/Users/ximi/Downloads/exploit/edk2/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf] [AARCH64]
        consumed by module [/mnt/c/Users/ximi/Downloads/exploit/edk2/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf]


- Failed -
Build end time: 13:58:29, Sep.11 2023
Build total time: 00:00:06

Write-Error: Build target NintendoSwitch failed.
False

-------------------------------------------------------------------------------------------------------------------

How i can fix this

_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#108495) | | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_