public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* EDK2 CI build error "Uncrustify Coding Standard"
@ 2021-12-07 19:52 Brijesh Singh
  2021-12-07 20:49 ` [edk2-devel] " Michael Kubacki
  0 siblings, 1 reply; 12+ messages in thread
From: Brijesh Singh @ 2021-12-07 19:52 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: brijesh.singh

Hi All,

I am rebasing the SNP series and encountering the error like below from 
the CI. I am not sure what I am missing. For testing purpose, I just 
tried one commit and CI Windows build complains about this. This is the 
same patch which passed all the CI. Any idea what I maybe missing ?


WARNING - A file header template is not specified in the config file.
WARNING - A function header template is not specified in the config file.
ERROR - /home/vsts/work/1/s/OvmfPkg/Sec/AmdSev.c
ERROR - /home/vsts/work/1/s/OvmfPkg/Sec/AmdSev.h
ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET 
returned 2


My patch does add the two files and they are listed in .inf.

-Brijesh

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

* Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
  2021-12-07 19:52 EDK2 CI build error "Uncrustify Coding Standard" Brijesh Singh
@ 2021-12-07 20:49 ` Michael Kubacki
  2021-12-07 21:02   ` Michael D Kinney
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Kubacki @ 2021-12-07 20:49 UTC (permalink / raw)
  To: devel, brijesh.singh

Hi Brijesh,

A Tianocore wiki article is being prepared but the background and 
instructions for what to do were sent in this mail regarding the hard 
freeze being lifted - https://edk2.groups.io/g/devel/message/84458.

Do you have questions after reading through that?

Thanks,
Michael

On 12/7/2021 2:52 PM, Brijesh Singh via groups.io wrote:
> Hi All,
> 
> I am rebasing the SNP series and encountering the error like below from 
> the CI. I am not sure what I am missing. For testing purpose, I just 
> tried one commit and CI Windows build complains about this. This is the 
> same patch which passed all the CI. Any idea what I maybe missing ?
> 
> 
> WARNING - A file header template is not specified in the config file.
> WARNING - A function header template is not specified in the config file.
> ERROR - /home/vsts/work/1/s/OvmfPkg/Sec/AmdSev.c
> ERROR - /home/vsts/work/1/s/OvmfPkg/Sec/AmdSev.h
> ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET 
> returned 2
> 
> 
> My patch does add the two files and they are listed in .inf.
> 
> -Brijesh
> 
> 
> 
> 

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

* Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
  2021-12-07 20:49 ` [edk2-devel] " Michael Kubacki
@ 2021-12-07 21:02   ` Michael D Kinney
  2021-12-08 14:39     ` Brijesh Singh
  0 siblings, 1 reply; 12+ messages in thread
From: Michael D Kinney @ 2021-12-07 21:02 UTC (permalink / raw)
  To: devel@edk2.groups.io, mikuback@linux.microsoft.com,
	brijesh.singh@amd.com, Kinney, Michael D

Hi Brijesh,

Yes.  Your branch can be rebased on top of edk2/master after uncrustify changes.

You have added new c/h files, so those files need to be run through uncrustify locally and 
your patch updated with those formatting changes.

The following command updates every c/h file except BaseTools locally.

    git ls-files *.c *.h :!BaseTools/* | .pytool\Plugin\UncrustifyCheck\mu-uncrustify-release_extdep\Windows-x86\uncrustify.exe -c .pytool\Plugin\UncrustifyCheck\uncrustify.cfg -F - --replace --no-backup --if-changed

If you know the package you are working on, the following one will work faster.

    git ls-files <PackageName>*.c <PackageName>*.h :!BaseTools/* | .pytool\Plugin\UncrustifyCheck\mu-uncrustify-release_extdep\Windows-x86\uncrustify.exe -c .pytool\Plugin\UncrustifyCheck\uncrustify.cfg -F - --replace --no-backup --if-changed

OvmfPkg Example:

    git ls-files OvmfPkg/*.c OvmfPkg/*.h :!BaseTools/* | .pytool\Plugin\UncrustifyCheck\mu-uncrustify-release_extdep\Windows-x86\uncrustify.exe -c .pytool\Plugin\UncrustifyCheck\uncrustify.cfg -F - --replace --no-backup --if-changed


You do have to use the .pytool stuart commands to setup your environment so uncrustify tool is installed automatically.
This also allows you to run all the EDK II CI tests locally if you want to check and fix issues before
submitting a PR.

    https://github.com/tianocore/edk2/blob/master/.pytool/Readme.md#running-ci-locally

You can also use git filter-branch to uncrustify a more complex patch series.  That is in the email thread
and will be included in the Wiki.

Best regards,

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael Kubacki
> Sent: Tuesday, December 7, 2021 12:50 PM
> To: devel@edk2.groups.io; brijesh.singh@amd.com
> Subject: Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
> 
> Hi Brijesh,
> 
> A Tianocore wiki article is being prepared but the background and
> instructions for what to do were sent in this mail regarding the hard
> freeze being lifted - https://edk2.groups.io/g/devel/message/84458.
> 
> Do you have questions after reading through that?
> 
> Thanks,
> Michael
> 
> On 12/7/2021 2:52 PM, Brijesh Singh via groups.io wrote:
> > Hi All,
> >
> > I am rebasing the SNP series and encountering the error like below from
> > the CI. I am not sure what I am missing. For testing purpose, I just
> > tried one commit and CI Windows build complains about this. This is the
> > same patch which passed all the CI. Any idea what I maybe missing ?
> >
> >
> > WARNING - A file header template is not specified in the config file.
> > WARNING - A function header template is not specified in the config file.
> > ERROR - /home/vsts/work/1/s/OvmfPkg/Sec/AmdSev.c
> > ERROR - /home/vsts/work/1/s/OvmfPkg/Sec/AmdSev.h
> > ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET
> > returned 2
> >
> >
> > My patch does add the two files and they are listed in .inf.
> >
> > -Brijesh
> >
> >
> >
> >
> 
> 
> 
> 


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

* Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
  2021-12-07 21:02   ` Michael D Kinney
@ 2021-12-08 14:39     ` Brijesh Singh
  2021-12-08 16:10       ` Brijesh Singh
  0 siblings, 1 reply; 12+ messages in thread
From: Brijesh Singh @ 2021-12-08 14:39 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io,
	mikuback@linux.microsoft.com
  Cc: brijesh.singh

Hi Mike,

On 12/7/21 3:02 PM, Kinney, Michael D wrote:
> Hi Brijesh,
> 
> Yes.  Your branch can be rebased on top of edk2/master after uncrustify changes.
> 
> You have added new c/h files, so those files need to be run through uncrustify locally and
> your patch updated with those formatting changes.
> 
> The following command updates every c/h file except BaseTools locally.
> 
>      git ls-files *.c *.h :!BaseTools/* | .pytool\Plugin\UncrustifyCheck\mu-uncrustify-release_extdep\Windows-x86\uncrustify.exe -c .pytool\Plugin\UncrustifyCheck\uncrustify.cfg -F - --replace --no-backup --if-changed
> 
> If you know the package you are working on, the following one will work faster.
> 
>      git ls-files <PackageName>*.c <PackageName>*.h :!BaseTools/* | .pytool\Plugin\UncrustifyCheck\mu-uncrustify-release_extdep\Windows-x86\uncrustify.exe -c .pytool\Plugin\UncrustifyCheck\uncrustify.cfg -F - --replace --no-backup --if-changed
> 
> OvmfPkg Example:
> 
>      git ls-files OvmfPkg/*.c OvmfPkg/*.h :!BaseTools/* | .pytool\Plugin\UncrustifyCheck\mu-uncrustify-release_extdep\Windows-x86\uncrustify.exe -c .pytool\Plugin\UncrustifyCheck\uncrustify.cfg -F - --replace --no-backup --if-changed
> 
> 

Thanks for the detail, I just did a pull and now I see the uncrustify 
cfg files. I followed your above command on my Ubuntu desktop and 
getting the below unknown symbol, is this a known issue ?


brijesh@sbrijesh-desktop:~/workdir/snp-edk2$ git ls-files 
OvmfPkg/Sec/AmdSev.c | uncrustify -c 
.pytool/Plugin/UncrustifyCheck/uncrustify.cfg -F - --replace --no-backup 
--if-changed
.pytool/Plugin/UncrustifyCheck/uncrustify.cfg:73: unknown symbol 
'nl_func_call_args_multi_line_ignore_closures'
.pytool/Plugin/UncrustifyCheck/uncrustify.cfg:79: unknown symbol 
'indent_func_call_edk2_style'
.pytool/Plugin/UncrustifyCheck/uncrustify.cfg:120: unknown symbol 
'sp_do_brace_open'
.pytool/Plugin/UncrustifyCheck/uncrustify.cfg:134: unknown symbol 
'sp_before_vardef_square'
.pytool/Plugin/UncrustifyCheck/uncrustify.cfg:178: unknown symbol 
'sp_brace_close_while'
.pytool/Plugin/UncrustifyCheck/uncrustify.cfg:184: unknown symbol 
'sp_before_square_asm_block'
.pytool/Plugin/UncrustifyCheck/uncrustify.cfg:205: unknown symbol 
'sp_while_paren_open'
.pytool/Plugin/UncrustifyCheck/uncrustify.cfg:229: unknown symbol 
'indent_func_def_param_paren_pos_threshold'
.pytool/Plugin/UncrustifyCheck/uncrustify.cfg:270: unknown symbol 
'align_edk2_style'
.pytool/Plugin/UncrustifyCheck/uncrustify.cfg:323: unknown symbol 
'cmt_align_doxygen_javadoc_tags'
.pytool/Plugin/UncrustifyCheck/uncrustify.cfg:406: unknown symbol 
'nl_before_whole_file_ifdef'
Parsing: OvmfPkg/Sec/AmdSev.c as language C
brijesh@sbrijesh-desktop:~/workdir/snp-edk2$
brijesh@sbrijesh-desktop:~/workdir/snp-edk2$ uncrustify --version
Uncrustify-0.69.0_f

I did submitted PR after above uncurstify run but the CI still didn't 
like it. Do we need to have specific version of uncrustify ?

-Brijesh

> You do have to use the .pytool stuart commands to setup your environment so uncrustify tool is installed automatically.
> This also allows you to run all the EDK II CI tests locally if you want to check and fix issues before
> submitting a PR.
> 
>      https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2F.pytool%2FReadme.md%23running-ci-locally&amp;data=04%7C01%7Cbrijesh.singh%40amd.com%7Cb303a189de3446c5c52108d9b9c4e760%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637745077634999978%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=OnGmCqMIEwmrZmn48M6MwErLyB60ORfN7CUceS%2BhPmI%3D&amp;reserved=0
> 
> You can also use git filter-branch to uncrustify a more complex patch series.  That is in the email thread
> and will be included in the Wiki.
> 
> Best regards,
> 
> Mike
> 
>> -----Original Message-----
>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael Kubacki
>> Sent: Tuesday, December 7, 2021 12:50 PM
>> To: devel@edk2.groups.io; brijesh.singh@amd.com
>> Subject: Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
>>
>> Hi Brijesh,
>>
>> A Tianocore wiki article is being prepared but the background and
>> instructions for what to do were sent in this mail regarding the hard
>> freeze being lifted - https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F84458&amp;data=04%7C01%7Cbrijesh.singh%40amd.com%7Cb303a189de3446c5c52108d9b9c4e760%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637745077635009974%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=LRtAPIFef6zlz6x0YNqpM9Hn5WIjFP1C0moMZFO9TWA%3D&amp;reserved=0.
>>
>> Do you have questions after reading through that?
>>
>> Thanks,
>> Michael
>>
>> On 12/7/2021 2:52 PM, Brijesh Singh via groups.io wrote:
>>> Hi All,
>>>
>>> I am rebasing the SNP series and encountering the error like below from
>>> the CI. I am not sure what I am missing. For testing purpose, I just
>>> tried one commit and CI Windows build complains about this. This is the
>>> same patch which passed all the CI. Any idea what I maybe missing ?
>>>
>>>
>>> WARNING - A file header template is not specified in the config file.
>>> WARNING - A function header template is not specified in the config file.
>>> ERROR - /home/vsts/work/1/s/OvmfPkg/Sec/AmdSev.c
>>> ERROR - /home/vsts/work/1/s/OvmfPkg/Sec/AmdSev.h
>>> ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET
>>> returned 2
>>>
>>>
>>> My patch does add the two files and they are listed in .inf.
>>>
>>> -Brijesh
>>>
>>>
>>>
>>>
>>
>>
>> 
>>
> 

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

* Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
  2021-12-08 14:39     ` Brijesh Singh
@ 2021-12-08 16:10       ` Brijesh Singh
  2021-12-08 16:15         ` Michael Kubacki
  0 siblings, 1 reply; 12+ messages in thread
From: Brijesh Singh @ 2021-12-08 16:10 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io,
	mikuback@linux.microsoft.com
  Cc: brijesh.singh



On 12/8/21 8:39 AM, Brijesh Singh wrote:
...

>> OvmfPkg Example:
>>
>>      git ls-files OvmfPkg/*.c OvmfPkg/*.h :!BaseTools/* | 
>> .pytool\Plugin\UncrustifyCheck\mu-uncrustify-release_extdep\Windows-x86\uncrustify.exe 
>> -c .pytool\Plugin\UncrustifyCheck\uncrustify.cfg -F - --replace 
>> --no-backup --if-changed
>>
>>
> 
> Thanks for the detail, I just did a pull and now I see the uncrustify 
> cfg files. I followed your above command on my Ubuntu desktop and 
> getting the below unknown symbol, is this a known issue ?
> 
> 
> brijesh@sbrijesh-desktop:~/workdir/snp-edk2$ git ls-files 
> OvmfPkg/Sec/AmdSev.c | uncrustify -c 
> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg -F - --replace --no-backup 
> --if-changed
> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:73: unknown symbol 
> 'nl_func_call_args_multi_line_ignore_closures'
> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:79: unknown symbol 
> 'indent_func_call_edk2_style'
> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:120: unknown symbol 
> 'sp_do_brace_open'
> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:134: unknown symbol 
> 'sp_before_vardef_square'
> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:178: unknown symbol 
> 'sp_brace_close_while'
> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:184: unknown symbol 
> 'sp_before_square_asm_block'
> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:205: unknown symbol 
> 'sp_while_paren_open'
> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:229: unknown symbol 
> 'indent_func_def_param_paren_pos_threshold'
> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:270: unknown symbol 
> 'align_edk2_style'
> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:323: unknown symbol 
> 'cmt_align_doxygen_javadoc_tags'
> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:406: unknown symbol 
> 'nl_before_whole_file_ifdef'
> Parsing: OvmfPkg/Sec/AmdSev.c as language C
> brijesh@sbrijesh-desktop:~/workdir/snp-edk2$
> brijesh@sbrijesh-desktop:~/workdir/snp-edk2$ uncrustify --version
> Uncrustify-0.69.0_f
> 
> I did submitted PR after above uncurstify run but the CI still didn't 
> like it. Do we need to have specific version of uncrustify ?
> 

Reading through the "Add Uncrustify formatting overview" email it seems 
we need to use a edk2 forked  version of uncrustify [1]. With this now I 
dont get any error.

[1] 
https://dev.azure.com/projectmu/Uncrustify/_packaging?_a=package&feed=mu_uncrustify&package=mu-uncrustify-release&version=73.0.3&protocolType=NuGet



thanks

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

* Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
  2021-12-08 16:10       ` Brijesh Singh
@ 2021-12-08 16:15         ` Michael Kubacki
  2022-04-05  5:57           ` Ashish Kalra
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Kubacki @ 2021-12-08 16:15 UTC (permalink / raw)
  To: Brijesh Singh, Kinney, Michael D, devel@edk2.groups.io

That's correct. I recommend using the "stuart_update -c 
.pytool/CISettings.py" command so the proper version will automatically 
get brought down into your local workspace.

Thanks,
Michael

On 12/8/2021 11:10 AM, Brijesh Singh wrote:
> 
> 
> On 12/8/21 8:39 AM, Brijesh Singh wrote:
> ...
> 
>>> OvmfPkg Example:
>>>
>>>      git ls-files OvmfPkg/*.c OvmfPkg/*.h :!BaseTools/* | 
>>> .pytool\Plugin\UncrustifyCheck\mu-uncrustify-release_extdep\Windows-x86\uncrustify.exe 
>>> -c .pytool\Plugin\UncrustifyCheck\uncrustify.cfg -F - --replace 
>>> --no-backup --if-changed
>>>
>>>
>>
>> Thanks for the detail, I just did a pull and now I see the uncrustify 
>> cfg files. I followed your above command on my Ubuntu desktop and 
>> getting the below unknown symbol, is this a known issue ?
>>
>>
>> brijesh@sbrijesh-desktop:~/workdir/snp-edk2$ git ls-files 
>> OvmfPkg/Sec/AmdSev.c | uncrustify -c 
>> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg -F - --replace 
>> --no-backup --if-changed
>> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:73: unknown symbol 
>> 'nl_func_call_args_multi_line_ignore_closures'
>> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:79: unknown symbol 
>> 'indent_func_call_edk2_style'
>> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:120: unknown symbol 
>> 'sp_do_brace_open'
>> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:134: unknown symbol 
>> 'sp_before_vardef_square'
>> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:178: unknown symbol 
>> 'sp_brace_close_while'
>> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:184: unknown symbol 
>> 'sp_before_square_asm_block'
>> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:205: unknown symbol 
>> 'sp_while_paren_open'
>> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:229: unknown symbol 
>> 'indent_func_def_param_paren_pos_threshold'
>> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:270: unknown symbol 
>> 'align_edk2_style'
>> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:323: unknown symbol 
>> 'cmt_align_doxygen_javadoc_tags'
>> .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:406: unknown symbol 
>> 'nl_before_whole_file_ifdef'
>> Parsing: OvmfPkg/Sec/AmdSev.c as language C
>> brijesh@sbrijesh-desktop:~/workdir/snp-edk2$
>> brijesh@sbrijesh-desktop:~/workdir/snp-edk2$ uncrustify --version
>> Uncrustify-0.69.0_f
>>
>> I did submitted PR after above uncurstify run but the CI still didn't 
>> like it. Do we need to have specific version of uncrustify ?
>>
> 
> Reading through the "Add Uncrustify formatting overview" email it seems 
> we need to use a edk2 forked  version of uncrustify [1]. With this now I 
> dont get any error.
> 
> [1] 
> https://dev.azure.com/projectmu/Uncrustify/_packaging?_a=package&feed=mu_uncrustify&package=mu-uncrustify-release&version=73.0.3&protocolType=NuGet 
> 
> 
> 
> 
> thanks

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

* Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
  2021-12-08 16:15         ` Michael Kubacki
@ 2022-04-05  5:57           ` Ashish Kalra
  2022-04-05  6:09             ` Ashish Kalra
  0 siblings, 1 reply; 12+ messages in thread
From: Ashish Kalra @ 2022-04-05  5:57 UTC (permalink / raw)
  To: Michael Kubacki, devel

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

Hi Mike,

I am following up on Brijesh's email thread
amd@ashkalraubuntuserver:~/edk2-upstream$ ../.local/bin/stuart_ci_build -c .pytool/CISettings.py TOOL_CHAIN_TAG=GCC5 -p OvmfPkg
SECTION - Init SDE              
WARNING - Using Pip Tools based BaseTools
SECTION - Loading Plugins
SECTION - Start Invocable Tool
SECTION - Getting Environment               
SECTION - Loading plugins
SECTION - Building OvmfPkg Package
PROGRESS - --Running OvmfPkg: Uncrustify Coding Standard Test NO-TARGET --
WARNING - A file header template is not specified in the config file.
WARNING - A function header template is not specified in the config file.
ERROR - /home/amd/edk2-upstream/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c
ERROR - /home/amd/edk2-upstream/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET returned 2
PROGRESS - --Running OvmfPkg: Guid Check Test NO-TARGET --
PROGRESS - --->Test Success: Guid Check Test NO-TARGET
PROGRESS - --Running OvmfPkg: Char Encoding Check Test NO-TARGET --
PROGRESS - --->Test Success: Char Encoding Check Test NO-TARGET
PROGRESS - --Running OvmfPkg: Spell Check Test NO-TARGET --
WARNING - NodeJs not installed. Test can't run
WARNING - --->Test Skipped: in plugin! Spell Check Test NO-TARGET
PROGRESS - --Running OvmfPkg: Dsc Complete Check Test NO-TARGET --
PROGRESS - --->Test Success: Dsc Complete Check Test NO-TARGET
PROGRESS - --Running OvmfPkg: Host Unit Test Dsc Complete Check Test NO-TARGET --
PROGRESS - --->Test Success: Host Unit Test Dsc Complete Check Test NO-TARGET
PROGRESS - --Running OvmfPkg: Host Unit Test Compiler Plugin NOOPT --
WARNING - --->Test Skipped: in plugin! Host Unit Test Compiler Plugin NOOPT
PROGRESS - --Running OvmfPkg: Library Class Check Test NO-TARGET --
PROGRESS - --->Test Success: Library Class Check Test NO-TARGET
PROGRESS - --Running OvmfPkg: EccCheck Test NO-TARGET --
PROGRESS - --->Test Skipped by package! EccCheck Test
PROGRESS - --Running OvmfPkg: Compiler Plugin DEBUG --
WARNING - --->Test Skipped: in plugin! Compiler Plugin DEBUG
PROGRESS - --Running OvmfPkg: Compiler Plugin RELEASE --
WARNING - --->Test Skipped: in plugin! Compiler Plugin RELEASE
PROGRESS - --Running OvmfPkg: Dependency Check Test NO-TARGET --
PROGRESS - --->Test Success: Dependency Check Test NO-TARGET
PROGRESS - --Running OvmfPkg: License Check Test NO-TARGET --
PROGRESS - --->Test Success: License Check Test NO-TARGET
ERROR - Overall Build Status: Error
PROGRESS - There were 1 failures out of 13 attempts
SECTION - Summary
ERROR - Error

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

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

* Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
  2022-04-05  5:57           ` Ashish Kalra
@ 2022-04-05  6:09             ` Ashish Kalra
  2022-04-05 14:40               ` Michael Kubacki
  2022-04-05 15:00               ` Rebecca Cran
  0 siblings, 2 replies; 12+ messages in thread
From: Ashish Kalra @ 2022-04-05  6:09 UTC (permalink / raw)
  To: Ashish Kalra, devel

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

Hi Mike,

I am following up on Brijesh's email, i am running the CI tests related to my SEV live migration patches,
which i am in process of posting.

I am running the CI tests locally and getting errors while building OvmfPkg, my patches include two new
header files, error log is copied below.

Do you have updated instructions on how to r un through uncrustify locally and
get my patch updated with those formatting changes, especially for Linux ?
(your above instructions seem specific to Windows).

Thanks,
Ashish

Error log:

../.local/bin/stuart_ci_build -c .pytool/CISettings.py TOOL_CHAIN_TAG=GCC5 -p OvmfPkg SECTION - Init SDE WARNING - Using Pip Tools based BaseTools SECTION - Loading Plugins SECTION - Start Invocable Tool SECTION - Getting Environment SECTION - Loading plugins SECTION - Building OvmfPkg Package PROGRESS - --Running OvmfPkg: Uncrustify Coding Standard Test NO-TARGET -- WARNING - A file header template is not specified in the config file. WARNING - A function header template is not specified in the config file. ERROR - /home/amd/edk2-upstream/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c ERROR - /home/amd/edk2-upstream/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET returned 2 PROGRESS - --Running OvmfPkg: Guid Check Test NO-TARGET -- PROGRESS - --->Test Success: Guid Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Char Encoding Check Test NO-TARGET -- PROGRESS - --->Test Success: Char Encoding Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Spell Check Test NO-TARGET -- WARNING - NodeJs not installed. Test can't run WARNING - --->Test Skipped: in plugin! Spell Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Dsc Complete Check Test NO-TARGET -- PROGRESS - --->Test Success: Dsc Complete Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Host Unit Test Dsc Complete Check Test NO-TARGET -- PROGRESS - --->Test Success: Host Unit Test Dsc Complete Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Host Unit Test Compiler Plugin NOOPT -- WARNING - --->Test Skipped: in plugin! Host Unit Test Compiler Plugin NOOPT PROGRESS - --Running OvmfPkg: Library Class Check Test NO-TARGET -- PROGRESS - --->Test Success: Library Class Check Test NO-TARGET PROGRESS - --Running OvmfPkg: EccCheck Test NO-TARGET -- PROGRESS - --->Test Skipped by package! EccCheck Test PROGRESS - --Running OvmfPkg: Compiler Plugin DEBUG -- WARNING - --->Test Skipped: in plugin! Compiler Plugin DEBUG PROGRESS - --Running OvmfPkg: Compiler Plugin RELEASE -- WARNING - --->Test Skipped: in plugin! Compiler Plugin RELEASE PROGRESS - --Running OvmfPkg: Dependency Check Test NO-TARGET -- PROGRESS - --->Test Success: Dependency Check Test NO-TARGET PROGRESS - --Running OvmfPkg: License Check Test NO-TARGET -- PROGRESS - --->Test Success: License Check Test NO-TARGET ERROR - Overall Build Status: Error PROGRESS - There were 1 failures out of 13 attempts SECTION - Summary ERROR - Error

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

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

* Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
  2022-04-05  6:09             ` Ashish Kalra
@ 2022-04-05 14:40               ` Michael Kubacki
  2022-04-05 14:42                 ` Michael Kubacki
  2022-04-05 15:00               ` Rebecca Cran
  1 sibling, 1 reply; 12+ messages in thread
From: Michael Kubacki @ 2022-04-05 14:40 UTC (permalink / raw)
  To: devel, ashish.kalra

Before discussing how to see the issues locally, here's how to see them 
in the pipelines. I will send a separate reply with local details.

1. Go to the build that is failing Uncrustify.

I am using this PR for your case:
https://github.com/tianocore/edk2/pull/2742

2. Click "Details"

I am using "Ubuntu GCC5 PR" for your case

At this point the issue is described:

"Check file coding standard compliance in Edk2CiBuild.Edk2.OvmfPkg
UncrustifyCheck failed due to 3 incorrectly formatted files."

3. Click "View more details on Azure Pipelines"

https://github.com/tianocore/edk2/pull/2742/checks?check_run_id=5826935687

4. Find the failing job and click it.

In your case it is "Build_GCC5_TARGET_PLATFORMS".

https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=47536&view=results

5. It will now have a link showing "XX%" tests passed (65% in this 
instance).

Click that link to see the tests that failed.

https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=47536&view=logs&j=ec42d809-3c3b-54a9-276c-e54a8b9aaee9

6. Now, in the tests summary it will show the same message you saw in 
step (2):

"Check file coding standard compliance in Edk2CiBuild.Edk2.OvmfPkg
UncrustifyCheck failed due to 3 incorrectly formatted files."

https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=47536&view=ms.vss-test-web.build-test-results-tab

Click that text to open more details.

https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=47536&view=ms.vss-test-web.build-test-results-tab&runId=345782&resultId=100009&paneView=debug

7. Now, you will see the following error message in the "Debug" tab by 
default:

"UncrustifyCheck failed due to 3 incorrectly formatted files."

Click the "Attachments" tab to get more details.

https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=47536&view=ms.vss-test-web.build-test-results-tab&runId=345782&resultId=100009&paneView=attachments

8. Now, you will see details about the Uncrustify run in the 
"Standard_Console_Output.log" attachment:

"""
Uncrustify version: Uncrustify-c82ee034
  Found Uncrustify at 
/home/vsts/work/1/s/.pytool/Plugin/UncrustifyCheck/mu-uncrustify-release_extdep/Linux-x86/uncrustify
  Uncrustify version: Uncrustify-c82ee034

  Uncrustify executed against 513 files in OvmfPkg in 2.31 seconds.
"""

Click on the "Standard_Error_Output.log" attachment to get more details 
about the error.

Those details for your job are as follows. This is a diff of the changes 
needed.

"""
Files with formatting errors:
  Formatting errors in 
Library/BaseMemEncryptSevLib/PeiDxeMemEncryptSevLibInternal.c
  --- 
/home/vsts/work/1/s/OvmfPkg/Library/BaseMemEncryptSevLib/PeiDxeMemEncryptSevLibInternal.c
  +++ 
/home/vsts/work/1/s/OvmfPkg/Library/BaseMemEncryptSevLib/PeiDxeMemEncryptSevLibInternal.c.uncrustify_plugin
  @@ -36,8 +36,8 @@
  RETURN_STATUS
  EFIAPI
  MemEncryptSevLocateInitialSmramSaveStateMapPages (
  -  OUT UINTN *BaseAddress,
  -  OUT UINTN *NumberOfPages
  +  OUT UINTN  *BaseAddress,
  +  OUT UINTN  *NumberOfPages
  )
  {
  UINTN  MapStart;
  @@ -50,8 +50,8 @@
  return RETURN_UNSUPPORTED;
  }

  -  MapStart = SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET;
  -  MapEnd   = MapStart + sizeof (QEMU_SMRAM_SAVE_STATE_MAP);
  +  MapStart      = SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET;
  +  MapEnd        = MapStart + sizeof (QEMU_SMRAM_SAVE_STATE_MAP);
  MapPagesStart = MapStart & ~(UINTN)EFI_PAGE_MASK;
  MapPagesEnd   = ALIGN_VALUE (MapEnd, EFI_PAGE_SIZE);
  MapPagesSize  = MapPagesEnd - MapPagesStart;
  @@ -87,34 +87,34 @@
  Signature[12] = '\0';
  for (mKvmLeaf = 0x40000000; mKvmLeaf < 0x40010000; mKvmLeaf += 0x100) {
  AsmCpuid (
  -              mKvmLeaf,
  -              NULL,
  -              (UINT32 *)&Signature[0],
  -              (UINT32 *)&Signature[4],
  -              (UINT32 *)&Signature[8]
  -              );
  +      mKvmLeaf,
  +      NULL,
  +      (UINT32 *)&Signature[0],
  +      (UINT32 *)&Signature[4],
  +      (UINT32 *)&Signature[8]
  +      );

  if (AsciiStrCmp (Signature, "KVMKVMKVM") == 0) {
  DEBUG (
  -             (
  -              DEBUG_INFO,
  -              "%a: KVM Detected, signature = %a\n",
  -              __FUNCTION__,
  -              Signature
  -             )
  -             );
  +        (
  +         DEBUG_INFO,
  +         "%a: KVM Detected, signature = %a\n",
  +         __FUNCTION__,
  +         Signature
  +        )
  +        );

  RegEax = mKvmLeaf + 1;
  RegEcx = 0;
  AsmCpuid (mKvmLeaf + 1, &RegEax, &RegEbx, &RegEcx, &RegEdx);
  if ((RegEax & KVM_FEATURE_MIGRATION_CONTROL) != 0) {
  DEBUG (
  -               (
  -                DEBUG_INFO,
  -                "%a: SEV Live Migration feature supported\n",
  -                __FUNCTION__
  -               )
  -               );
  +          (
  +           DEBUG_INFO,
  +           "%a: SEV Live Migration feature supported\n",
  +           __FUNCTION__
  +          )
  +          );

  return TRUE;
  }

  Formatting errors in 
Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
  --- 
/home/vsts/work/1/s/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
  +++ 
/home/vsts/work/1/s/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c.uncrustify_plugin
  @@ -20,11 +20,11 @@

  #include "PeiDxeMemEncryptSevLibInternal.h"

  -STATIC UINT64   mCurrentAttr            = 0;
  -STATIC BOOLEAN  mCurrentAttrRead        = FALSE;
  -STATIC UINT64   mSevEncryptionMask      = 0;
  -STATIC BOOLEAN  mSevEncryptionMaskSaved = FALSE;
  -STATIC BOOLEAN  mSevLiveMigrationStatus = FALSE;
  +STATIC UINT64   mCurrentAttr                   = 0;
  +STATIC BOOLEAN  mCurrentAttrRead               = FALSE;
  +STATIC UINT64   mSevEncryptionMask             = 0;
  +STATIC BOOLEAN  mSevEncryptionMaskSaved        = FALSE;
  +STATIC BOOLEAN  mSevLiveMigrationStatus        = FALSE;
  STATIC BOOLEAN  mSevLiveMigrationStatusChecked = FALSE;

  /**
  @@ -127,7 +127,7 @@
  )
  {
  if (KvmDetectSevLiveMigrationFeature ()) {
  -        mSevLiveMigrationStatus = TRUE;
  +    mSevLiveMigrationStatus = TRUE;
  }

  mSevLiveMigrationStatusChecked = TRUE;

  Formatting errors in 
Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c
  --- 
/home/vsts/work/1/s/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c
  +++ 
/home/vsts/work/1/s/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c.uncrustify_plugin
  @@ -19,8 +19,8 @@

  #include "PeiDxeMemEncryptSevLibInternal.h"

  -STATIC BOOLEAN mSevLiveMigrationStatus = FALSE;
  -STATIC BOOLEAN mSevLiveMigrationStatusChecked = FALSE;
  +STATIC BOOLEAN  mSevLiveMigrationStatus        = FALSE;
  +STATIC BOOLEAN  mSevLiveMigrationStatusChecked = FALSE;

  /**
  Read the workarea to determine whether SEV is enabled. If enabled,
"""

Thanks,
Michael

On 4/5/2022 2:09 AM, Ashish Kalra via groups.io wrote:
> Hi Mike,
> 
> I am following up on Brijesh's email, i am running the CI tests related 
> to my SEV live migration patches,
> which i am in process of posting.
> 
> I am running the CI tests locally and getting errors while building 
> OvmfPkg, my patches include two new
> header files, error log is copied below.
> 
> Do you have updated instructions on how to run through uncrustify 
> locally and
> get my patch updated with those formatting changes, especially for Linux ?
> (your above instructions seem specific to Windows).
> 
> Thanks,
> Ashish
> 
> Error log:
> 
> ../.local/bin/stuart_ci_build -c .pytool/CISettings.py 
> TOOL_CHAIN_TAG=GCC5 -p OvmfPkg SECTION - Init SDE WARNING - Using Pip 
> Tools based BaseTools SECTION - Loading Plugins SECTION - Start 
> Invocable Tool SECTION - Getting Environment SECTION - Loading plugins 
> SECTION - Building OvmfPkg Package PROGRESS - --Running OvmfPkg: 
> Uncrustify Coding Standard Test NO-TARGET -- WARNING - A file header 
> template is not specified in the config file. WARNING - A function 
> header template is not specified in the config file. ERROR - 
> /home/amd/edk2-upstream/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c 
> ERROR - 
> /home/amd/edk2-upstream/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c 
> ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET 
> returned 2 PROGRESS - --Running OvmfPkg: Guid Check Test NO-TARGET -- 
> PROGRESS - --->Test Success: Guid Check Test NO-TARGET PROGRESS - 
> --Running OvmfPkg: Char Encoding Check Test NO-TARGET -- PROGRESS - 
> --->Test Success: Char Encoding Check Test NO-TARGET PROGRESS - 
> --Running OvmfPkg: Spell Check Test NO-TARGET -- WARNING - NodeJs not 
> installed. Test can't run WARNING - --->Test Skipped: in plugin! Spell 
> Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Dsc Complete Check 
> Test NO-TARGET -- PROGRESS - --->Test Success: Dsc Complete Check Test 
> NO-TARGET PROGRESS - --Running OvmfPkg: Host Unit Test Dsc Complete 
> Check Test NO-TARGET -- PROGRESS - --->Test Success: Host Unit Test Dsc 
> Complete Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Host Unit 
> Test Compiler Plugin NOOPT -- WARNING - --->Test Skipped: in plugin! 
> Host Unit Test Compiler Plugin NOOPT PROGRESS - --Running OvmfPkg: 
> Library Class Check Test NO-TARGET -- PROGRESS - --->Test Success: 
> Library Class Check Test NO-TARGET PROGRESS - --Running OvmfPkg: 
> EccCheck Test NO-TARGET -- PROGRESS - --->Test Skipped by package! 
> EccCheck Test PROGRESS - --Running OvmfPkg: Compiler Plugin DEBUG -- 
> WARNING - --->Test Skipped: in plugin! Compiler Plugin DEBUG PROGRESS - 
> --Running OvmfPkg: Compiler Plugin RELEASE -- WARNING - --->Test 
> Skipped: in plugin! Compiler Plugin RELEASE PROGRESS - --Running 
> OvmfPkg: Dependency Check Test NO-TARGET -- PROGRESS - --->Test Success: 
> Dependency Check Test NO-TARGET PROGRESS - --Running OvmfPkg: License 
> Check Test NO-TARGET -- PROGRESS - --->Test Success: License Check Test 
> NO-TARGET ERROR - Overall Build Status: Error PROGRESS - There were 1 
> failures out of 13 attempts SECTION - Summary ERROR - Error
> 

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

* Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
  2022-04-05 14:40               ` Michael Kubacki
@ 2022-04-05 14:42                 ` Michael Kubacki
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Kubacki @ 2022-04-05 14:42 UTC (permalink / raw)
  To: devel, ashish.kalra

In my previous mail, I showed how to see the Uncrustify diff from your 
server build. This mail is about local execution.

I'll start by saying that the easiest way I've found to run Uncrustify 
locally is as a VS Code plugin. It works on both Linux and Windows and 
it allows you to easily format code as you work with your choice of 
keyboard shortcut. Instructions for this approach are here:

https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Code-Formatting#recommended-usage-visual-studio-vs-code-plugin

If there's something missing there for Linux support, let me know and I 
will update it. If you use a different IDE, you will need to port those 
instructions if you want similar functionality.

The instructions for manual usage in a terminal are here:

https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Code-Formatting#manual-usage-run-in-a-terminal

The Linux command to generate the file list is given and I believe only 
the executable and path details will differ in the example given to call 
the executable with the generated file list.

Again, please give more specific details about where you're stuck on 
Linux if you're having issues here.

Thanks,
Michael

On 4/5/2022 10:40 AM, Michael Kubacki wrote:
> Before discussing how to see the issues locally, here's how to see them 
> in the pipelines. I will send a separate reply with local details.
> 
> 1. Go to the build that is failing Uncrustify.
> 
> I am using this PR for your case:
> https://github.com/tianocore/edk2/pull/2742
> 
> 2. Click "Details"
> 
> I am using "Ubuntu GCC5 PR" for your case
> 
> At this point the issue is described:
> 
> "Check file coding standard compliance in Edk2CiBuild.Edk2.OvmfPkg
> UncrustifyCheck failed due to 3 incorrectly formatted files."
> 
> 3. Click "View more details on Azure Pipelines"
> 
> https://github.com/tianocore/edk2/pull/2742/checks?check_run_id=5826935687
> 
> 4. Find the failing job and click it.
> 
> In your case it is "Build_GCC5_TARGET_PLATFORMS".
> 
> https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=47536&view=results 
> 
> 
> 5. It will now have a link showing "XX%" tests passed (65% in this 
> instance).
> 
> Click that link to see the tests that failed.
> 
> https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=47536&view=logs&j=ec42d809-3c3b-54a9-276c-e54a8b9aaee9 
> 
> 
> 6. Now, in the tests summary it will show the same message you saw in 
> step (2):
> 
> "Check file coding standard compliance in Edk2CiBuild.Edk2.OvmfPkg
> UncrustifyCheck failed due to 3 incorrectly formatted files."
> 
> https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=47536&view=ms.vss-test-web.build-test-results-tab 
> 
> 
> Click that text to open more details.
> 
> https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=47536&view=ms.vss-test-web.build-test-results-tab&runId=345782&resultId=100009&paneView=debug 
> 
> 
> 7. Now, you will see the following error message in the "Debug" tab by 
> default:
> 
> "UncrustifyCheck failed due to 3 incorrectly formatted files."
> 
> Click the "Attachments" tab to get more details.
> 
> https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=47536&view=ms.vss-test-web.build-test-results-tab&runId=345782&resultId=100009&paneView=attachments 
> 
> 
> 8. Now, you will see details about the Uncrustify run in the 
> "Standard_Console_Output.log" attachment:
> 
> """
> Uncrustify version: Uncrustify-c82ee034
>   Found Uncrustify at 
> /home/vsts/work/1/s/.pytool/Plugin/UncrustifyCheck/mu-uncrustify-release_extdep/Linux-x86/uncrustify 
> 
>   Uncrustify version: Uncrustify-c82ee034
> 
>   Uncrustify executed against 513 files in OvmfPkg in 2.31 seconds.
> """
> 
> Click on the "Standard_Error_Output.log" attachment to get more details 
> about the error.
> 
> Those details for your job are as follows. This is a diff of the changes 
> needed.
> 
> """
> Files with formatting errors:
>   Formatting errors in 
> Library/BaseMemEncryptSevLib/PeiDxeMemEncryptSevLibInternal.c
>   --- 
> /home/vsts/work/1/s/OvmfPkg/Library/BaseMemEncryptSevLib/PeiDxeMemEncryptSevLibInternal.c 
> 
>   +++ 
> /home/vsts/work/1/s/OvmfPkg/Library/BaseMemEncryptSevLib/PeiDxeMemEncryptSevLibInternal.c.uncrustify_plugin 
> 
>   @@ -36,8 +36,8 @@
>   RETURN_STATUS
>   EFIAPI
>   MemEncryptSevLocateInitialSmramSaveStateMapPages (
>   -  OUT UINTN *BaseAddress,
>   -  OUT UINTN *NumberOfPages
>   +  OUT UINTN  *BaseAddress,
>   +  OUT UINTN  *NumberOfPages
>   )
>   {
>   UINTN  MapStart;
>   @@ -50,8 +50,8 @@
>   return RETURN_UNSUPPORTED;
>   }
> 
>   -  MapStart = SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET;
>   -  MapEnd   = MapStart + sizeof (QEMU_SMRAM_SAVE_STATE_MAP);
>   +  MapStart      = SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET;
>   +  MapEnd        = MapStart + sizeof (QEMU_SMRAM_SAVE_STATE_MAP);
>   MapPagesStart = MapStart & ~(UINTN)EFI_PAGE_MASK;
>   MapPagesEnd   = ALIGN_VALUE (MapEnd, EFI_PAGE_SIZE);
>   MapPagesSize  = MapPagesEnd - MapPagesStart;
>   @@ -87,34 +87,34 @@
>   Signature[12] = '\0';
>   for (mKvmLeaf = 0x40000000; mKvmLeaf < 0x40010000; mKvmLeaf += 0x100) {
>   AsmCpuid (
>   -              mKvmLeaf,
>   -              NULL,
>   -              (UINT32 *)&Signature[0],
>   -              (UINT32 *)&Signature[4],
>   -              (UINT32 *)&Signature[8]
>   -              );
>   +      mKvmLeaf,
>   +      NULL,
>   +      (UINT32 *)&Signature[0],
>   +      (UINT32 *)&Signature[4],
>   +      (UINT32 *)&Signature[8]
>   +      );
> 
>   if (AsciiStrCmp (Signature, "KVMKVMKVM") == 0) {
>   DEBUG (
>   -             (
>   -              DEBUG_INFO,
>   -              "%a: KVM Detected, signature = %a\n",
>   -              __FUNCTION__,
>   -              Signature
>   -             )
>   -             );
>   +        (
>   +         DEBUG_INFO,
>   +         "%a: KVM Detected, signature = %a\n",
>   +         __FUNCTION__,
>   +         Signature
>   +        )
>   +        );
> 
>   RegEax = mKvmLeaf + 1;
>   RegEcx = 0;
>   AsmCpuid (mKvmLeaf + 1, &RegEax, &RegEbx, &RegEcx, &RegEdx);
>   if ((RegEax & KVM_FEATURE_MIGRATION_CONTROL) != 0) {
>   DEBUG (
>   -               (
>   -                DEBUG_INFO,
>   -                "%a: SEV Live Migration feature supported\n",
>   -                __FUNCTION__
>   -               )
>   -               );
>   +          (
>   +           DEBUG_INFO,
>   +           "%a: SEV Live Migration feature supported\n",
>   +           __FUNCTION__
>   +          )
>   +          );
> 
>   return TRUE;
>   }
> 
>   Formatting errors in 
> Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
>   --- 
> /home/vsts/work/1/s/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c 
> 
>   +++ 
> /home/vsts/work/1/s/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c.uncrustify_plugin 
> 
>   @@ -20,11 +20,11 @@
> 
>   #include "PeiDxeMemEncryptSevLibInternal.h"
> 
>   -STATIC UINT64   mCurrentAttr            = 0;
>   -STATIC BOOLEAN  mCurrentAttrRead        = FALSE;
>   -STATIC UINT64   mSevEncryptionMask      = 0;
>   -STATIC BOOLEAN  mSevEncryptionMaskSaved = FALSE;
>   -STATIC BOOLEAN  mSevLiveMigrationStatus = FALSE;
>   +STATIC UINT64   mCurrentAttr                   = 0;
>   +STATIC BOOLEAN  mCurrentAttrRead               = FALSE;
>   +STATIC UINT64   mSevEncryptionMask             = 0;
>   +STATIC BOOLEAN  mSevEncryptionMaskSaved        = FALSE;
>   +STATIC BOOLEAN  mSevLiveMigrationStatus        = FALSE;
>   STATIC BOOLEAN  mSevLiveMigrationStatusChecked = FALSE;
> 
>   /**
>   @@ -127,7 +127,7 @@
>   )
>   {
>   if (KvmDetectSevLiveMigrationFeature ()) {
>   -        mSevLiveMigrationStatus = TRUE;
>   +    mSevLiveMigrationStatus = TRUE;
>   }
> 
>   mSevLiveMigrationStatusChecked = TRUE;
> 
>   Formatting errors in 
> Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c
>   --- 
> /home/vsts/work/1/s/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c 
> 
>   +++ 
> /home/vsts/work/1/s/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c.uncrustify_plugin 
> 
>   @@ -19,8 +19,8 @@
> 
>   #include "PeiDxeMemEncryptSevLibInternal.h"
> 
>   -STATIC BOOLEAN mSevLiveMigrationStatus = FALSE;
>   -STATIC BOOLEAN mSevLiveMigrationStatusChecked = FALSE;
>   +STATIC BOOLEAN  mSevLiveMigrationStatus        = FALSE;
>   +STATIC BOOLEAN  mSevLiveMigrationStatusChecked = FALSE;
> 
>   /**
>   Read the workarea to determine whether SEV is enabled. If enabled,
> """
> 
> Thanks,
> Michael
> 
> On 4/5/2022 2:09 AM, Ashish Kalra via groups.io wrote:
>> Hi Mike,
>>
>> I am following up on Brijesh's email, i am running the CI tests 
>> related to my SEV live migration patches,
>> which i am in process of posting.
>>
>> I am running the CI tests locally and getting errors while building 
>> OvmfPkg, my patches include two new
>> header files, error log is copied below.
>>
>> Do you have updated instructions on how to run through uncrustify 
>> locally and
>> get my patch updated with those formatting changes, especially for 
>> Linux ?
>> (your above instructions seem specific to Windows).
>>
>> Thanks,
>> Ashish
>>
>> Error log:
>>
>> ../.local/bin/stuart_ci_build -c .pytool/CISettings.py 
>> TOOL_CHAIN_TAG=GCC5 -p OvmfPkg SECTION - Init SDE WARNING - Using Pip 
>> Tools based BaseTools SECTION - Loading Plugins SECTION - Start 
>> Invocable Tool SECTION - Getting Environment SECTION - Loading plugins 
>> SECTION - Building OvmfPkg Package PROGRESS - --Running OvmfPkg: 
>> Uncrustify Coding Standard Test NO-TARGET -- WARNING - A file header 
>> template is not specified in the config file. WARNING - A function 
>> header template is not specified in the config file. ERROR - 
>> /home/amd/edk2-upstream/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c 
>> ERROR - 
>> /home/amd/edk2-upstream/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c 
>> ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET 
>> returned 2 PROGRESS - --Running OvmfPkg: Guid Check Test NO-TARGET -- 
>> PROGRESS - --->Test Success: Guid Check Test NO-TARGET PROGRESS - 
>> --Running OvmfPkg: Char Encoding Check Test NO-TARGET -- PROGRESS - 
>> --->Test Success: Char Encoding Check Test NO-TARGET PROGRESS - 
>> --Running OvmfPkg: Spell Check Test NO-TARGET -- WARNING - NodeJs not 
>> installed. Test can't run WARNING - --->Test Skipped: in plugin! Spell 
>> Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Dsc Complete Check 
>> Test NO-TARGET -- PROGRESS - --->Test Success: Dsc Complete Check Test 
>> NO-TARGET PROGRESS - --Running OvmfPkg: Host Unit Test Dsc Complete 
>> Check Test NO-TARGET -- PROGRESS - --->Test Success: Host Unit Test 
>> Dsc Complete Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Host 
>> Unit Test Compiler Plugin NOOPT -- WARNING - --->Test Skipped: in 
>> plugin! Host Unit Test Compiler Plugin NOOPT PROGRESS - --Running 
>> OvmfPkg: Library Class Check Test NO-TARGET -- PROGRESS - --->Test 
>> Success: Library Class Check Test NO-TARGET PROGRESS - --Running 
>> OvmfPkg: EccCheck Test NO-TARGET -- PROGRESS - --->Test Skipped by 
>> package! EccCheck Test PROGRESS - --Running OvmfPkg: Compiler Plugin 
>> DEBUG -- WARNING - --->Test Skipped: in plugin! Compiler Plugin DEBUG 
>> PROGRESS - --Running OvmfPkg: Compiler Plugin RELEASE -- WARNING - 
>> --->Test Skipped: in plugin! Compiler Plugin RELEASE PROGRESS - 
>> --Running OvmfPkg: Dependency Check Test NO-TARGET -- PROGRESS - 
>> --->Test Success: Dependency Check Test NO-TARGET PROGRESS - --Running 
>> OvmfPkg: License Check Test NO-TARGET -- PROGRESS - --->Test Success: 
>> License Check Test NO-TARGET ERROR - Overall Build Status: Error 
>> PROGRESS - There were 1 failures out of 13 attempts SECTION - Summary 
>> ERROR - Error
>> 

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

* Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
  2022-04-05  6:09             ` Ashish Kalra
  2022-04-05 14:40               ` Michael Kubacki
@ 2022-04-05 15:00               ` Rebecca Cran
  2022-04-05 15:21                 ` Michael D Kinney
  1 sibling, 1 reply; 12+ messages in thread
From: Rebecca Cran @ 2022-04-05 15:00 UTC (permalink / raw)
  To: devel, ashish.kalra; +Cc: Michael Kubacki

I have the following script for running Uncrustify locally on Linux:

../edk2/.pytool/Plugin/UncrustifyCheck/mu-uncrustify-release_extdep/Linux-x86/uncrustify 
-c ../edk2/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg -F files 
--replace --no-backup --if-changed

Then I just echo the paths of files I want to check/fix:

echo Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c > files
echo Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c >> 
files


-- 
Rebecca Cran

On 4/5/22 00:09, Ashish Kalra via groups.io wrote:
> Hi Mike,
>
> I am following up on Brijesh's email, i am running the CI tests 
> related to my SEV live migration patches,
> which i am in process of posting.
>
> I am running the CI tests locally and getting errors while building 
> OvmfPkg, my patches include two new
> header files, error log is copied below.
>
> Do you have updated instructions on how to run through uncrustify 
> locally and
> get my patch updated with those formatting changes, especially for 
> Linux ? (your above instructions seem specific to Windows).
>
> Thanks,
> Ashish
>
> Error log:
>
> ../.local/bin/stuart_ci_build -c .pytool/CISettings.py 
> TOOL_CHAIN_TAG=GCC5 -p OvmfPkg SECTION - Init SDE WARNING - Using Pip 
> Tools based BaseTools SECTION - Loading Plugins SECTION - Start 
> Invocable Tool SECTION - Getting Environment SECTION - Loading plugins 
> SECTION - Building OvmfPkg Package PROGRESS - --Running OvmfPkg: 
> Uncrustify Coding Standard Test NO-TARGET -- WARNING - A file header 
> template is not specified in the config file. WARNING - A function 
> header template is not specified in the config file. ERROR - 
> /home/amd/edk2-upstream/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c 
> ERROR - 
> /home/amd/edk2-upstream/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c 
> ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET 
> returned 2 PROGRESS - --Running OvmfPkg: Guid Check Test NO-TARGET -- 
> PROGRESS - --->Test Success: Guid Check Test NO-TARGET PROGRESS - 
> --Running OvmfPkg: Char Encoding Check Test NO-TARGET -- PROGRESS - 
> --->Test Success: Char Encoding Check Test NO-TARGET PROGRESS - 
> --Running OvmfPkg: Spell Check Test NO-TARGET -- WARNING - NodeJs not 
> installed. Test can't run WARNING - --->Test Skipped: in plugin! Spell 
> Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Dsc Complete Check 
> Test NO-TARGET -- PROGRESS - --->Test Success: Dsc Complete Check Test 
> NO-TARGET PROGRESS - --Running OvmfPkg: Host Unit Test Dsc Complete 
> Check Test NO-TARGET -- PROGRESS - --->Test Success: Host Unit Test 
> Dsc Complete Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Host 
> Unit Test Compiler Plugin NOOPT -- WARNING - --->Test Skipped: in 
> plugin! Host Unit Test Compiler Plugin NOOPT PROGRESS - --Running 
> OvmfPkg: Library Class Check Test NO-TARGET -- PROGRESS - --->Test 
> Success: Library Class Check Test NO-TARGET PROGRESS - --Running 
> OvmfPkg: EccCheck Test NO-TARGET -- PROGRESS - --->Test Skipped by 
> package! EccCheck Test PROGRESS - --Running OvmfPkg: Compiler Plugin 
> DEBUG -- WARNING - --->Test Skipped: in plugin! Compiler Plugin DEBUG 
> PROGRESS - --Running OvmfPkg: Compiler Plugin RELEASE -- WARNING - 
> --->Test Skipped: in plugin! Compiler Plugin RELEASE PROGRESS - 
> --Running OvmfPkg: Dependency Check Test NO-TARGET -- PROGRESS - 
> --->Test Success: Dependency Check Test NO-TARGET PROGRESS - --Running 
> OvmfPkg: License Check Test NO-TARGET -- PROGRESS - --->Test Success: 
> License Check Test NO-TARGET ERROR - Overall Build Status: Error 
> PROGRESS - There were 1 failures out of 13 attempts SECTION - Summary 
> ERROR - Error
> 


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

* Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
  2022-04-05 15:00               ` Rebecca Cran
@ 2022-04-05 15:21                 ` Michael D Kinney
  0 siblings, 0 replies; 12+ messages in thread
From: Michael D Kinney @ 2022-04-05 15:21 UTC (permalink / raw)
  To: devel@edk2.groups.io, quic_rcran@quicinc.com,
	ashish.kalra@amd.com, Kinney, Michael D
  Cc: Michael Kubacki

Hi Rebecca,

I agree this is a good way to run from command line. 

With the addition of the ignore files feature in the YAML files, you
have to make sure the filenames added to files are not in the ignored
set and not in BaseTools and not from submodules.

If you are working on a specific lib/module/pkg, then adding all the
C/H files from that scope is also a good technique.

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Rebecca Cran
> Sent: Tuesday, April 5, 2022 8:01 AM
> To: devel@edk2.groups.io; ashish.kalra@amd.com
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> Subject: Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"
> 
> I have the following script for running Uncrustify locally on Linux:
> 
> ../edk2/.pytool/Plugin/UncrustifyCheck/mu-uncrustify-release_extdep/Linux-x86/uncrustify
> -c ../edk2/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg -F files
> --replace --no-backup --if-changed
> 
> Then I just echo the paths of files I want to check/fix:
> 
> echo Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c > files
> echo Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c >>
> files
> 
> 
> --
> Rebecca Cran
> 
> On 4/5/22 00:09, Ashish Kalra via groups.io wrote:
> > Hi Mike,
> >
> > I am following up on Brijesh's email, i am running the CI tests
> > related to my SEV live migration patches,
> > which i am in process of posting.
> >
> > I am running the CI tests locally and getting errors while building
> > OvmfPkg, my patches include two new
> > header files, error log is copied below.
> >
> > Do you have updated instructions on how to run through uncrustify
> > locally and
> > get my patch updated with those formatting changes, especially for
> > Linux ? (your above instructions seem specific to Windows).
> >
> > Thanks,
> > Ashish
> >
> > Error log:
> >
> > ../.local/bin/stuart_ci_build -c .pytool/CISettings.py
> > TOOL_CHAIN_TAG=GCC5 -p OvmfPkg SECTION - Init SDE WARNING - Using Pip
> > Tools based BaseTools SECTION - Loading Plugins SECTION - Start
> > Invocable Tool SECTION - Getting Environment SECTION - Loading plugins
> > SECTION - Building OvmfPkg Package PROGRESS - --Running OvmfPkg:
> > Uncrustify Coding Standard Test NO-TARGET -- WARNING - A file header
> > template is not specified in the config file. WARNING - A function
> > header template is not specified in the config file. ERROR -
> > /home/amd/edk2-upstream/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c
> > ERROR -
> > /home/amd/edk2-upstream/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
> > ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET
> > returned 2 PROGRESS - --Running OvmfPkg: Guid Check Test NO-TARGET --
> > PROGRESS - --->Test Success: Guid Check Test NO-TARGET PROGRESS -
> > --Running OvmfPkg: Char Encoding Check Test NO-TARGET -- PROGRESS -
> > --->Test Success: Char Encoding Check Test NO-TARGET PROGRESS -
> > --Running OvmfPkg: Spell Check Test NO-TARGET -- WARNING - NodeJs not
> > installed. Test can't run WARNING - --->Test Skipped: in plugin! Spell
> > Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Dsc Complete Check
> > Test NO-TARGET -- PROGRESS - --->Test Success: Dsc Complete Check Test
> > NO-TARGET PROGRESS - --Running OvmfPkg: Host Unit Test Dsc Complete
> > Check Test NO-TARGET -- PROGRESS - --->Test Success: Host Unit Test
> > Dsc Complete Check Test NO-TARGET PROGRESS - --Running OvmfPkg: Host
> > Unit Test Compiler Plugin NOOPT -- WARNING - --->Test Skipped: in
> > plugin! Host Unit Test Compiler Plugin NOOPT PROGRESS - --Running
> > OvmfPkg: Library Class Check Test NO-TARGET -- PROGRESS - --->Test
> > Success: Library Class Check Test NO-TARGET PROGRESS - --Running
> > OvmfPkg: EccCheck Test NO-TARGET -- PROGRESS - --->Test Skipped by
> > package! EccCheck Test PROGRESS - --Running OvmfPkg: Compiler Plugin
> > DEBUG -- WARNING - --->Test Skipped: in plugin! Compiler Plugin DEBUG
> > PROGRESS - --Running OvmfPkg: Compiler Plugin RELEASE -- WARNING -
> > --->Test Skipped: in plugin! Compiler Plugin RELEASE PROGRESS -
> > --Running OvmfPkg: Dependency Check Test NO-TARGET -- PROGRESS -
> > --->Test Success: Dependency Check Test NO-TARGET PROGRESS - --Running
> > OvmfPkg: License Check Test NO-TARGET -- PROGRESS - --->Test Success:
> > License Check Test NO-TARGET ERROR - Overall Build Status: Error
> > PROGRESS - There were 1 failures out of 13 attempts SECTION - Summary
> > ERROR - Error
> >
> 
> 
> 
> 
> 


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

end of thread, other threads:[~2022-04-05 15:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-07 19:52 EDK2 CI build error "Uncrustify Coding Standard" Brijesh Singh
2021-12-07 20:49 ` [edk2-devel] " Michael Kubacki
2021-12-07 21:02   ` Michael D Kinney
2021-12-08 14:39     ` Brijesh Singh
2021-12-08 16:10       ` Brijesh Singh
2021-12-08 16:15         ` Michael Kubacki
2022-04-05  5:57           ` Ashish Kalra
2022-04-05  6:09             ` Ashish Kalra
2022-04-05 14:40               ` Michael Kubacki
2022-04-05 14:42                 ` Michael Kubacki
2022-04-05 15:00               ` Rebecca Cran
2022-04-05 15:21                 ` Michael D Kinney

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