Bug 2029995 - perl.req: use keywords not found on BEGIN { lines
Summary: perl.req: use keywords not found on BEGIN { lines
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-generators
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jitka Plesnikova
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2119130
TreeView+ depends on / blocked
 
Reported: 2021-12-07 18:46 UTC by noatsecure
Modified: 2022-08-17 15:53 UTC (History)
16 users (show)

Fixed In Version: perl-generators-1.14-1.fc38 perl-generators-1.14-1.fc37
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2119130 (view as bug list)
Environment:
Last Closed: 2022-08-17 14:32:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
proposed fix including test cases (4.56 KB, patch)
2022-07-24 18:45 UTC, Charles R. Anderson
no flags Details | Diff

Description noatsecure 2021-12-07 18:46:44 UTC
Description of problem: The package should include the 'perl-base' package as a required dependency, not a weak one. If weak dependencies are not enabled, then a perl error message will appear when trying to launch the program in a terminal.


Version-Release number of selected component (if applicable): kpcli.noarch 3.6-5.fc35


How reproducible: Every time


Steps to Reproduce:
1. Install the package, "# dnf install kpcli --setopt=install_weak_deps=False"
2. Launch kpcli in a terminal emulator

Actual results:

"Can't locate base.pm in @INC (you may need to install the base module) (@INC contains: /usr/local/lib64/perl5/5.34 /usr/local/share/perl5/5.34 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /usr/share/perl5/Module/Loaded.pm line 6.
BEGIN failed--compilation aborted at /usr/share/perl5/Module/Loaded.pm line 6.
Compilation failed in require at /usr/bin/kpcli line 45.
BEGIN failed--compilation aborted at /usr/bin/kpcli line 45."


Expected results: The application does not show any errors


Additional info: The 'perl-base' package needs to be a required dependency

Comment 1 Charles R. Anderson 2022-07-24 15:18:19 UTC
Reassigned to perl:

"BEGIN failed--compilation aborted at /usr/share/perl5/Module/Loaded.pm line 6."

"package Module::Loaded;

use strict;
use Carp qw[carp];

BEGIN { use base 'Exporter';"

>rpm -qf --qf='%{sourcerpm}\n' /usr/share/perl5/Module/Loaded.pm
perl-5.34.1-486.fc35.src.rpm

>rpm -q --requires perl | grep base
[no output]

Comment 2 Charles R. Anderson 2022-07-24 15:25:42 UTC
More importantly, perl's subpackage perl-Module-Loaded is missing the "Requires: perl(base)":

>rpm -q --requires perl-Module-Loaded | grep base
[no output]

Comment 3 Charles R. Anderson 2022-07-24 16:05:08 UTC
This is actually a bug in the perl-generators perl.req script:

>/usr/lib/rpm/perl.req ~/src/fedora/git/perl/perl-5.36.0/cpan/Module-Loaded/lib/Module/Loaded.pm
perl(Carp)
perl(strict)
perl(vars)

If you add a newline before the 'use base' line in Loaded.pm, it works correctly:

>diff -ub Loaded.pm~ Loaded.pm
--- Loaded.pm~	2022-07-24 11:46:54.711678673 -0400
+++ Loaded.pm	2022-07-24 11:59:00.149220316 -0400
@@ -3,7 +3,8 @@
 use strict;
 use Carp qw[carp];
 
-BEGIN { use base 'Exporter';
+BEGIN {
+        use base 'Exporter';
         use vars qw[@EXPORT $VERSION];
 
         $VERSION = '0.08';


>/usr/lib/rpm/perl.req Loaded.pm
perl(Carp)
perl(Exporter)
perl(base)
perl(strict)
perl(vars)

Comment 4 Charles R. Anderson 2022-07-24 18:45:53 UTC
Created attachment 1899053 [details]
proposed fix including test cases

Comment 5 Jitka Plesnikova 2022-08-16 16:31:05 UTC
Thanks for the report, I'll look at it.


Note You need to log in before you can comment on or make changes to this bug.