Bug 2316067

Summary: Bootstrapping perl warns: Ignoring invalid regex .*/usr/share/doc|.*%{perl_archlib}/.*\.pl$|.*%{perl_privlib}/.*\.pl$
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: perlAssignee: Jitka Plesnikova <jplesnik>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: iarnell, jplesnik, kasal, mmaslano, mspacek, perl-devel, ppisar, psabata, rhughes, spotrh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-10-08 12:52:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Pisar 2024-10-02 08:20:00 UTC
When bootstrapping perl, rpmbuild warns on building perl.spec:

Processing files: perl-interpreter-5.40.0-512.fc42.x86_64
warning: Ignoring invalid regex .*/usr/share/doc|.*%{perl_archlib}/.*\.pl$|.*%{perl_privlib}/.*\.pl$
Provides: perl-interpreter = 4:5.40.0-512.fc42 perl-interpreter(x86-64) = 4:5.40.0-512.fc42

The cause is that perl_archlib and perl_privlib macros are undefined because perl-macros package does not exist until perl.spec is built.

The macros are used at line 16 of perl.spec:

%global __provides_exclude_from .*%{_docdir}|.*%{perl_archlib}/.*\\.pl$|.*%{perl_privlib}/.*\\.pl$

Comment 1 Jitka Plesnikova 2024-10-02 14:39:32 UTC
It has been happening since perl.spec using pregenerated dependencies on bootstrapping [1] instead of perl-generators, which requires perl-macros.
It was done as one of changes related to 'Removing Perl from Build Root' [2]

[1] https://src.fedoraproject.org/rpms/perl/c/c1d0a9658155c0f512faad7b54e20e00f3d682e3
[2] https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl

Comment 2 Jitka Plesnikova 2024-10-03 07:37:13 UTC
There are two way how to solve it

1) Check if %{perl_archlib} is defined. If not then it means that perl-macros and perl-generators are not installed. 
   In that case, no Perl dependencies will be generated.
   So we can set %__provides_exclude_from only to .*%{_docdir}

2) When %perl_bootstrap is defined, set %__provides_exclude_from only to .*%{_docdir}. 
   It could cause issue describe in BZ#924938 when somebody rebuild perl on system with installed perl-generators.

For me, the first option is better.

Comment 3 Petr Pisar 2024-10-03 08:05:45 UTC
Or there is a third way:

3) Use %{privlib} and %{archlib} macros in the definition of __provides_exclude_from.
   That would require more shuffling in the spec because the macros are defined later.

From your two options, the first one seems better.

Comment 4 Jitka Plesnikova 2024-10-08 12:52:42 UTC
commit 1b8ff5b6041c5465a6c0c0b15dfd91223d447966 (HEAD -> rawhide, origin/rawhide, origin/main, origin/f41, origin/HEAD, f41)
Author: Jitka Plesnikova <jplesnik>
Date:   Tue Oct 8 14:25:46 2024 +0200

    Use Perl specific macros when they are defined
    
    When bootstrapping perl, the perl_archlib and perl_privlib macros are
    undefined because perl-macros package does not exist.
    
    Resolves: rhzb#2316067