mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
@ 2026-10-30 15:43 Oleg Nesterov
  2026-10-30 16:07 ` Joe Perches
  2026-10-30 16:29 ` [PATCH v2] " Oleg Nesterov
  0 siblings, 2 replies; 13+ messages in thread
From: Oleg Nesterov @ 2026-10-30 15:43 UTC (permalink / raw)
  To: Joe Perches, Sasha Levin, Andrew Morton; +Cc: linux-kernel

After commit 09d8b39563e8 ("get_maintainer: add --json output mode"),
I can no longer use get_maintainer.pl; it fails at compile time if
JSON::PP is not installed even when --json is not requested.

This module is only needed with the --json option. Use "require" to
load this module dynamically inside the "if ($json)" block instead.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 scripts/get_maintainer.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 16b80a700d4a..8239c8ca0fce 100755
--- 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;
     my $json_encoder = JSON::PP->new->canonical->utf8;
     print($json_encoder->encode(\%result) . "\n");
 } else {
-- 
2.55.0



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

* Re: [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
  2026-10-30 15:43 [PATCH] get_maintainer: lazy load JSON::PP only when --json is used Oleg Nesterov
@ 2026-10-30 16:07 ` Joe Perches
  2026-10-30 16:17   ` Oleg Nesterov
  2026-10-30 16:29 ` [PATCH v2] " Oleg Nesterov
  1 sibling, 1 reply; 13+ messages in thread
From: Joe Perches @ 2026-10-30 16:07 UTC (permalink / raw)
  To: Oleg Nesterov, Sasha Levin, Andrew Morton; +Cc: linux-kernel

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.

> if JSON::PP is not installed even when --json is not requested.

What version of perl are you using?

I believe JSON is bundled since perl 5.14

> 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.

> 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) {

>      my $json_encoder = JSON::PP->new->canonical->utf8;
>      print($json_encoder->encode(\%result) . "\n");
>  } else {
> 
> ```

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

* Re: [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
  2026-10-30 16:07 ` Joe Perches
@ 2026-10-30 16:17   ` Oleg Nesterov
  2026-10-30 16:32     ` Joe Perches
  0 siblings, 1 reply; 13+ messages in thread
From: Oleg Nesterov @ 2026-10-30 16:17 UTC (permalink / raw)
  To: Joe Perches; +Cc: Sasha Levin, Andrew Morton, linux-kernel

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

> > 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.

> > 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 ?

Oleg.


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

* [PATCH v2] get_maintainer: lazy load JSON::PP only when --json is used
  2026-10-30 15:43 [PATCH] get_maintainer: lazy load JSON::PP only when --json is used Oleg Nesterov
  2026-10-30 16:07 ` Joe Perches
@ 2026-10-30 16:29 ` Oleg Nesterov
  1 sibling, 0 replies; 13+ messages in thread
From: Oleg Nesterov @ 2026-10-30 16:29 UTC (permalink / raw)
  To: Joe Perches, Sasha Levin, Andrew Morton; +Cc: linux-kernel

After commit 09d8b39563e8 ("get_maintainer: add --json output mode"),
I can no longer use get_maintainer.pl; it fails at compile time if
JSON::PP is not installed even when --json is not requested.

This module is only needed with the --json option. Use "require" to
load this module dynamically inside the "if ($json)" block instead.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 scripts/get_maintainer.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 16b80a700d4a..b31b4016802f 100755
--- 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 = "./";
@@ -663,6 +662,8 @@ my @maintainers = get_maintainers();
 @bug = uniq(@bug) if ($bug);
 
 if ($json) {
+    require JSON::PP;
+
     my @json_maintainers;
     for my $m (@maintainers) {
 	my ($addr, $role);
-- 
2.55.0



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

* Re: [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
  2026-10-30 16:17   ` Oleg Nesterov
@ 2026-10-30 16:32     ` Joe Perches
  2026-10-30 21:44       ` Oleg Nesterov
  0 siblings, 1 reply; 13+ messages in thread
From: Joe Perches @ 2026-10-30 16:32 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Sasha Levin, Andrew Morton, linux-kernel

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";
}

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

* Re: [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
  2026-10-30 16:32     ` Joe Perches
@ 2026-10-30 21:44       ` Oleg Nesterov
  2026-10-30 22:18         ` Sasha Levin
  2026-10-30 22:19         ` Joe Perches
  0 siblings, 2 replies; 13+ messages in thread
From: Oleg Nesterov @ 2026-10-30 21:44 UTC (permalink / raw)
  To: Joe Perches; +Cc: Sasha Levin, Andrew Morton, linux-kernel

On 10/30, Joe Perches wrote:
>
> On Fri, 2026-10-30 at 17:17 +0100, Oleg Nesterov wrote:
> > On 10/30, Joe Perches wrote:
> > > > 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?

Hmm. I am not sure I understand you concerns. Let me add more details.
So, I think this patch makes no difference if JSON::PP is installed.
Do you agree?

Now lets see what happens on my machine where JSON::PP is NOT installed.
Without --json:

Before this patch:

	$ ./scripts/get_maintainer.pl ./scripts/get_maintainer.pl
	Can't locate JSON/PP.pm in @INC (you may need to install the JSON::PP module) (@INC entries checked: /usr/local/lib64/perl5/5.42 /usr/local/share/perl5/5.42 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./scripts/get_maintainer.pl line 24.
	BEGIN failed--compilation aborted at ./scripts/get_maintainer.pl line 24.

After:

	$ ./scripts/get_maintainer.pl ./scripts/get_maintainer.pl
	Joe Perches <joe@perches.com> (maintainer:GET_MAINTAINER SCRIPT)
	linux-kernel@vger.kernel.org (open list)

With --json:

Before this patch:

	$ ./scripts/get_maintainer.pl --json ./scripts/get_maintainer.pl
	Can't locate JSON/PP.pm in @INC (you may need to install the JSON::PP module) (@INC entries checked: /usr/local/lib64/perl5/5.42 /usr/local/share/perl5/5.42 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./scripts/get_maintainer.pl line 24.
	BEGIN failed--compilation aborted at ./scripts/get_maintainer.pl line 24.

After:

	$ ./scripts/get_maintainer.pl --json ./scripts/get_maintainer.pl
	Can't locate JSON/PP.pm in @INC (you may need to install the JSON::PP module) (@INC entries checked: /usr/local/lib64/perl5/5.42 /usr/local/share/perl5/5.42 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./scripts/get_maintainer.pl line 665.

Same failure. Sorry, I don't understand what is not clear for you :(

> 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";
> }

But why? Why make get_maintainer.pl depend on yet another module?
FYI, on my Fedora 44

	$ perl -we 'use Module::Load::Conditional qw(check_install);'
	Can't locate Module/Load/Conditional.pm in @INC (you may need to install the Module::Load::Conditional module) (@INC entries checked: /usr/local/lib64/perl5/5.42 /usr/local/share/perl5/5.42 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at -e line 1.
	BEGIN failed--compilation aborted at -e line 1.

And for what ???

If we want to "improve" the errmsg, we can use "eval { require JSON::PP; }; die ... if $@"
but this looks absolutely pointless to me.


Let me repeat. If JSON::PP is not installed, then get_maintainer.pl
with --json:

	fails the same way before or after this patch, I see nothing to improve.

without --json:

	fails before this patch, works after this patch


Sorry, I really can't understand your concerns.

Oleg.


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

* Re: [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
  2026-10-30 21:44       ` Oleg Nesterov
@ 2026-10-30 22:18         ` Sasha Levin
  2026-10-30 22:19         ` Joe Perches
  1 sibling, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2026-10-30 22:18 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Joe Perches, Andrew Morton, linux-kernel

On Fri, Oct 30, 2026 at 10:44:03PM +0100, Oleg Nesterov wrote:
>On 10/30, Joe Perches wrote:
>> 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";
>> }
>
>But why? Why make get_maintainer.pl depend on yet another module?
>FYI, on my Fedora 44
>
>	$ perl -we 'use Module::Load::Conditional qw(check_install);'
>	Can't locate Module/Load/Conditional.pm in @INC (you may need to install the Module::Load::Conditional module) (@INC entries checked: /usr/local/lib64/perl5/5.42 /usr/local/share/perl5/5.42 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at -e line 1.
>	BEGIN failed--compilation aborted at -e line 1.
>
>And for what ???
>
>If we want to "improve" the errmsg, we can use "eval { require JSON::PP; }; die ... if $@"
>but this looks absolutely pointless to me.
>
>
>Let me repeat. If JSON::PP is not installed, then get_maintainer.pl
>with --json:
>
>	fails the same way before or after this patch, I see nothing to improve.
>
>without --json:
>
>	fails before this patch, works after this patch
>
>
>Sorry, I really can't understand your concerns.

I think that Oleg's change makes sense. The only reason I originally relied on
JSON::PP was because I was under the impression that it falls under the "pure
perl code" guidelines and gets autoinstalled with perl.

-- 
Thanks,
Sasha

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

* Re: [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
  2026-10-30 21:44       ` Oleg Nesterov
  2026-10-30 22:18         ` Sasha Levin
@ 2026-10-30 22:19         ` Joe Perches
  2026-10-30 22:55           ` Oleg Nesterov
  1 sibling, 1 reply; 13+ messages in thread
From: Joe Perches @ 2026-10-30 22:19 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Sasha Levin, Andrew Morton, linux-kernel

On Fri, 2026-10-30 at 22:44 +0100, Oleg Nesterov wrote:
> On 10/30, Joe Perches wrote:
> > On Fri, 2026-10-30 at 17:17 +0100, Oleg Nesterov wrote:
> > > > > 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?
> Hmm. I am not sure I understand you concerns. Let me add more details.
> So, I think this patch makes no difference if JSON::PP is installed.
> Do you agree?
> 
> Now lets see what happens on my machine where JSON::PP is NOT installed.
> Without --json:
> 
> Before this patch:
> 
> 	$ ./scripts/get_maintainer.pl ./scripts/get_maintainer.pl
> 	Can't locate JSON/PP.pm in @INC (you may need to install the JSON::PP module) (@INC entries checked: /usr/local/lib64/perl5/5.42 /usr/local/share/perl5/5.42 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./scripts/get_maintainer.pl line 24.
> 	BEGIN failed--compilation aborted at ./scripts/get_maintainer.pl line 24.
> 
> After:
> 
> 	$ ./scripts/get_maintainer.pl ./scripts/get_maintainer.pl
> 	Joe Perches <[joe@perches.com](mailto:joe@perches.com)> (maintainer:GET_MAINTAINER SCRIPT)
> 	[linux-kernel@vger.kernel.org](mailto:linux-kernel@vger.kernel.org) (open list)
> 
> With --json:
> 
> Before this patch:
> 
> 	$ ./scripts/get_maintainer.pl --json ./scripts/get_maintainer.pl
> 	Can't locate JSON/PP.pm in @INC (you may need to install the JSON::PP module) (@INC entries checked: /usr/local/lib64/perl5/5.42 /usr/local/share/perl5/5.42 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./scripts/get_maintainer.pl line 24.
> 	BEGIN failed--compilation aborted at ./scripts/get_maintainer.pl line 24.
> 
> After:
> 
> 	$ ./scripts/get_maintainer.pl --json ./scripts/get_maintainer.pl
> 	Can't locate JSON/PP.pm in @INC (you may need to install the JSON::PP module) (@INC entries checked: /usr/local/lib64/perl5/5.42 /usr/local/share/perl5/5.42 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./scripts/get_maintainer.pl line 665.
> 
> Same failure. Sorry, I don't understand what is not clear for you :(
> 
> 
> > 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";
> > }
> 
> But why? Why make get_maintainer.pl depend on yet another module?
> FYI, on my Fedora 44
> 
> 	$ perl -we 'use Module::Load::Conditional qw(check_install);'
> 	Can't locate Module/Load/Conditional.pm in @INC (you may need to install the Module::Load::Conditional module) (@INC entries checked: /usr/local/lib64/perl5/5.42 /usr/local/share/perl5/5.42 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at -e line 1.
> 	BEGIN failed--compilation aborted at -e line 1.

Module::Load is a core perl module since 5.10 and

I think you are using a broken version of a perl installation
and I think you should:

$ sudo dnf install perl-core

> And for what ???

My idea is to make it more obvious _why_ something fails
and not like get_maintainer itself is broken.

> If we want to "improve" the errmsg, we can use "eval { require JSON::PP; }; die ... if $@"
> but this looks absolutely pointless to me.

We disagree.  I prefer output errors to look less broken.

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

* Re: [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
  2026-10-30 22:19         ` Joe Perches
@ 2026-10-30 22:55           ` Oleg Nesterov
  2026-10-30 23:17             ` Joe Perches
  0 siblings, 1 reply; 13+ messages in thread
From: Oleg Nesterov @ 2026-10-30 22:55 UTC (permalink / raw)
  To: Joe Perches; +Cc: Sasha Levin, Andrew Morton, linux-kernel

On 10/30, Joe Perches wrote:
>
> On Fri, 2026-10-30 at 22:44 +0100, Oleg Nesterov wrote:
> >
> > > 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";
> > > }
> >
> > But why? Why make get_maintainer.pl depend on yet another module?
> > FYI, on my Fedora 44
> >
> > 	$ perl -we 'use Module::Load::Conditional qw(check_install);'
> > 	Can't locate Module/Load/Conditional.pm in @INC (you may need to install the Module::Load::Conditional module) (@INC entries checked: /usr/local/lib64/perl5/5.42 /usr/local/share/perl5/5.42 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at -e line 1.
> > 	BEGIN failed--compilation aborted at -e line 1.
>
> Module::Load is a core perl module since 5.10 and
>
> I think you are using a broken version of a perl installation

And how do you think it is broken? my laptop runs the fresh Fedora 44.

I used ./scripts/get_maintainer.pl many years, almost every day, and I never
needed to install the additional modules. Until ("get_maintainer: add --json
output mode")

> and I think you should:
>
> $ sudo dnf install perl-core

Oh. I LOVE perl. Damn I still consider myself as a perl programmer ;)

But why do you think I should install the additional modules (which I will
never use) on my machine???

Again, again, again. AFAICS, this patch makes no difference if JSON::PP
is installed. Please correct me.

It just allows to use get_maintainer.pl without --json in the case when
JSON::PP is NOT installed. This is the ONLY difference afaics.

> > And for what ???
>
> My idea is to make it more obvious _why_ something fails
> and not like get_maintainer itself is broken.

Good idea! But again, again, again, if JSON::PP is not installed, then the
failure message is the same with or without my patch. Just get_maintainer.pl
does NOT fail without --json.

Although to be honest "Can't locate JSON/PP.pm ..." looks very clear to me,
but you can make it more obvious with or without my patch.

> > If we want to "improve" the errmsg, we can use "eval { require JSON::PP; }; die ... if $@"
> > but this looks absolutely pointless to me.
>
> We disagree.  I prefer output errors to look less broken.

less broken than what? see above.

It's not that we disagree... Worse, we can't understand each other :(
Perhaps is this my fault.

Oleg.


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

* Re: [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
  2026-10-30 22:55           ` Oleg Nesterov
@ 2026-10-30 23:17             ` Joe Perches
  2026-10-30 23:35               ` Oleg Nesterov
  0 siblings, 1 reply; 13+ messages in thread
From: Joe Perches @ 2026-10-30 23:17 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Sasha Levin, Andrew Morton, linux-kernel

On Fri, 2026-10-30 at 23:55 +0100, Oleg Nesterov wrote:
> On 10/30, Joe Perches wrote:
> > On Fri, 2026-10-30 at 22:44 +0100, Oleg Nesterov wrote:
> 
> 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";
> > > > }
> > > 
> > > But why? Why make get_maintainer.pl depend on yet another module?
> > > FYI, on my Fedora 44
> > > 
> 	$ perl -we 'use Module::Load::Conditional qw(check_install);'
> 	Can't locate Module/Load/Conditional.pm in @INC (you may need to install the Module::Load::Conditional module) (@INC entries checked: /usr/local/lib64/perl5/5.42 /usr/local/share/perl5/5.42 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at -e line 1.
> 	BEGIN failed--compilation aborted at -e line 1.
> > 
> > Module::Load is a core perl module since 5.10 and
> > I think you are using a broken version of a perl installation
> And how do you think it is broken? my laptop runs the fresh Fedora 44.

It doesn't include perl-core ;)

> I used ./scripts/get_maintainer.pl many years, almost every day, and I never
> needed to install the additional modules. Until ("get_maintainer: add --json
> output mode")

I think that was added in Linus' 7.2 in mid August and in -next since April

> > and I think you should:
> > 
> > $ sudo dnf install perl-core
> 
> Oh. I LOVE perl. Damn I still consider myself as a perl programmer ;)

:) I don't consider myself one...

> But why do you think I should install the additional modules (which I will
> never use) on my machine???

Just like you have to add development-tools to that install.

> Again, again, again. AFAICS, this patch makes no difference if JSON::PP
> is installed. Please correct me.

Why?  You're not wrong.

> It just allows to use get_maintainer.pl without --json in the case when
> JSON::PP is NOT installed. This is the ONLY difference afaics.
> > > And for what ???
> > My idea is to make it more obvious _why_ something fails
> > and not like get_maintainer itself is broken.
> Good idea! But again, again, again, if JSON::PP is not installed, then the
> failure message is the same with or without my patch. Just get_maintainer.pl
> does NOT fail without --json.
> 
> Although to be honest "Can't locate JSON/PP.pm ..." looks very clear to me,
> but you can make it more obvious with or without my patch.
> > > If we want to "improve" the errmsg, we can use "eval { require JSON::PP; }; die ... if $@"
> > > but this looks absolutely pointless to me.
> > We disagree.  I prefer output errors to look less broken.
> less broken than what? see above.
> 
> It's not that we disagree... Worse, we can't understand each other :(
> Perhaps is this my fault.

I don't disagree with the concept of the patch.

I think we understand each other fine, you just care less about the
output error message.  What gets output now is from perl and I think
it looks less like get_maintainer is working properly.

cheers, Joe

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

* Re: [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
  2026-10-30 23:17             ` Joe Perches
@ 2026-10-30 23:35               ` Oleg Nesterov
  2026-10-30 23:54                 ` Joe Perches
  0 siblings, 1 reply; 13+ messages in thread
From: Oleg Nesterov @ 2026-10-30 23:35 UTC (permalink / raw)
  To: Joe Perches; +Cc: Sasha Levin, Andrew Morton, linux-kernel

On 10/30, Joe Perches wrote:
>
> On Fri, 2026-10-30 at 23:55 +0100, Oleg Nesterov wrote:
> > > >
> > > > But why? Why make get_maintainer.pl depend on yet another module?
> > > > FYI, on my Fedora 44
> > > >
> > 	$ perl -we 'use Module::Load::Conditional qw(check_install);'
> > 	Can't locate Module/Load/Conditional.pm in @INC (you may need to install the Module::Load::Conditional module) (@INC entries checked: /usr/local/lib64/perl5/5.42 /usr/local/share/perl5/5.42 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at -e line 1.
> > 	BEGIN failed--compilation aborted at -e line 1.
> > >
> > > Module::Load is a core perl module since 5.10 and
> > > I think you are using a broken version of a perl installation
> > And how do you think it is broken? my laptop runs the fresh Fedora 44.
>
> It doesn't include perl-core ;)

you can blame the Fedora maintainers, not me ;)

> > I used ./scripts/get_maintainer.pl many years, almost every day, and I never
> > needed to install the additional modules. Until ("get_maintainer: add --json
> > output mode")
>
> I think that was added in Linus' 7.2 in mid August and in -next since April

Yes, I hit this problem months ago, but didn't have time to send the fix.
So I had to have "git revert 09d8b39563e84fc245d642182715a7e0e024b0f2" in my
local trees until today.

> > It's not that we disagree... Worse, we can't understand each other :(
> > Perhaps is this my fault.
>
> I don't disagree with the concept of the patch.

Great, then perhaps you can ACK my trivial patch? Then we can discuss
the possible improvements.

> I think we understand each other fine, you just care less about the
> output error message.

Yes, it is true in that I don't really care about the output error message.

But then again. This error message can only happen if JSON::PP is not
installed, and my patch doesn't make it worse?

Oleg.


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

* Re: [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
  2026-10-30 23:35               ` Oleg Nesterov
@ 2026-10-30 23:54                 ` Joe Perches
  2026-10-31  0:11                   ` Oleg Nesterov
  0 siblings, 1 reply; 13+ messages in thread
From: Joe Perches @ 2026-10-30 23:54 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Sasha Levin, Andrew Morton, linux-kernel

On Sat, 2026-10-31 at 00:35 +0100, Oleg Nesterov wrote:
> On 10/30, Joe Perches wrote:
> > On Fri, 2026-10-30 at 23:55 +0100, Oleg Nesterov wrote:
> > > > > But why? Why make get_maintainer.pl depend on yet another module?
> > > > > FYI, on my Fedora 44
[]
> > > > Module::Load is a core perl module since 5.10 and
> > > > I think you are using a broken version of a perl installation
> 
> > > And how do you think it is broken? my laptop runs the fresh Fedora 44.
> > It doesn't include perl-core ;)
> 
> you can blame the Fedora maintainers, not me ;)

<smile>

That'd be the same as blaming the Fedora maintainers
for not including development-tools by default.

> > > I used ./scripts/get_maintainer.pl many years, almost every day, and I never
> > > needed to install the additional modules. Until ("get_maintainer: add --json
> > > output mode")
> > 
> > I think that was added in Linus' 7.2 in mid August and in -next since April
> 
> Yes, I hit this problem months ago, but didn't have time to send the fix.

Nor apparently have time to send an email to the get_maintainer
maintainer about it either.

> > I don't disagree with the concept of the patch.
> Great, then perhaps you can ACK my trivial patch? Then we can discuss
> the possible improvements.

Maybe when it's done without needing updates.
In the meantime, you have an easy workaround with dnf install perl-core.

> > I think we understand each other fine, you just care less about the
> > output error message.
> 
> Yes, it is true in that I don't really care about the output error message.
> 
> But then again. This error message can only happen if JSON::PP is not
> installed, and my patch doesn't make it worse?


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

* Re: [PATCH] get_maintainer: lazy load JSON::PP only when --json is used
  2026-10-30 23:54                 ` Joe Perches
@ 2026-10-31  0:11                   ` Oleg Nesterov
  0 siblings, 0 replies; 13+ messages in thread
From: Oleg Nesterov @ 2026-10-31  0:11 UTC (permalink / raw)
  To: Joe Perches; +Cc: Sasha Levin, Andrew Morton, linux-kernel

On 10/30, Joe Perches wrote:
>
> On Sat, 2026-10-31 at 00:35 +0100, Oleg Nesterov wrote:
> > On 10/30, Joe Perches wrote:
> > >
> > > I think that was added in Linus' 7.2 in mid August and in -next since April
> >
> > Yes, I hit this problem months ago, but didn't have time to send the fix.
>
> Nor apparently have time to send an email to the get_maintainer
> maintainer about it either.

No. I knew that this problem is trivial and I can send the trivial fix
when I have time to check the code and write the changelog.

> > Great, then perhaps you can ACK my trivial patch? Then we can discuss
> > the possible improvements.
>
> Maybe when it's done without needing updates.

Sorry, I don't understand...

> In the meantime, you have an easy workaround with dnf install perl-core.

Sure. Or I guess I can install perl-JSON-PP.noarch... most probably this
is the necessary module.

OK. So in essence you NACK this change. OK, maintainer is always right.
I won't argue even if I don't understand why you dislike this trivial change.
Afaics it can't make any regression, it just allows to continue to use
get_maintainer.pl without JSON::PP, as it was always possible.

Oleg.


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

end of thread, other threads:[~2026-10-31  0:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-30 15:43 [PATCH] get_maintainer: lazy load JSON::PP only when --json is used Oleg Nesterov
2026-10-30 16:07 ` Joe Perches
2026-10-30 16:17   ` Oleg Nesterov
2026-10-30 16:32     ` Joe Perches
2026-10-30 21:44       ` Oleg Nesterov
2026-10-30 22:18         ` Sasha Levin
2026-10-30 22:19         ` Joe Perches
2026-10-30 22:55           ` Oleg Nesterov
2026-10-30 23:17             ` Joe Perches
2026-10-30 23:35               ` Oleg Nesterov
2026-10-30 23:54                 ` Joe Perches
2026-10-31  0:11                   ` Oleg Nesterov
2026-10-30 16:29 ` [PATCH v2] " Oleg Nesterov

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®