From: Joe Perches <joe@perches.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Sasha Levin <sashal@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
Date: Fri, 30 Oct 2026 09:32:09 -0700 [thread overview]
Message-ID: <1ad2ae74e3257578cac561f19af63ccb94fce85a.camel@perches.com> (raw)
In-Reply-To: <auTDEy_vyMixVRTU@redhat.com>
On Fri, 2026-10-30 at 17:17 +0100, Oleg Nesterov wrote:
> On 10/30, Joe Perches wrote:
> > On Fri, 2026-10-30 at 16:43 +0100, Oleg Nesterov wrote:
> After commit 09d8b39563e8 ("get_maintainer: add --json output mode"),
> > > I can no longer use get_maintainer.pl; it fails at compile time
> >
> > Just verifying that you mean when using perl directly and
> > not something like perlcc.
>
> Yes,
>
> > > if JSON::PP is not installed even when --json is not requested.
> > What version of perl are you using?
> v5.42.3
> > I believe JSON is bundled since perl 5.14
> Well, JSON::PP is not installed on my Fedora release 44
Hmm. Odd.
> > > This module is only needed with the --json option. Use "require" to
> > > load this module dynamically inside the "if ($json)" block instead.
> > The patch may be sensible but could fail the same way
> > if you used the --json option with your version.
>
> Of course, "./scripts/get_maintainer.pl --json ..." will still fail
> the same way without JSON::PP. But with this patch get_maintainer.pl
> works without the --json option.
What does that failure output?
> > > diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
> > []
> > > @@ -21,7 +21,6 @@ use Cwd;
> > > use File::Find;
> > > use File::Spec::Functions;
> > > use open qw(:std :encoding(UTF-8));
> > > -use JSON::PP;
> > >
> > > my $cur_path = fastgetcwd() . '/';
> > > my $lk_path = "./";
> > > @@ -685,6 +684,7 @@ if ($json) {
> > > $result{web} = \@web if ($web);
> > > $result{bug} = \@bug if ($bug);
> > >
> > > + require JSON::PP;
> > style nit:
> > I likely would have placed this require immediately after the
> > if ($json) {
>
> I am fine either way... should I send V2 ?
Dunno. Depending on the current failure output
maybe adding something like the below is better:
use Module::Load::Conditional qw(check_install);
if (!check_install(module => 'JSON:PP')) {
die "$P: --json not available - missing perl module JSON:PP\n";
}
next prev parent reply other threads:[~2026-10-30 16:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 15:43 Oleg Nesterov
2026-10-30 16:07 ` Joe Perches
2026-10-30 16:17 ` Oleg Nesterov
2026-10-30 16:32 ` Joe Perches [this message]
2026-10-30 21:44 ` Oleg Nesterov
2026-10-30 22:18 ` Sasha Levin
2026-10-30 22:19 ` Joe Perches
2026-10-30 16:29 ` [PATCH v2] " Oleg Nesterov
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=1ad2ae74e3257578cac561f19af63ccb94fce85a.camel@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=sashal@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®