public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] INF defines section "SPEC" option - Build failure
@ 2024-03-27 15:57 ashwin.veeraiah via groups.io
  2024-06-10 21:11 ` ashwin.veeraiah via groups.io
  0 siblings, 1 reply; 2+ messages in thread
From: ashwin.veeraiah via groups.io @ 2024-03-27 15:57 UTC (permalink / raw)
  To: devel

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

Greetings!

The edk2 base tools scripts seems to have some issues translating the "SPEC" option under the "DEFINES" section of the INF file.
Currently if we follow the instruction listed out on the github page build failure occurs.

[Defines]
SPEC       Value = 1.0

Failure :
makefile(50) : fatal error U1036: syntax error : too many names to left of '='

Content in Makefile :
SPEC             Value = 2.5

The error goes away if I use this format in the INF file,

SPEC =    Value = 2.5

However, there is no #define pair created in the Autogen.h file.

Please has anyone used this option and got it working?

Regards,
Ashwin


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117179): https://edk2.groups.io/g/devel/message/117179
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]
-=-=-=-=-=-=-=-=-=-=-=-



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [edk2-devel] INF defines section "SPEC" option - Build failure
  2024-03-27 15:57 [edk2-devel] INF defines section "SPEC" option - Build failure ashwin.veeraiah via groups.io
@ 2024-06-10 21:11 ` ashwin.veeraiah via groups.io
  0 siblings, 0 replies; 2+ messages in thread
From: ashwin.veeraiah via groups.io @ 2024-06-10 21:11 UTC (permalink / raw)
  To: ashwin.veeraiah, devel

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

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 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 = 2.0 *
* This example is wrong, as this format will cause build failure, as the basetools do larger processing based on the `=` sign.

.OrderedDict({'INF_VERSION': '0x00010005', 'BASE_NAME': 'ExampleCode', 'FILE_GUID': '51C7D5B0-4E8F-4F3E-80C9-E6CCEAAE1EC1', 'MODULE_TYPE': 'DXE_SMM_DRIVER',
*'SPEC                           USB_SPECIFICATION_VERSION ': '2.0'* , 'VERSION_STRING': '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"      : ["%s = %s" % (k, v) for k, v in MyAgo.Module.Defines.items()]*
We can skip loading of SPEC here, solves the issue around the `=` sign also.

*Failure 3 :  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  and add it to the generated file.

*Failure 4 : Documentation Information*
https://github.com/tianocore-docs/edk2-InfSpecification/blob/master/3_edk_ii_inf_file_format/34_%5Bdefines%5D_section.md
Shows this format for SPEC
[ < TS > "SPEC" < MTS > < Spec > < EOL > ] * The `*` at the end means you can have multiple SPEC declarations, this is not true, the current basetools code just replaces to use the last one.
< Spec >             :: = < Identifier > < Eq > < DecimalVersion > The `DecimalVersion` format is idetified as below,
<DecimalVersion>     ::= {"0"} {(0-9) (0-9)*} ["." (0-9)+]
The curly braces format suggests that you can have a blank string as input,
This should be
<DecimalVersion> ::= "0" (0-9)* ["." (0-9)+]

Will make a bugzilla on this and maybe a PR with my version of the solution.
Ashwin


-=-=-=-=-=-=-=-=-=-=-=-
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]
-=-=-=-=-=-=-=-=-=-=-=-



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-10 21:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-27 15:57 [edk2-devel] INF defines section "SPEC" option - Build failure ashwin.veeraiah via groups.io
2024-06-10 21:11 ` ashwin.veeraiah via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox