From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 0FC30AC03BF for ; Mon, 10 Jun 2024 21:11:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=g0MmGJLanZfRnlu+G31k8p9eWTgMO/XNcDKMTRxC9qA=; c=relaxed/simple; d=groups.io; h=Subject:To:From:User-Agent:MIME-Version:Date:References:In-Reply-To:Message-ID:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1718053871; v=1; b=wDzaG/0LSzmG2SWdUxvhSBhdG2xfs19C0XqiwF3ybAX4Q96K4hSX97LfyWSp3VIYA+49+a/T Wgei8rWZF+0UMIeNZBmBL8zx38D1dDusgi7Mv53zAczqU70vzvQKTcccslL/2NVKaqYq1XMZCe6 wgEequYNrCt3pqCRCyeyppARfB0uOysyWA31mXDdTIK37HaMC9bRuKgBIfun9z1hvWV95+TsfpT c4pz52qApI4x8y1RPCOOjKJ6tNNkiO6QcFyI8VEIoRpDGP+Pdbazs+IJmvWj8UzxzolEZOPjf9C gAI9ByH7IOaDuoOicbHlyRlR9LaceEwJYr9Pphg9atn5w== X-Received: by 127.0.0.2 with SMTP id Ufj0YY7687511xWlkLT1J7ym; Mon, 10 Jun 2024 14:11:10 -0700 Subject: Re: [edk2-devel] INF defines section "SPEC" option - Build failure To: ashwin.veeraiah@hp.com, devel@edk2.groups.io From: "ashwin.veeraiah via groups.io" X-Originating-Location: US (136.226.101.4) X-Originating-Platform: Windows Chrome 125 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Mon, 10 Jun 2024 14:11:09 -0700 References: In-Reply-To: Message-ID: <26684.1718053869726215993@groups.io> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ashwin.veeraiah@hp.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: LKnX77dV3Xd8Gatyy3GnHKRmx7686176AA= Content-Type: multipart/alternative; boundary="Vsc9gz0q4CXBmo5WRiTZ" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b="wDzaG/0L"; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --Vsc9gz0q4CXBmo5WRiTZ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I have verified that the EDK2 basetools does not process `SPEC` under the `= DEFINES` section as mentioned in the documentation and it does not work. I went through the commit history of basetools around this, it looks like t= his has not worked pretty much ever, (I went only as far as GitHub would al= low me.) There are multiple points of failures, *Failure 1: Suggested example format* SPEC USB_SPECIFICATION_VERSION =3D 2.0 * * This example is wrong, as this format will cause build failure, as the ba= setools do larger processing based on the `=3D` sign. .OrderedDict({'INF_VERSION': '0x00010005', 'BASE_NAME': 'ExampleCode', 'FIL= E_GUID': '51C7D5B0-4E8F-4F3E-80C9-E6CCEAAE1EC1', 'MODULE_TYPE': 'DXE_SMM_DR= IVER', *'SPEC =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 USB_SPECIFICATION_VERSION ': '2.0'* , 'VERSION_STR= ING': '1.0'}) The surrounding infrastructure cannot process this format. *Failure 2 : GenMake.py* It adds it to the Makefile, which is not necessary. *module_extra_defines" =C2=A0 =C2=A0 =C2=A0: ["%s =3D %s" % (k, v) for k, v= in MyAgo.Module.Defines.items()]* We can skip loading of SPEC here, solves the issue around the `=3D` sign al= so. *Failure 3 :=C2=A0 GenC.py* According to the documentation, it is supposed to add it to the header file= (Autogen.h). There is no code support for it. You can manipulate the *`Info.Module._Defs`* object=C2=A0 and add it to the= generated file. *Failure 4 : Documentation Information* https://github.com/tianocore-docs/edk2-InfSpecification/blob/master/3_edk_i= i_inf_file_format/34_%5Bdefines%5D_section.md Shows this format for SPEC [ < TS > "SPEC" < MTS > < Spec > < EOL > ] * The `*` at the end means you c= an have multiple SPEC declarations, this is not true, the current basetools= code just replaces to use the last one. < Spec > :: =3D < Identifier > < Eq > < DecimalVersion > The `D= ecimalVersion` format is idetified as below, =C2=A0 =C2=A0 ::=3D {"0"} {(0-9) (0-9)*} ["." (0-9)+] The curly braces format suggests that you can have a blank string as input, This should be ::=3D "0" (0-9)* ["." (0-9)+] Will make a bugzilla on this and maybe a PR with my version of the solution= . Ashwin -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119541): https://edk2.groups.io/g/devel/message/119541 Mute This Topic: https://groups.io/mt/105184345/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --Vsc9gz0q4CXBmo5WRiTZ Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable I have verified that the EDK2 basetools does not process `SPEC` under the `= DEFINES` section as mentioned in the documentation and it does not work.&nb= sp;
I went through the commit history of basetools around this, it loo= ks like this has not worked pretty much ever, (I went only as far as GitHub= would allow me.)

There are multiple points of failures, 
Failure 1: Suggested example format
SPEC USB_SPECIFICATION_VERSION =3D 2.0=
This example is wrong, as this format will cause build failu= re, as the basetools do larger processing based on the `=3D` sign. 
.OrderedDict({'INF_VERSION': '0x00010005', 'BASE_NAME': 'ExampleCo= de', 'FILE_GUID': '51C7D5B0-4E8F-4F3E-80C9-E6CCEAAE1EC1', 'MODULE_TYPE': 'D= XE_SMM_DRIVER',
'SPEC           =                 USB_SPECIFICATION_V= ERSION ': '2.0', 'VERSION_STRING': '1.0'})
The surroundi= ng infrastructure cannot process this format. 

Fail= ure 2 : GenMake.py 
It adds it to the Makefile, which is= not necessary.
module_extra_defines"      = : ["%s =3D %s" % (k, v) for k, v in MyAgo.Module.Defines.items()]
We can skip loading of SPEC here, solves the issue around the `= =3D` sign also.  

Failure 3 :  GenC.py&nb= sp;
According to the documentation, it is supposed to add it = to the header file (Autogen.h). There is no code support for it. 
You can manipulate the `Info.Module._Defs` objec= t  and add it to the generated file. 

Failure = 4 : Documentation Information  
https://github.com/tianocore-docs/edk2-InfSp= ecification/blob/master/3_edk_ii_inf_file_format/34_%5Bdefines%5D_section.m= d
Shows this format for SPEC 
[<=
span class=3D"pl-c1" style=3D"box-sizing: border-box; color: var(--color-pr=
ettylights-syntax-constant);"><TS<=
/span>>  <MTS> <Spec> <EOL>]*
The `*` at the end means you can have multiple SPEC declarations, this is n= ot true, the current basetools code just replaces to use the last one. = ;
<Spec> =
            ::=3D <Identifier> <Eq> <DecimalVersion>=
The `DecimalVersion` format is idetified as below, 
<DecimalVersion>     ::= =3D {"0"} {(0-9) (0-9)*} ["." (0-9)+]
The curly braces format s= uggests that you can have a blank string as input, 
This should b= e 
<DecimalVers= ion> ::=3D "0" (0-9)* ["." (0-9)+]

Will make a bugzill= a on this and maybe a PR with my version of the solution. 
Ashwin
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#119541) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--Vsc9gz0q4CXBmo5WRiTZ--