Project

General

Profile

Actions

action #108120

open

rpm and cpanspec: Support vx.y versions in perl modules

Added by tinita over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Observation

When a module specifies its version like this:

use version; our $VERSION = qv("v1.3.0");

(e.g. https://metacpan.org/release/EGILES/Test-Compile-v1.3.0/source/lib/Test/Compile.pm)

then the rpm package will get a Provides: perl(Test::Compile) entry without a version.

The script responsible for that is perl.prov:
https://github.com/rpm-software-management/rpm/blob/master/scripts/perl.prov

On the other end cpanspec also doesn't remove the v from the BuildRequires and Requires entries. (Note that it does get removed from the package version,
e.g. we have perl-Test-Compile-3.0.1-28.28.noarch.rpm.)

Problem 1

If a package has Provides: perl(Test::Compile) without a version then a Requires: perl(Test::Compile) >= 999999 will always succeed.

So currently we can't guarantee that our Requires entries are doing what we expect.

Problem 2

cpanspec has to remove the v also because Requires: perl(...) >= vx.y also won't work, even if the Provides entry is correct.

Example

% rpm -q --provides perl-YAML-PP-0.031-lp153.2.1.noarch
perl(YAML::PP) = 0.031    
perl(YAML::PP::Common) = 0.031
perl(YAML::PP::Constructor) = 0.031
perl(YAML::PP::Dumper) = 0.031
perl(YAML::PP::Emitter) = 0.031
perl(YAML::PP::Exception) = 0.031
...
% rpm -q --provides perl-Test-Compile-1.3.0-bp153.1.12.noarch
perl(Test::Compile)
perl(Test::Compile::Internal)
perl-Test-Compile = 1.3.0-bp153.1.12

Suggestions

  • Add parsing versions like qv("v1.3.0"); to perl.prov
  • Alternatively add Provides: entries to the .spec via cpanspec in such cases
  • Fix cpanspec to remove the leading v for (Build)Requires entries

Related issues 1 (0 open1 closed)

Copied from QA - action #92122: Improve dependency detection via MYMETA.json in cpanspecResolvedtinita2021-05-042022-03-17

Actions
Actions #1

Updated by tinita over 2 years ago

  • Copied from action #92122: Improve dependency detection via MYMETA.json in cpanspec added
Actions #2

Updated by tinita over 2 years ago

  • Description updated (diff)
Actions #3

Updated by tinita over 2 years ago

  • Description updated (diff)
Actions #4

Updated by okurz over 2 years ago

As you created a separate ticket I assume you did that so that you can conclude #92122 more easily. So does this need to be in our backlog?

Actions #5

Updated by okurz over 2 years ago

  • Due date deleted (2022-03-17)
  • Target version changed from Ready to future
  • Start date deleted (2021-05-04)

I assume the answer to #/108120#note-4 is no for now.

Actions

Also available in: Atom PDF