edk2 icon indicating copy to clipboard operation
edk2 copied to clipboard

BaseTools: fix spec keyword parsing

Open Ashwin-Veeraiah opened this issue 1 year ago • 18 comments

Fixes SPEC keyword parsing to match EDK2 specification

Description

When SPEC keyword is used in the INF file, it does not create the equivalent #define in the autogen.h file of the module. Additionally it creates a line in autogenerated makefile. This generated line will cause builds to break of we follow the specification as defined in the example here, [https://github.com/tianocore-docs/edk2-InfSpecification/blob/master/3_edk_ii_inf_file_format/34_%5Bdefines%5D_section.md] Ex : SPEC USB_SPECIFICATION_VERSION = 2.0 The changes fixes the autogen code to function as mentioned by the documentation.

  • [ ] Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • N/A
  • [ ] Impacts security?
    • Security - Does this PR have a direct security impact?
    • N/A
  • [ ] Includes tests?
    • Tests - Does this PR include any explicit test code?
    • N/A

How This Was Tested

Tested locally with builds.

Integration Instructions

N/A

Ashwin-Veeraiah avatar Jul 12 '24 21:07 Ashwin-Veeraiah

@bcran @lgao4 Reaching out through a comment, Not able to add anyone as reviewers.

Ashwin-Veeraiah avatar Jul 13 '24 00:07 Ashwin-Veeraiah

This change looks good, but I'd prefer to have a review from @lgao4 before merging it.

ghost avatar Jul 16 '24 17:07 ghost

SPEC

Can you give one test case?

lgao4 avatar Jul 17 '24 02:07 lgao4

SPEC

Can you give one test case?

Test case in the code like in the comments? Or in an INF file? Is there a dummy file that I can drop it in for you? ie: The current fix is to match what the EDK2 documentations says it should be,

INF files, Defines Section, Add this SPEC USB_SPECIFICATION_VERSION = 2.0 And you should see it in the autogen.h file, #DEFINE USB_SPECIFICATION_VERSION 2.0, where it is a double type.

Ideally, I would like for it to be more modern be free form (instead of double, make it a string value so I can use multi decimal input). That would require me to change edk2 specification document so thought to try to fix it first before I proposed that. ex : SPEC USB_SPECIFICATION_VERSION = 2.1.2 autogen.h will have "#DEFINE USB_SPECIFICATION_VERSION "2.1.2"

Ashwin-Veeraiah avatar Jul 19 '24 18:07 Ashwin-Veeraiah

SPEC

Can you give one test case?

Test case in the code like in the comments? Or in an INF file? Is there a dummy file that I can drop it in for you? ie: The current fix is to match what the EDK2 documentations says it should be,

INF files, Defines Section, Add this SPEC USB_SPECIFICATION_VERSION = 2.0 And you should see it in the autogen.h file, #DEFINE USB_SPECIFICATION_VERSION 2.0, where it is a double type.

Ideally, I would like for it to be more modern be free form (instead of double, make it a string value so I can use multi decimal input). That would require me to change edk2 specification document so thought to try to fix it first before I proposed that. ex : SPEC USB_SPECIFICATION_VERSION = 2.1.2 autogen.h will have "#DEFINE USB_SPECIFICATION_VERSION "2.1.2"

Edk2 doesn't use double type. So, I agree to define them as ascii string. Please submit the spec change first.

lgao4 avatar Jul 25 '24 01:07 lgao4

SPEC

Can you give one test case?

Test case in the code like in the comments? Or in an INF file? Is there a dummy file that I can drop it in for you? ie: The current fix is to match what the EDK2 documentations says it should be, INF files, Defines Section, Add this SPEC USB_SPECIFICATION_VERSION = 2.0 And you should see it in the autogen.h file, #DEFINE USB_SPECIFICATION_VERSION 2.0, where it is a double type. Ideally, I would like for it to be more modern be free form (instead of double, make it a string value so I can use multi decimal input). That would require me to change edk2 specification document so thought to try to fix it first before I proposed that. ex : SPEC USB_SPECIFICATION_VERSION = 2.1.2 autogen.h will have "#DEFINE USB_SPECIFICATION_VERSION "2.1.2"

Edk2 doesn't use double type. So, I agree to define them as ascii string. Please submit the spec change first.

Please advise how/steps to follow to request the change to specification please? Do I make a PR against the document (*.MD) files? Do I raise it in the CI/Basetools meetings as a topic?

Ashwin-Veeraiah avatar Jul 26 '24 18:07 Ashwin-Veeraiah

SPEC

Can you give one test case?

Test case in the code like in the comments? Or in an INF file? Is there a dummy file that I can drop it in for you? ie: The current fix is to match what the EDK2 documentations says it should be, INF files, Defines Section, Add this SPEC USB_SPECIFICATION_VERSION = 2.0 And you should see it in the autogen.h file, #DEFINE USB_SPECIFICATION_VERSION 2.0, where it is a double type. Ideally, I would like for it to be more modern be free form (instead of double, make it a string value so I can use multi decimal input). That would require me to change edk2 specification document so thought to try to fix it first before I proposed that. ex : SPEC USB_SPECIFICATION_VERSION = 2.1.2 autogen.h will have "#DEFINE USB_SPECIFICATION_VERSION "2.1.2"

Edk2 doesn't use double type. So, I agree to define them as ascii string. Please submit the spec change first.

Please advise how/steps to follow to request the change to specification please? Do I make a PR against the document (*.MD) files? Do I raise it in the CI/Basetools meetings as a topic?

For the change in spec, please send the patch to edk2 mail list [email protected]. I will review and merge it.

lgao4 avatar Aug 13 '24 05:08 lgao4

This PR has been automatically marked as stale because it has not had activity in 60 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] avatar Oct 12 '24 23:10 github-actions[bot]

Commenting here to keep this PR active. @Ashwin-Veeraiah Are you still working on this?

bexcran avatar Oct 18 '24 03:10 bexcran

Commenting here to keep this PR active. @Ashwin-Veeraiah Are you still working on this?

@bexcran Yes. Other priorities in the way. Expect to work in during Thanksgiving. Thank you.

Ashwin-Veeraiah avatar Oct 29 '24 00:10 Ashwin-Veeraiah

This PR has been automatically marked as stale because it has not had activity in 60 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] avatar Dec 28 '24 23:12 github-actions[bot]

Commenting on this PR to keep it open.

bexcran avatar Dec 29 '24 01:12 bexcran

This PR has been automatically marked as stale because it has not had activity in 60 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] avatar Feb 28 '25 23:02 github-actions[bot]

Comment to keep it live

Ashwin-Veeraiah avatar Mar 03 '25 14:03 Ashwin-Veeraiah

Bump to keep it live

Ashwin-Veeraiah avatar Mar 25 '25 21:03 Ashwin-Veeraiah

This PR has been automatically marked as stale because it has not had activity in 60 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] avatar May 24 '25 23:05 github-actions[bot]

This pull request has been automatically been closed because it did not have any activity in 60 days and no follow up within 7 days after being marked stale. Thank you for your contributions.

github-actions[bot] avatar Jun 01 '25 23:06 github-actions[bot]

Keep alive

mdkinney avatar Jun 10 '25 21:06 mdkinney

This PR has been automatically marked as stale because it has not had activity in 60 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] avatar Aug 09 '25 23:08 github-actions[bot]

This pull request has been automatically been closed because it did not have any activity in 60 days and no follow up within 7 days after being marked stale. Thank you for your contributions.

github-actions[bot] avatar Aug 17 '25 23:08 github-actions[bot]