From: "Michael Kubacki" <mikuback@linux.microsoft.com>
To: Laszlo Ersek <lersek@redhat.com>,
edk2-devel-groups-io <devel@edk2.groups.io>
Cc: Michael Kinney <michael.d.kinney@intel.com>,
Pedro Falcato <pedro.falcato@gmail.com>,
Andrew Fish <afish@apple.com>,
Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>,
"Leif Lindholm (Quic)" <quic_llindhol@quicinc.com>
Subject: Re: [edk2-devel] edk2 uncrustify update (73.0.8)?
Date: Mon, 13 Nov 2023 15:08:28 -0500 [thread overview]
Message-ID: <23dd696a-52a1-4c26-bfb6-5b5587325c42@linux.microsoft.com> (raw)
In-Reply-To: <0107c96b-849a-db48-194b-1a4c1f3b0c78@redhat.com>
On 11/13/2023 6:58 AM, Laszlo Ersek wrote:
> Hi Michael,
>
> recently I encountered an uncrustify failure on github.
>
> The reason was that my local uncrustify was *more recent* (73.0.8) than
> the one we use in edk2 CI (which is 73.0.3, per the edk2 file
> ".pytool/Plugin/UncrustifyCheck/uncrustify_ext_dep.yaml").
>
> Updating the version number in the YAML file (i.e., advancing edk2 to
> version 73.0.8) seems easy enough, but:
>
> - Do you think 73.0.8 is mature enough for adoption in edk2?
>
> This upstream uncrustify release was tagged in April (and I can't see
> any more recent commits), so I assume it should be stable.
>
Yes, it is stable. We've been using each new Uncrustify release against
edk2 code in Project Mu during that time. I updated our code to include
that change in September 2022 -
https://github.com/microsoft/mu_basecore/commit/6932526bee9a2f5f3af7588923beae5e5d8fd128.
The changes since then have been additional build support for Linux and
Windows Arm and macOS.
I originally did not bring this to edk2 right away to verify stability
over time and reduce thrash if any other changes came in to consolidate
overall disruption to edk2.
> - Would the version update require a whole-tree re-uncrustification?
>
Yes. I just did it. It is relatively minor and impacts expected code areas.
https://github.com/tianocore/edk2/pull/5043/files
I'm happy to send that to the list if desired.
> The reason I'm not just ignoring this topic is that 73.0.8 actually
> produces *better output* than 73.0.3, at least in the one instance I
> encountered. Compare:
>
>> diff --git a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
>> index 434cdca84b23..3a6f75988220 100644
>> --- a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
>> +++ b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
>> @@ -43,12 +43,12 @@ STATIC EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL
>> STATIC CONST EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR mMmio64Configuration = {
>> ACPI_ADDRESS_SPACE_DESCRIPTOR, // Desc
>> (UINT16)( // Len
>> - sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) -
>> - OFFSET_OF (
>> - EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR,
>> - ResType
>> - )
>> - ),
>> + sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) -
>> + OFFSET_OF (
>> + EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR,
>> + ResType
>> + )
>> + ),
>> ACPI_ADDRESS_SPACE_TYPE_MEM, // ResType
>> 0, // GenFlag
>> 0, // SpecificFlag
>> @@ -77,12 +77,12 @@ STATIC CONST EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR mMmio64Configuration = {
>> STATIC CONST EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR mOptionRomConfiguration = {
>> ACPI_ADDRESS_SPACE_DESCRIPTOR, // Desc
>> (UINT16)( // Len
>> - sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) -
>> - OFFSET_OF (
>> - EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR,
>> - ResType
>> - )
>> - ),
>> + sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) -
>> + OFFSET_OF (
>> + EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR,
>> + ResType
>> + )
>> + ),
>> ACPI_ADDRESS_SPACE_TYPE_MEM, // ResType
>> 0, // GenFlag
>> 0, // Disable option roms SpecificFlag
>
> Note that 73.0.3 indents the subexpression to the "//" comment on the
> previous line, while 73.0.8 ignores the comment -- which I think is
> justified here.
>
> I believe this improvement may come from uncrustify commit 239c4fad745b
> ("Prevent endless indentation scenario in struct assignment",
> 2022-07-29). I think it's worth having in edk2.
>
> CC: stewards, Pedro (commit 6ded9f50c3aa), Marcin (traditionally a big
> fan of uncrustify :))
>
> Thanks
> Laszlo
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111177): https://edk2.groups.io/g/devel/message/111177
Mute This Topic: https://groups.io/mt/102559740/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:[~2023-11-13 20:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 11:58 [edk2-devel] edk2 uncrustify update (73.0.8)? Laszlo Ersek
2023-11-13 12:29 ` Marcin Juszkiewicz
2023-11-13 19:14 ` Rebecca Cran via groups.io
2023-11-13 20:37 ` Michael Kubacki
2023-11-13 19:07 ` Pedro Falcato
2023-11-13 20:21 ` Michael Kubacki
2023-11-13 21:05 ` Michael D Kinney
2023-11-14 14:51 ` Laszlo Ersek
2023-11-14 15:12 ` Rebecca Cran via groups.io
2023-11-15 8:52 ` Laszlo Ersek
[not found] ` <17974449E158DE38.1153@groups.io>
2023-11-13 19:10 ` Pedro Falcato
2023-11-13 20:08 ` Michael Kubacki [this message]
2023-11-13 20:37 ` Rebecca Cran
2023-11-13 21:33 ` Pedro Falcato
2023-11-14 15:01 ` Laszlo Ersek
2023-11-16 8:29 ` Pedro Falcato
2023-11-16 17:36 ` Michael Kubacki
2023-11-23 2:07 ` Pedro Falcato
2023-11-17 9:08 ` Laszlo Ersek
2023-11-23 1:44 ` Pedro Falcato
2023-11-14 1:46 ` Michael Kubacki
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=23dd696a-52a1-4c26-bfb6-5b5587325c42@linux.microsoft.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