All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Cc: qemu-devel@nongnu.org,  philmd@linaro.org,
	 John Snow <jsnow@redhat.com>,  Cleber Rosa <cleber@redhat.com>
Subject: Re: [PATCH 00/39] MAINTAINERS: Fix F: lines
Date: Tue, 02 Jun 2026 09:00:00 +0200	[thread overview]
Message-ID: <87wlwh77gv.fsf@pond.sub.org> (raw)
In-Reply-To: <c7cc0040-872d-425c-827f-c57db87ee12c@oss.qualcomm.com> (Pierrick Bouvier's message of "Mon, 1 Jun 2026 12:03:30 -0700")

Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> writes:

> On 6/1/2026 3:06 AM, Markus Armbruster wrote:
>> Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> writes:
>> 
>>> Hi Markus,
>>>
>>> On 5/21/2026 1:04 AM, Markus Armbruster wrote:
>>>> Quite a few F: lines don't match any files.  The quick & dirty check
>>>>
>>>>     $ ls `sed -n 's/^F: *//p' MAINTAINERS ` >/dev/null
>>>>
>>>> finds about fifty.
>>>>
>>>> Philippe Mathieu-Daudé recently posted a few fixes:
>>>>
>>>>   MAINTAINERS: Fix docker/dockerfiles/debian-hexagon-cross.docker path
>>>>   MAINTAINERS: Cover debian-loongarch-cross.docker with LoongArch section
>>>>   MAINTAINERS: Cover debian-xtensa-cross.docker with Xtensa section
>>>>   MAINTAINERS: Cover debian-tricore-cross.docker with TriCore section
>>>>   MAINTAINERS: Cover python.docker with Python library section
>>>>   MAINTAINERS: Fix s390x storage key/attribute device paths
>>>>   MAINTAINERS: Fix tcg/s390x/ path
>>>>   MAINTAINERS: Correct scripts/coverity-model.c path
>>>>   MAINTAINERS: Fix hexagon-linux-user.mak path

[...]

>>> In addition, see the patch attached to this email.
>>> It integrates checking this directly at configure time, so we never run
>>> into any missing entry again in the future.
>>>
>>> I share this here not for a review, but simply to avoid a duplicated
>>> effort, and make sure people know it will be sent after this series.
>>>
>>> I don't believe in adding this in checkpatch, because it's not enforced
>>> systematically unfortunately. Breaking the meson configuration is a good
>>> way to make sure it's enforced by design.
>> 
>> No objection.
>> 
>>> With your series applied, the left entries are:
>> 
>> Most of these are fixed in Philippe's patches mentioned above.
>>
>
> 👍
>
>>> No matching files for /usr2/pbouvier/.work/qemu/MAINTAINERS +258:
>>> configs/targets/hexagon-linux-user/default.mak
>> 
>> MAINTAINERS: Fix hexagon-linux-user.mak path
>> 
>>> No matching files for /usr2/pbouvier/.work/qemu/MAINTAINERS +259:
>>> docker/dockerfiles/debian-hexagon-cross.docker
>> 
>> MAINTAINERS: Fix docker/dockerfiles/debian-hexagon-cross.docker path
>> 
>>> No matching files for /usr2/pbouvier/.work/qemu/MAINTAINERS +2956:
>>> hw/s390x/storage-keys.h
>>> No matching files for /usr2/pbouvier/.work/qemu/MAINTAINERS +2965:
>>> hw/s390x/storage-attributes.h
>> 
>> MAINTAINERS: Fix s390x storage key/attribute device paths
>> 
>>> No matching files for /usr2/pbouvier/.work/qemu/MAINTAINERS +3241:
>>> scripts/coverity-model.c
>> 
>> MAINTAINERS: Correct scripts/coverity-model.c path
>> 
>>> No matching files for /usr2/pbouvier/.work/qemu/MAINTAINERS +3468:
>>> tests/*.py
>> 
>> This is the exception I mentioned above.
>> 
>> The intent is to match *.py below tests/.  It actually matches only in
>> tests/, not in its subdirectories.
>> 
>> Here's a dumb fix:
>> 
>>     F: tests/*.py
>>     F: tests/*/*.py
>>     F: tests/*/*/*.py
>>     F: tests/*/*/*/*.py
>> 
>
> It's acceptable, and nice because it's not ambiguous.
> Also, it shows us the first line is not a correct entry (there is no
> tests/*.py).

It's also brittle: breaks when we add the first .py at level.

>> for however many levels we have.  Same for the scripts/ line next to it.
>> Blech.
>> 
>> The smart fix might be to port N: from the kernel.
>> 
>> 	N: Files and directories *Regex* patterns.
>> 	   N:	[^a-z]tegra	all files whose path contains tegra
>> 	                        (not including files like integrator)
>> 	   One pattern per line.  Multiple N: lines acceptable.
>> 	   scripts/get_maintainer.pl has different behavior for files that
>> 	   match F: pattern and matches of N: patterns.  By default,
>> 	   get_maintainer will not look at git log history when an F: pattern
>> 	   match occurs.  When an N: match occurs, git log history is used
>> 	   to also notify the people that have git commit signatures.
>> 
>> But I wonder: is this section useful at all?
>
> I would prefer to use the manual entries approach above, especially if
> there is only folder that is concerned.
> When we'll have two different use case, maybe we can consider a more
> generic approach.

I'm aware of just two:

    Python scripts
    M: John Snow <jsnow@redhat.com>
    M: Cleber Rosa <crosa@redhat.com>
    S: Odd Fixes
    F: scripts/*.py
    F: tests/*.py

The section was added almost a decade ago (commit ad904f6689f), and
never worked as intended.  I asked John Snow about deleting it to
unblock your work.  He told me he'd be fine with that.  Could add it
back later fixed.

>>> No matching files for /usr2/pbouvier/.work/qemu/MAINTAINERS +4149:
>>> tcg/s390/
>> 
>> MAINTAINERS: Fix tcg/s390x/ path
>> 
>>> Once your current series is pulled, I'll fix the remaining and send the
>>> attached patch. Or feel free to do it directly if you like the idea :)
>>>
>>> Regards,
>>> Pierrick
>> 
>> Two remarks inline.
>> 
>>> From 6c9b49ac7ec06c0159d2b4ba9c9d1081e02ef765 Mon Sep 17 00:00:00 2001
>>> From: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
>>> Date: Fri, 22 May 2026 12:23:17 -0700
>>> Subject: [PATCH] meson.build: check MAINTAINERS file is consistent with source
>>>  tree
>>>
>>> We add a new script: scripts/check-maintainers-file.py, that will run at
>>> configuration time (and not at build time), to not hurt build time.
>>> This script runs in 0.2s on my dev VM, which has an old cpu.
>>>
>>> We can expect things to be mostly in sync since adding or removing a
>>> source or test file will trigger a configure step.
>>> For the rest, like docs, tcg tests, or remaining files, GitLab CI will
>>> build things from scratch and always run the configure step.
>>>
>>> With this, it should be impossible by design to have an upstream
>>> MAINTAINERS file with non existing file entries.
>>>
>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
>>> ---
>>>  meson.build                       |  5 +++
>>>  scripts/check-maintainers-file.py | 53 +++++++++++++++++++++++++++++++
>>>  2 files changed, 58 insertions(+)
>>>  create mode 100755 scripts/check-maintainers-file.py
>>>
>>> diff --git a/meson.build b/meson.build
>>> index eeb096c1487..ddfb0b90ca6 100644
>>> --- a/meson.build
>>> +++ b/meson.build
>>> @@ -18,6 +18,11 @@ add_test_setup('thorough',
>>>  
>>>  meson.add_postconf_script(find_program('scripts/symlink-install-tree.py'))
>>>  
>>> +# check our MAINTAINERS file is consistent
>>> +check_maintainers = find_program('scripts/check-maintainers-file.py')
>>> +maintainers_file = files('MAINTAINERS')
>>> +run_command([check_maintainers, maintainers_file], check: true, console: true)
>> 
>> My version of meson (1.8.5) chokes on console: true.  According to
>> https://mesonbuild.com/Reference-manual_functions_run_command.html#run_command_console
>> it's new in 1.11.0.
>>
>
> Our configure script creates a venv with an updated version of meson,
> which is 1.11.1 at the moment.
> If you called meson directly (which uses your host meson), it's not how
> we're supposed to build QEMU.
> How did you try this?

I ran make :)

>> I tested with it deleted.
>> 
>>> +
>>>  ####################
>>>  # Global variables #
>>>  ####################
>>> diff --git a/scripts/check-maintainers-file.py b/scripts/check-maintainers-file.py
>>> new file mode 100755
>>> index 00000000000..b001816a401
>>> --- /dev/null
>>> +++ b/scripts/check-maintainers-file.py
>>> @@ -0,0 +1,53 @@
>>> +#! /usr/bin/env python3
>>> +
>>> +# Check incorrect file entries in MAINTAINERS
>>> +#
>>> +# Author: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
>>> +#
>>> +# SPDX-License-Identifier: GPL-2.0-or-later
>>> +
>>> +import argparse
>>> +import glob
>>> +import sys
>>> +
>>> +
>>> +def check_one_entry(line) -> bool:
>>> +    return True
>>> +
>>> +
>>> +def main() -> None:
>>> +    parser = argparse.ArgumentParser(description="Check MAINTAINERS file")
>>> +    parser.add_argument("maintainers", help="Path to MAINTAINERS file")
>>> +    args = parser.parse_args()
>>> +
>>> +    found_file_entry = False
>>> +    found_incorrect_entries = False
>>> +    line_counter = 0
>>> +
>>> +    with open(args.maintainers) as file:
>>> +        for entry in file:
>>> +            line_counter += 1
>>> +
>>> +            if not entry.startswith("F:"):
>>> +                continue
>>> +            entry = entry[2:].strip()
>>> +            found_file_entry = True
>>> +
>>> +            file_exists = len(glob.glob(entry, recursive=True)) > 0
>> 
>> I'm afraid this matches files not in git, just like my quick & dirty
>> one-liner.  Shouldn't we match against contents of HEAD, say output of
>> "git-ls-tree -r --name-only @"?
>>
>
> I don't think it's needed to restrict to git ls-tree. The only risk is
> that people have a local file they forgot (or didn't want) to add in
> git. It will be caught by CI that won't have such a file, so we're safe.
>
> What do you think?

Yes, we're safe, but the earlier we catch mistakes, the better.  Now,
the juice isn't always worth the squeeze.  How hard would we have to
squeeze here?  We could use fnmatch.filter(names, pat) to test whether
@pat matches anything in @names, where @names is from git-ls-tree.

>>> +            if file_exists:
>>> +                continue
>>> +
>>> +            found_incorrect_entries = True
>>> +            print(
>>> +                f"No matching files for {args.maintainers} +{line_counter}: {entry}",
>>> +                file=sys.stderr,
>>> +            )
>>> +
>>> +    if not found_file_entry:
>>> +        raise Exception("no file entry found - is MAINTAINERS path correct?")
>>> +    if found_incorrect_entries:
>>> +        raise Exception(f"incorrect entries found in {args.maintainers}")
>>> +
>>> +
>>> +if __name__ == "__main__":
>>> +    main()
>> 
>
> Regards,
> Pierrick



  reply	other threads:[~2026-06-02  7:01 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21  8:04 [PATCH 00/39] MAINTAINERS: Fix F: lines Markus Armbruster
2026-05-21  8:04 ` [PATCH 01/39] MAINTAINERS: Improve another "Overall" section headline Markus Armbruster
2026-05-21  8:04 ` [PATCH 02/39] MAINTAINERS: Delete trailing colons in section headlines Markus Armbruster
2026-05-21 11:13   ` Alex Bennée
2026-05-21  8:04 ` [PATCH 03/39] MAINTAINERS: Drop stale F: from "Guest CPU cores (TCG)" Markus Armbruster
2026-05-21  8:04 ` [PATCH 04/39] MAINTAINERS: Drop stale F: in "RISC-V TCG CPUs" Markus Armbruster
2026-05-21  8:39   ` Chao Liu
2026-05-27  0:41   ` Alistair Francis
2026-05-21  8:04 ` [PATCH 05/39] MAINTAINERS: Drop stale F: in "SPARC " Markus Armbruster
2026-05-21  8:04 ` [PATCH 06/39] MAINTAINERS: Drop stale F: from "Overall KVM CPUs" Markus Armbruster
2026-05-21  8:04 ` [PATCH 07/39] MAINTAINERS: Drop stale F: from "Overall CPUs other accelerators" Markus Armbruster
2026-05-21  8:04 ` [PATCH 08/39] MAINTAINERS: Drop stale F: from "virtio" Markus Armbruster
2026-05-21  8:04 ` [PATCH 09/39] MAINTAINERS: Fix F: in "Apple Silicon HVF CPUs" Markus Armbruster
2026-05-21  8:04 ` [PATCH 10/39] MAINTAINERS: Drop bad F: in "X86 Xen CPUs" Markus Armbruster
2026-05-22  9:22   ` Anthony PERARD
2026-05-21  8:04 ` [PATCH 11/39] MAINTAINERS: Fix F: in "WebAssembly" Markus Armbruster
2026-05-21  9:55   ` Kohei Tokunaga
2026-05-21  8:04 ` [PATCH 12/39] MAINTAINERS: Fix F: in "Allwinner-a10" Markus Armbruster
2026-05-21  8:04 ` [PATCH 13/39] MAINTAINERS: Fix F: in "Raspberry Pi" Markus Armbruster
2026-05-23 12:09   ` Philippe Mathieu-Daudé
2026-05-21  8:04 ` [PATCH 14/39] MAINTAINERS: Drop bad F: from "Xilinx Zynq" Markus Armbruster
2026-05-21  8:04 ` [PATCH 15/39] MAINTAINERS: Drop stale F: from "New World (mac99)" Markus Armbruster
2026-05-21  8:04 ` [PATCH 16/39] MAINTAINERS: Drop stale F: from "sPAPR (pseries)" Markus Armbruster
2026-05-21  9:37   ` Harsh Prateek Bora
2026-05-22 11:55   ` Amit Machhiwal
2026-05-21  8:04 ` [PATCH 17/39] MAINTAINERS: Fix F: typo in "sam460ex" Markus Armbruster
2026-05-21  8:04 ` [PATCH 18/39] MAINTAINERS: Fix F: in "SiFive Machines" Markus Armbruster
2026-05-27  0:41   ` Alistair Francis
2026-05-21  8:04 ` [PATCH 19/39] MAINTAINERS: Fix F: typo in "ACPI/HEST/GHES/ARM processor CPER" Markus Armbruster
2026-05-21  8:04 ` [PATCH 20/39] MAINTAINERS: Fix F: in "SSI" Markus Armbruster
2026-05-21  8:04 ` [PATCH 21/39] MAINTAINERS: Fix F: in "vhost" Markus Armbruster
2026-05-21  8:04 ` [PATCH 22/39] MAINTAINERS: Fix F: in "virtio-input" Markus Armbruster
2026-05-21  8:04 ` [PATCH 23/39] MAINTAINERS: Fix bad / stale F: in "virtio-rng" Markus Armbruster
2026-05-21  9:03   ` Laurent Vivier
2026-05-21  9:57     ` Markus Armbruster
2026-05-21  8:04 ` [PATCH 24/39] MAINTAINERS: Fix F: in "vhost-user-stubs" Markus Armbruster
2026-05-21  8:04 ` [PATCH 25/39] MAINTAINERS: Fix F: in "virtio-snd" and "virtio-gpu" Markus Armbruster
2026-05-21  8:13   ` Manos Pitsidianakis
2026-05-21 11:13   ` Alex Bennée
2026-05-21 11:46   ` Akihiko Odaki
2026-05-26 10:41   ` Dmitry Osipenko
2026-05-21  8:04 ` [PATCH 26/39] MAINTAINERS: Fix F: typo in "pcf8574" Markus Armbruster
2026-05-23 12:08   ` Philippe Mathieu-Daudé
2026-05-21  8:04 ` [PATCH 27/39] MAINTAINERS: Drop stale F: from "Block I/O path" Markus Armbruster
2026-05-21 14:56   ` Stefan Hajnoczi
2026-05-21  8:05 ` [PATCH 28/39] MAINTAINERS: Fix F: typo in "Dump" Markus Armbruster
2026-05-23 12:07   ` Philippe Mathieu-Daudé
2026-05-21  8:05 ` [PATCH 29/39] MAINTAINERS: Drop stale F: from "Human Monitor (HMP)" Markus Armbruster
2026-05-21 11:36   ` Dr. David Alan Gilbert
2026-05-21  8:05 ` [PATCH 30/39] MAINTAINERS: Fix F: in "QDev" Markus Armbruster
2026-05-23 12:07   ` Philippe Mathieu-Daudé
2026-05-21  8:05 ` [PATCH 31/39] MAINTAINERS: Fix F: in "QMP" Markus Armbruster
2026-05-21  8:05 ` [PATCH 32/39] MAINTAINERS: Fix F: typo in "I3C" Markus Armbruster
2026-05-21  8:07   ` Jamin Lin
2026-05-21  8:16   ` Cédric Le Goater
2026-05-21  8:05 ` [PATCH 33/39] MAINTAINERS: Drop stale F: from "EDK2 Firmware" Markus Armbruster
2026-05-21  8:05 ` [PATCH 34/39] MAINTAINERS: Drop stale F: from "TCI TCG target" Markus Armbruster
2026-05-21  9:50   ` Stefan Weil via qemu development
2026-05-21  8:05 ` [PATCH 35/39] MAINTAINERS: Drop stale F: from "Linux io_uring" Markus Armbruster
2026-05-21 14:56   ` Stefan Hajnoczi
2026-05-21  8:05 ` [PATCH 36/39] MAINTAINERS: Fix F: in "VFIO-USER" Markus Armbruster
2026-05-21  8:19   ` Cédric Le Goater
2026-05-26  9:08   ` John Levon
2026-05-21  8:05 ` [PATCH 37/39] MAINTAINERS: Fix F: in "Build and test automation" Markus Armbruster
2026-05-22 21:15   ` Pierrick Bouvier
2026-05-21  8:05 ` [PATCH 38/39] MAINTAINERS: Drop stale F: from "Sphinx documentation configuration ..." Markus Armbruster
2026-05-21  8:05 ` [PATCH 39/39] MAINTAINERS: Fix F: in "Rust build system integration" Markus Armbruster
2026-05-21  8:13   ` Manos Pitsidianakis
2026-05-22 20:18 ` [PATCH 00/39] MAINTAINERS: Fix F: lines Pierrick Bouvier
2026-06-01 10:06   ` Markus Armbruster
2026-06-01 19:03     ` Pierrick Bouvier
2026-06-02  7:00       ` Markus Armbruster [this message]
2026-06-02 15:35         ` Pierrick Bouvier
2026-06-02 17:08           ` Markus Armbruster

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-all 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=87wlwh77gv.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=cleber@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.