public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Andrew Fish via groups.io" <afish=apple.com@groups.io>
To: devel@edk2.groups.io, artomkrivorucko@gmail.com
Subject: Re: [edk2-devel] How i can fix this build error VariableRuntimeDxe.inf
Date: Mon, 11 Sep 2023 10:47:02 -0700	[thread overview]
Message-ID: <4329C77A-480E-4A11-AA35-F280A18D7E63@apple.com> (raw)
In-Reply-To: <CALDuMidnonk0k81Rveff1JS5J=eLksj9s5HPDb_0UXFXM0HjZg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 10335 bytes --]

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): https://edk2.groups.io/g/devel/message/108495
Mute This Topic: https://groups.io/mt/101298264/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 85855 bytes --]

      reply	other threads:[~2023-09-11 17:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11 11:17 [edk2-devel] How i can fix this build error Im from ohio
2023-09-11 17:47 ` Andrew Fish via groups.io [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4329C77A-480E-4A11-AA35-F280A18D7E63@apple.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox