From: "Leif Lindholm via groups.io" <leif.lindholm=oss.qualcomm.com@groups.io>
To: "Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "discuss@edk2.groups.io" <discuss@edk2.groups.io>,
"rithrama@amd.com" <rithrama@amd.com>,
Michael Kubacki <mikuback@linux.microsoft.com>,
edk2-devel-groups-io <devel@edk2.groups.io>
Subject: Re: [edk2-devel] [edk2-discuss] [Bug]: EmbeddedPkg/VirtualRealTimeClockLib fails to build.
Date: Mon, 30 Jun 2025 11:08:34 +0100 [thread overview]
Message-ID: <CAD=n3R2je25V-3iAmn25KCPOSsAYBkurUQg5yBfidYLnN4UafQ@mail.gmail.com> (raw)
In-Reply-To: <CO1PR11MB4929A10F49E5DBB0FAC71F76D27AA@CO1PR11MB4929.namprd11.prod.outlook.com>
On Thu, 26 Jun 2025 at 22:25, Kinney, Michael D
<michael.d.kinney@intel.com> wrote:
> EmbeddedPkg/VirtualRealTimeClockLib change:
> https://github.com/mdkinney/edk2/commit/51430285377e4d6298ec2b3ea9243d1c8ef9fb2a
Yes, this approach is defnitely what we want for the module.
> BaseTools change:
> https://github.com/mdkinney/edk2/commit/a596ddc61d649e52db861e0fb6613c0a47336b6e
A few thoughs about this one:
- Clearly the naming builds on SOURCE_DATE_EPOCH. Is there value in
adding our own prefix?
- If we do add our own prefix, is there a corresponding change in semantics?
- Alternatively, could we do an "if not defined SOURCE_DATE_EPOCH,
..., set SOURCE_DATE_EPOCH
to current time"?
/
Leif
> Mike
>
> > -----Original Message-----
> > From: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
> > Sent: Thursday, June 26, 2025 1:03 PM
> > To: Kinney, Michael D <michael.d.kinney@intel.com>
> > Cc: discuss@edk2.groups.io; rithrama@amd.com; Michael Kubacki
> > <mikuback@linux.microsoft.com>; edk2-devel-groups-io <devel@edk2.groups.io>
> > Subject: Re: [edk2-discuss] [Bug]: EmbeddedPkg/VirtualRealTimeClockLib
> > fails to build.
> >
> > Hi Mike,
> >
> > I like that idea. Sounds like something that could be useful in other
> > places as well.
> >
> > Regards,
> >
> > Leif
> >
> > On Thu, 26 Jun 2025 at 20:02, Kinney, Michael D
> > <michael.d.kinney@intel.com> wrote:
> > >
> > > Hi Leif,
> > >
> > > I have looked at this and suggest we add a new env var to the edk2 build
> > > that captures the EPOCH value in python code and sets the env var and
> > > that env var can be used in INF files removing the use of OS specific
> > > commands.
> > >
> > > Will require change to EDK II Build Spec and BaseTools.
> > >
> > > Also need to support override of EPOCH value to a constant value to
> > > support reproducible builds.
> > >
> > > I have a POC of this that I can share.
> > >
> > > Mike
> > >
> > >
> > > > -----Original Message-----
> > > > From: discuss@edk2.groups.io <discuss@edk2.groups.io> On Behalf Of Leif
> > > > Lindholm via groups.io
> > > > Sent: Thursday, June 26, 2025 2:59 AM
> > > > To: rithrama@amd.com
> > > > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Michael Kubacki
> > > > <mikuback@linux.microsoft.com>; discuss@edk2.groups.io; edk2-devel-
> > groups-
> > > > io <devel@edk2.groups.io>
> > > > Subject: Re: [edk2-discuss] [Bug]: EmbeddedPkg/VirtualRealTimeClockLib
> > > > fails to build.
> > > >
> > > > On Wed, 25 Jun 2025 at 23:14, Rithvik Rama via groups.io
> > > > <rithrama=amd.com@groups.io> wrote:
> > > > > The EmulatorPkg throws below error when running a build:
> > > > >
> > > >
> > edk2\EmbeddedPkg\Library\VirtualRealTimeClockLib\VirtualRealTimeClockLib.c(
> > > > 89): error C2065: 'BUILD_EPOCH': undeclared identifier
> > > >
> > > > I don't see EmbeddedPkg referenced in EmulatorPkg. Is EmulatorPkg a
> > typo
> > > > above?
> > > >
> > > > > The reason I raised this discussion is because the source file
> > comments
> > > > asks me to bring this up with the mailing list:
> > > > > //
> > > > > // The following is intended to produce a compilation error on
> > build
> > > > > // environments where BUILD_EPOCH can not be set from inline
> > shell.
> > > > > // If you are attempting to use this library on such an
> > environment,
> > > > please
> > > > > // contact the edk2 mailing list, so we can try to add support
> > for
> > > > it.
> > > > > //
> > > > >
> > > > > The toolchain I used:
> > > > > VS2022
> > > > > Windows 11.
> > > > >
> > > > > May I know the root cause of this issue and how do I continue to
> > build
> > > > the EmbeddedPkg successfully?
> > > >
> > > > The answer is simple. A lot of EmbeddedPkg has only been tested
> > > > with/developed for GCC family of
> > > > toolchains.
> > > >
> > > > For those, we generate the BUILD_EPOCH here:
> > > >
> > https://github.com/tianocore/edk2/blob/master/EmbeddedPkg/Library/VirtualRe
> > > > alTimeClockLib/VirtualRealTimeClockLib.inf#L37
> > > > GCC:*_*_*_CC_FLAGS = -DBUILD_EPOCH=`printenv SOURCE_DATE_EPOCH ||
> > date
> > > > +%s`
> > > > only sets BUILD_EPOCH for GCC family of toolchains.
> > > >
> > > > I don't know how to best wrangle this together for a Visual Studio
> > > > environment.
> > > > Maybe a better way there would be to do something with __DATE__ and
> > > > __TIME__ macros,
> > > > but I don't think the formats of those are portable between toolchains.
> > > > Mike, Michael - thoughts?
> > > >
> > > > A hack that would let you build this would be to add a line like such:
> > > > MSFT:*_*_*_CC_FLAGS = -DBUILD_EPOCH=1750931236
> > > > (timestamp generated by me in a linux shell with "git log -1
> > > > --pretty=%ct | date +%s")
> > > >
> > > > /
> > > > Leif
> > > >
> > > >
> > > >
> > > >
> > >
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121437): https://edk2.groups.io/g/devel/message/121437
Mute This Topic: https://groups.io/mt/113840675/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2025-06-30 10:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CyL3.1750381754189969284.gEVT@groups.io>
2025-06-26 9:58 ` [edk2-devel] [edk2-discuss] [Bug]: EmbeddedPkg/VirtualRealTimeClockLib fails to build Leif Lindholm via groups.io
2025-06-26 19:02 ` Michael D Kinney via groups.io
2025-06-26 20:02 ` Leif Lindholm via groups.io
2025-06-26 21:24 ` Michael D Kinney via groups.io
2025-06-30 10:08 ` Leif Lindholm via groups.io [this message]
2025-06-30 17:24 ` Michael D Kinney via groups.io
2025-07-01 12:01 ` Leif Lindholm via groups.io
2025-07-02 16:25 ` Michael D Kinney via groups.io
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='CAD=n3R2je25V-3iAmn25KCPOSsAYBkurUQg5yBfidYLnN4UafQ@mail.gmail.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