Improve dependency detection in cpanspec
I ran the current cpanspec on about 20% of the modules (from perl-ACH to perl-Data-Munge) in devel:languages:perl, looked if the changes are expected and committed them to a local git repository.
Now I can make changes to cpanspec and run it on all of those modules to ensure there are no unexpected changes.
I made progress with the dependency handling.
Now the script is reading META.json first.
If META.json is missing or didn't contain any prereqs, META.yml is read and checked for prereqs.
If prereqs have been identified and
dynamic_config is false, the step to execute Makefile.PL is skipped.
Also refactored a bit and moved things into subroutines.
Still running the last tests but it looks good.
The next step would be to check the
license field, and maybe improve the
abstract handling (
abstract is a required field in
META.json, so we can skip reading it from POD in this case).
I ran some more tests and fixed some minor bugs, and also stumbled over a bug related to
Data::Rand::Obscure has this Build.PL:
. has been removed from
@INC, what happened with the current cpanspec version is that cpanspec's root path was added to
@INC, so it loaded cpanspec's own Makefile.PL instead of the module's one, which lead to the following Require entries https://build.opensuse.org/package/view_file/devel:languages:perl/perl-Data-Rand-Obscure/perl-Data-Rand-Obscure.spec?expand=1:
BuildRequires: perl-macros BuildRequires: perl(Archive::Tar) BuildRequires: perl(Archive::Zip) BuildRequires: perl(Carp::Clan) BuildRequires: perl(IO::Uncompress::Bunzip2) BuildRequires: perl(LWP::UserAgent) BuildRequires: perl(Module::Build) BuildRequires: perl(Object::Tiny) BuildRequires: perl(Parse::CPAN::Packages) BuildRequires: perl(Pod::Simple::TextContent) BuildRequires: perl(Text::Autoformat) BuildRequires: perl(YAML) Requires: perl(Archive::Tar) Requires: perl(Archive::Zip) Requires: perl(Carp::Clan) Requires: perl(IO::Uncompress::Bunzip2) Requires: perl(LWP::UserAgent) Requires: perl(Object::Tiny) Requires: perl(Parse::CPAN::Packages) Requires: perl(Pod::Simple::TextContent) Requires: perl(Text::Autoformat) Requires: perl(YAML)
My new version moved the code around and didn't put the cpanspec root path to
@INC anymore, so I stumbled upon this.
I cleaned up the new code a bit, added a debug mode.
Also I added parseable statistics output (YAML :). With this we can parse the logs of the automatic CPAN-* and d:l:p updates.
This will give us easy access to the meta data of the newest releases.
The new code is also a bit faster (if running Makefile.PL/etc. and/or PPI parsing can be skipped, which is more likely the case for newer modules/releases).
A quick benchmark for 50 modules in d:l:p: 12m5.787s (old) vs. 9m20.203s (new).
I will create an extra ticket for the license improvements, and the statistic data that has been collected until then can be used.
I will run this branch on the autoupdate host for a few days and monitor, and if it looks fine, make a PR.
- Due date changed from 2021-04-23 to 2021-04-30
Moving due date.
Running the current code on a significant amount of packages and comparing results of each package to filter out existing problems or packages that should be left alone took a bit longer than originally expected.