Description
Julian Maurice
2017-12-02 08:56:37 UTC
Created attachment 69465 [details] [review] Bug 19735: Script to generate cpanfile (DO NOT PUSH) For testing purposes only Created attachment 69466 [details] [review] Bug 19735: Move Perl deps definitions into a cpanfile cpanfile is a format for describing CPAN dependencies for Perl applications. It is more concise - thus easier to read and maintain - than C4::Installer::PerlDependencies, and allows to describe requirements more accurately (using version ranges or features for instance) Additionally it can be read by tools such as cpanm or carton for an easy way to install dependencies on non-Debian-based systems. For more information on cpanfile, see http://search.cpan.org/~miyagawa/Module-CPANfile-1.1002/lib/cpanfile.pod This patch replace C4::Installer::PerlDependencies by an equivalent cpanfile and update all scripts/modules that were using PerlDependencies It also removes dead code from C4::Installer::PerlModules (some subroutines were not used at all, except in unit tests) Added dependencies: - Module::CPANfile - CPAN::Meta (dependency of Module::CPANfile, but we need a more recent version than the one Module::CPANfile requires) Test plan: 1. Go to About page, tab Perl modules and keep this browser tab open 2. Apply patch 3. Install Module::CPANfile and CPAN::Meta a. On Debian-based systems: # will install libcpan-meta-perl as a dependency sudo apt install libmodule-cpanfile-perl b. Others: # will install CPAN::Meta as a dependency sudo cpanm Module::CPANfile 4. In a new browser tab, go to About page, tab Perl modules and compare the table with the one in the previous browser tab They should be identical, except for newly added dependencies (Module::CPANfile and CPAN::Meta) 5. Do a 'standard' install a. perl Makefile.PL (select 'standard') b. make c. sudo make install d. Configure your database, web server, ... and go through the web install process 6. Verify that the cpanfile got copied into PERL_MODULE_DIR (which should be /usr/share/koha/lib) 7. Go to the about page of this fresh install and compare it with your dev install 8. Verify that debian/list-deps still works This takes a lot of time and it may not be necessary to wait until the end. If you see some Debian package names that correspond to modules in cpanfile, it means it still works (you need apt-file for this script to work) 9. Verify that koha_perl_deps.pl still works 10. prove t/Installer_pm.t t/Installer_PerlModules.t I tried to apply the patch but got a merge conflict with current master and can't test. Sorry :/ Created attachment 73837 [details] [review] Bug 19735: Script to generate cpanfile (DO NOT PUSH) For testing purposes only Created attachment 73838 [details] [review] Bug 19735: Move Perl deps definitions into a cpanfile cpanfile is a format for describing CPAN dependencies for Perl applications. It is more concise - thus easier to read and maintain - than C4::Installer::PerlDependencies, and allows to describe requirements more accurately (using version ranges or features for instance) Additionally it can be read by tools such as cpanm or carton for an easy way to install dependencies on non-Debian-based systems. For more information on cpanfile, see http://search.cpan.org/~miyagawa/Module-CPANfile-1.1002/lib/cpanfile.pod This patch replace C4::Installer::PerlDependencies by an equivalent cpanfile and update all scripts/modules that were using PerlDependencies It also removes dead code from C4::Installer::PerlModules (some subroutines were not used at all, except in unit tests) Added dependencies: - Module::CPANfile - CPAN::Meta (dependency of Module::CPANfile, but we need a more recent version than the one Module::CPANfile requires) Test plan: 1. Go to About page, tab Perl modules and keep this browser tab open 2. Apply patch 3. Install Module::CPANfile and CPAN::Meta a. On Debian-based systems: # will install libcpan-meta-perl as a dependency sudo apt install libmodule-cpanfile-perl b. Others: # will install CPAN::Meta as a dependency sudo cpanm Module::CPANfile 4. In a new browser tab, go to About page, tab Perl modules and compare the table with the one in the previous browser tab They should be identical, except for newly added dependencies (Module::CPANfile and CPAN::Meta) 5. Do a 'standard' install a. perl Makefile.PL (select 'standard') b. make c. sudo make install d. Configure your database, web server, ... and go through the web install process 6. Verify that the cpanfile got copied into PERL_MODULE_DIR (which should be /usr/share/koha/lib) 7. Go to the about page of this fresh install and compare it with your dev install 8. Verify that debian/list-deps still works This takes a lot of time and it may not be necessary to wait until the end. If you see some Debian package names that correspond to modules in cpanfile, it means it still works (you need apt-file for this script to work) 9. Verify that koha_perl_deps.pl still works 10. prove t/Installer_pm.t t/Installer_PerlModules.t Patches rebased on master, cpanfile updated. Can you please rebase your patches, the second patch is currently not applying cleanly on master, as the below output shows: Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 19735: Script to generate cpanfile (DO NOT PUSH) Applying: Bug 19735: Move Perl deps definitions into a cpanfile Using index info to reconstruct a base tree... M C4/Installer.pm M C4/Installer/PerlDependencies.pm M C4/Installer/PerlModules.pm M Makefile.PL M about.pl M debian/list-deps M installer/install.pl Falling back to patching base and 3-way merge... Removing t/Installer_PerlDependencies.t Auto-merging installer/install.pl Auto-merging debian/list-deps Auto-merging about.pl Auto-merging Makefile.PL Auto-merging C4/Installer/PerlModules.pm CONFLICT (content): Merge conflict in C4/Installer/PerlModules.pm CONFLICT (modify/delete): C4/Installer/PerlDependencies.pm deleted in Bug 19735: Move Perl deps definitions into a cpanfile and modified in HEAD. Version HEAD of C4/Installer/PerlDependencies.pm left in tree. Auto-merging C4/Installer.pm Failed to merge in the changes. Patch failed at 0001 Bug 19735: Move Perl deps definitions into a cpanfile The copy of the patch that failed is found in: /home/vagrant/kohaclone/.git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-19735-Move-Perl-deps-definitions-into-a-cpanfi-S1GHo1.patch Not that lots of people run it anymore, but ./koha_perl_deps.pl should probably be tweaked too. Actually going to use this cpanfile now with plenv to do some troubleshooting... (In reply to David Cook from comment #9) > Actually going to use this cpanfile now with plenv to do some > troubleshooting... Or rather I guess I'll install carton with plenv and go from there... I tried running this but I got a few failures: ! Installing the dependencies failed: Module 'DBD::mysql' is not installed, Module 'PDF::API2::Simple' is not installed, Module 'Text::Bidi' is not installed ! Bailing out the installation for /home/dcook/test/. 259 distributions installed Installing modules failed (In reply to David Cook from comment #11) > I tried running this but I got a few failures: > > ! Installing the dependencies failed: Module 'DBD::mysql' is not installed, > Module 'PDF::API2::Simple' is not installed, Module 'Text::Bidi' is not > installed > ! Bailing out the installation for /home/dcook/test/. > 259 distributions installed > Installing modules failed Looking more at DBD::mysql... and it looks like it doesn't like mysql header files for MariaDB. Hmmmmmmm. (In reply to David Cook from comment #12) > (In reply to David Cook from comment #11) > > I tried running this but I got a few failures: > > > > ! Installing the dependencies failed: Module 'DBD::mysql' is not installed, > > Module 'PDF::API2::Simple' is not installed, Module 'Text::Bidi' is not > > installed > > ! Bailing out the installation for /home/dcook/test/. > > 259 distributions installed > > Installing modules failed > > Looking more at DBD::mysql... and it looks like it doesn't like mysql header > files for MariaDB. Hmmmmmmm. Seems like a separate issue... https://github.com/perl5-dbi/DBD-mysql/issues/262 Created attachment 81612 [details] [review] Bug 19735: Move Perl deps definitions into a cpanfile cpanfile is a format for describing CPAN dependencies for Perl applications. It is more concise - thus easier to read and maintain - than C4::Installer::PerlDependencies, and allows to describe requirements more accurately (using version ranges or features for instance) Additionally it can be read by tools such as cpanm or carton for an easy way to install dependencies on non-Debian-based systems. For more information on cpanfile, see http://search.cpan.org/~miyagawa/Module-CPANfile-1.1002/lib/cpanfile.pod This patch replace C4::Installer::PerlDependencies by an equivalent cpanfile and update all scripts/modules that were using PerlDependencies It also removes dead code from C4::Installer::PerlModules (some subroutines were not used at all, except in unit tests) Added dependencies: - Module::CPANfile - CPAN::Meta (dependency of Module::CPANfile, but we need a more recent version than the one Module::CPANfile requires) Test plan: 1. Go to About page, tab Perl modules and keep this browser tab open 2. Apply patch 3. Install Module::CPANfile and CPAN::Meta a. On Debian-based systems: # will install libcpan-meta-perl as a dependency sudo apt install libmodule-cpanfile-perl b. Others: # will install CPAN::Meta as a dependency sudo cpanm Module::CPANfile 4. In a new browser tab, go to About page, tab Perl modules and compare the table with the one in the previous browser tab They should be identical, except for newly added dependencies (Module::CPANfile and CPAN::Meta) 5. Do a 'standard' install a. perl Makefile.PL (select 'standard') b. make c. sudo make install d. Configure your database, web server, ... and go through the web install process 6. Verify that the cpanfile got copied into PERL_MODULE_DIR (which should be /usr/share/koha/lib) 7. Go to the about page of this fresh install and compare it with your dev install 8. Verify that debian/list-deps still works This takes a lot of time and it may not be necessary to wait until the end. If you see some Debian package names that correspond to modules in cpanfile, it means it still works (you need apt-file for this script to work) 9. Verify that koha_perl_deps.pl still works 10. prove t/Installer_pm.t t/Installer_PerlModules.t (In reply to M. Tompsett from comment #8) > Not that lots of people run it anymore, but ./koha_perl_deps.pl should > probably be tweaked too. Testing koha_perl_deps.pl is part of the test plan, but no changes were required to make it work as it was already using C4::Installer::PerlModules Comment on attachment 73837 [details] [review] Bug 19735: Script to generate cpanfile (DO NOT PUSH) Review of attachment 73837 [details] [review]: ----------------------------------------------------------------- ::: misc/devel/generate_cpanfile.pl @@ +14,5 @@ > + $prereqs->{runtime}->{$type}->{$module} = $req->{min_ver}; > +} > + > +$prereqs->{runtime}->{requires}->{'Module::CPANfile'} = '1.1000'; > +$prereqs->{runtime}->{requires}->{'CPAN::Meta'} = '2.150006'; Before testing, I had 2.150005. I didn't follow the test plan (did a cpan2deb), so I'll need to recheck if the sudo apt install updates properly. Whatever for the 1-4 steps. I did the equivalent. It worked. > 5. Do a 'standard' install > a. perl Makefile.PL (select 'standard') > b. make > c. sudo make install > d. Configure your database, web server, ... and go through the web > install process Encountered a bump here, but got through it. I was just accepting defaults mostly. > 6. Verify that the cpanfile got copied into PERL_MODULE_DIR (which > should be /usr/share/koha/lib) Yes. > 7. Go to the about page of this fresh install and compare it with your > dev install That's the problem. I'm stuck in a weird loop install in my kohadevbox. I'll probably destroy it, and up it just to restart. But perhaps there is something wrong in the installation steps? Could you flush out the testing steps on a kohadevbox to painful detail? (In reply to M. Tompsett from comment #17) > That's the problem. I'm stuck in a weird loop install in my kohadevbox. I'll > probably destroy it, and up it just to restart. But perhaps there is > something wrong in the installation steps? > I sometimes get stuck in a weird install loop on kohadevbox too. Are you using Plack? I find restarting the Plack daemon usually fixes it. Created attachment 97484 [details] [review] Bug 19735: Script to generate cpanfile (DO NOT PUSH) For testing purposes only Created attachment 97485 [details] [review] Bug 19735: Move Perl deps definitions into a cpanfile cpanfile is a format for describing CPAN dependencies for Perl applications. It is more concise - thus easier to read and maintain - than C4::Installer::PerlDependencies, and allows to describe requirements more accurately (using version ranges or features for instance) Additionally it can be read by tools such as cpanm or carton for an easy way to install dependencies on non-Debian-based systems. For more information on cpanfile, see http://search.cpan.org/~miyagawa/Module-CPANfile-1.1002/lib/cpanfile.pod This patch replace C4::Installer::PerlDependencies by an equivalent cpanfile and update all scripts/modules that were using PerlDependencies It also removes dead code from C4::Installer::PerlModules (some subroutines were not used at all, except in unit tests) Added dependencies: - Module::CPANfile - CPAN::Meta (dependency of Module::CPANfile, but we need a more recent version than the one Module::CPANfile requires) Test plan: 1. Go to About page, tab Perl modules and keep this browser tab open 2. Apply patch 3. Install Module::CPANfile and CPAN::Meta a. On Debian-based systems: # will install libcpan-meta-perl as a dependency sudo apt install libmodule-cpanfile-perl b. Others: # will install CPAN::Meta as a dependency sudo cpanm Module::CPANfile 4. In a new browser tab, go to About page, tab Perl modules and compare the table with the one in the previous browser tab They should be identical, except for newly added dependencies (Module::CPANfile and CPAN::Meta) 5. Do a 'standard' install a. perl Makefile.PL (select 'standard') b. make c. sudo make install d. Configure your database, web server, ... and go through the web install process 6. Verify that the cpanfile got copied into PERL_MODULE_DIR (which should be /usr/share/koha/lib) 7. Go to the about page of this fresh install and compare it with your dev install 8. Verify that debian/list-deps still works This takes a lot of time and it may not be necessary to wait until the end. If you see some Debian package names that correspond to modules in cpanfile, it means it still works (you need apt-file for this script to work) 9. Verify that koha_perl_deps.pl still works 10. prove t/Installer_pm.t t/Installer_PerlModules.t Patches rebased on master I like the idea of moving to cpanfile as it means moving away from koha specific code and toward well maintained wider community code.. This patchset all looks solid to me, but I'm not a packaging expert so I'm not sure how that side of things would be affected by this.. calling Mason and Mirko for comment. I'm really interested in this issue, but juggling a few things at the moment, so not going to do the full test. However, I do want to say the following: 1. koha_perl_deps.pl is working great with this change 2. prove t/Installer_pm.t t/Installer_PerlModules.t passed its tests, although they spat out a bunch of Test::MockTime warnings on my non-Debian system running Perl 5.26.1. I imagine that's unrelated though. Created attachment 98568 [details] [review] Bug 19735: Script to generate cpanfile (DO NOT PUSH) For testing purposes only Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 98569 [details] [review] Bug 19735: Move Perl deps definitions into a cpanfile cpanfile is a format for describing CPAN dependencies for Perl applications. It is more concise - thus easier to read and maintain - than C4::Installer::PerlDependencies, and allows to describe requirements more accurately (using version ranges or features for instance) Additionally it can be read by tools such as cpanm or carton for an easy way to install dependencies on non-Debian-based systems. For more information on cpanfile, see http://search.cpan.org/~miyagawa/Module-CPANfile-1.1002/lib/cpanfile.pod This patch replace C4::Installer::PerlDependencies by an equivalent cpanfile and update all scripts/modules that were using PerlDependencies It also removes dead code from C4::Installer::PerlModules (some subroutines were not used at all, except in unit tests) Added dependencies: - Module::CPANfile - CPAN::Meta (dependency of Module::CPANfile, but we need a more recent version than the one Module::CPANfile requires) Test plan: 1. Go to About page, tab Perl modules and keep this browser tab open 2. Apply patch 3. Install Module::CPANfile and CPAN::Meta a. On Debian-based systems: # will install libcpan-meta-perl as a dependency sudo apt install libmodule-cpanfile-perl b. Others: # will install CPAN::Meta as a dependency sudo cpanm Module::CPANfile 4. In a new browser tab, go to About page, tab Perl modules and compare the table with the one in the previous browser tab They should be identical, except for newly added dependencies (Module::CPANfile and CPAN::Meta) 5. Do a 'standard' install a. perl Makefile.PL (select 'standard') b. make c. sudo make install d. Configure your database, web server, ... and go through the web install process 6. Verify that the cpanfile got copied into PERL_MODULE_DIR (which should be /usr/share/koha/lib) 7. Go to the about page of this fresh install and compare it with your dev install 8. Verify that debian/list-deps still works This takes a lot of time and it may not be necessary to wait until the end. If you see some Debian package names that correspond to modules in cpanfile, it means it still works (you need apt-file for this script to work) 9. Verify that koha_perl_deps.pl still works 10. prove t/Installer_pm.t t/Installer_PerlModules.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 98570 [details] [review] Bug 19735: Remove C4::Installer::PerlDependancies This patch does the actual removal of the PerlDependancies module. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signing off.. all works as expected. I did a minor rebase whilst I was testing (new dependencies added to PerlDependancies. As part of that I separated the 'remove PerlDependancies' step into it's own commit to make it easier to rebase and use the included test script for building an updated cpanfile at time of push. (In reply to Martin Renvoize from comment #27) > Signing off.. all works as expected. > > I did a minor rebase whilst I was testing (new dependencies added to > PerlDependancies. As part of that I separated the 'remove PerlDependancies' > step into it's own commit to make it easier to rebase and use the included > test script for building an updated cpanfile at time of push. I wanted to do that, but never did... Thanks :) Created attachment 98576 [details] [review] Bug 19735: (QA follow-up) Drop references to 'usage' The 'usage' key was dropped as part of this migration to cpanfile but it was still refered to by the installed. This patch simply removes references to it. After considering how we might add it back in I decided that as it stands it wasn't a well maintained list and should be re-implimented in the future in a more consistent form if we miss it. Created attachment 98577 [details] [review] Bug 19735: Add support for max_ver Created attachment 98636 [details] [review] Bug 19735: Script to generate cpanfile (DO NOT PUSH) For testing purposes only Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 98637 [details] [review] Bug 19735: Move Perl deps definitions into a cpanfile cpanfile is a format for describing CPAN dependencies for Perl applications. It is more concise - thus easier to read and maintain - than C4::Installer::PerlDependencies, and allows to describe requirements more accurately (using version ranges or features for instance) Additionally it can be read by tools such as cpanm or carton for an easy way to install dependencies on non-Debian-based systems. For more information on cpanfile, see http://search.cpan.org/~miyagawa/Module-CPANfile-1.1002/lib/cpanfile.pod This patch replace C4::Installer::PerlDependencies by an equivalent cpanfile and update all scripts/modules that were using PerlDependencies It also removes dead code from C4::Installer::PerlModules (some subroutines were not used at all, except in unit tests) Added dependencies: - Module::CPANfile - CPAN::Meta (dependency of Module::CPANfile, but we need a more recent version than the one Module::CPANfile requires) Test plan: 1. Go to About page, tab Perl modules and keep this browser tab open 2. Apply patch 3. Install Module::CPANfile and CPAN::Meta a. On Debian-based systems: # will install libcpan-meta-perl as a dependency sudo apt install libmodule-cpanfile-perl b. Others: # will install CPAN::Meta as a dependency sudo cpanm Module::CPANfile 4. In a new browser tab, go to About page, tab Perl modules and compare the table with the one in the previous browser tab They should be identical, except for newly added dependencies (Module::CPANfile and CPAN::Meta) 5. Do a 'standard' install a. perl Makefile.PL (select 'standard') b. make c. sudo make install d. Configure your database, web server, ... and go through the web install process 6. Verify that the cpanfile got copied into PERL_MODULE_DIR (which should be /usr/share/koha/lib) 7. Go to the about page of this fresh install and compare it with your dev install 8. Verify that debian/list-deps still works This takes a lot of time and it may not be necessary to wait until the end. If you see some Debian package names that correspond to modules in cpanfile, it means it still works (you need apt-file for this script to work) 9. Verify that koha_perl_deps.pl still works 10. prove t/Installer_pm.t t/Installer_PerlModules.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 98638 [details] [review] Bug 19735: Remove C4::Installer::PerlDependancies This patch does the actual removal of the PerlDependancies module. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 98639 [details] [review] Bug 19735: (QA follow-up) Drop references to 'usage' The 'usage' key was dropped as part of this migration to cpanfile but it was still refered to by the installed. This patch simply removes references to it. After considering how we might add it back in I decided that as it stands it wasn't a well maintained list and should be re-implimented in the future in a more consistent form if we miss it. Created attachment 98640 [details] [review] Bug 19735: Add support for max_ver This patchset adds support for extracting 'max_ver' from the cpanfile so we can use version ranges properly and report errors if we have modules installed that do not fit within that version range. Test plan: 1) Manually modify the module version of a required module in the cpanfile to have a max version greater than the version you have installed. 2) Run through the install proceedure and note the new warning that a module needs upgrade for the module in question. 3) The module should also be reported in the about page Created attachment 98743 [details] [review] Bug 19735: Update cpanfile Does not work for me, I get: Can't locate object method "phases" via package "CPAN::Meta::Prereqs" at /kohadevbox/koha/C4/Installer/PerlModules.pm line 55 on about.pl % pmvers CPAN::Meta::Prereqs 2.150005 Debian 9.11 Am I missing something? Also, do we really need the "Bug 19735: Add support for max_ver" patch? Maybe on its own bug report if needed? (In reply to Jonathan Druart from comment #37) > Does not work for me, I get: > Can't locate object method "phases" via package "CPAN::Meta::Prereqs" at > /kohadevbox/koha/C4/Installer/PerlModules.pm line 55 > > on about.pl > > % pmvers CPAN::Meta::Prereqs > 2.150005 > > Debian 9.11 > > Am I missing something? You need CPAN::Meta 2.150006 (In reply to Jonathan Druart from comment #37) > Also, do we really need the "Bug 19735: Add support for max_ver" patch? > Maybe on its own bug report if needed? On it own bug or not, it might become useful quickly (for example, see bug 24573) (In reply to Julian Maurice from comment #38) > (In reply to Jonathan Druart from comment #37) > > Does not work for me, I get: > > Can't locate object method "phases" via package "CPAN::Meta::Prereqs" at > > /kohadevbox/koha/C4/Installer/PerlModules.pm line 55 > > > > on about.pl > > > > % pmvers CPAN::Meta::Prereqs > > 2.150005 > > > > Debian 9.11 > > > > Am I missing something? > > You need CPAN::Meta 2.150006 Weird, my docker container was not up-to-date, apt update then install fixed the problem. I now have libcpan-meta-perl 2.150010-1 Note that the package is not in buster, Martin, Mason, how is that blocking? (In reply to Jonathan Druart from comment #40) > Note that the package is not in buster, Martin, Mason, how is that blocking? CPAN::Meta is included in perl-modules-5.28 in buster (In reply to Julian Maurice from comment #41) > (In reply to Jonathan Druart from comment #40) > > Note that the package is not in buster, Martin, Mason, how is that blocking? > > CPAN::Meta is included in perl-modules-5.28 in buster Awesome! Did you investigate those warnings? t/Installer_PerlModules.t .. 1/6 [Wed Feb 12 13:16:29 2020] Installer_PerlModules.t: Subroutine CORE::GLOBAL::time redefined at /usr/share/perl5/Test/MockTime.pm line 20. [Wed Feb 12 13:16:29 2020] Installer_PerlModules.t: Prototype mismatch: sub CORE::GLOBAL::time () vs none at /usr/share/perl5/Test/MockTime.pm line 20. [Wed Feb 12 13:16:29 2020] Installer_PerlModules.t: Subroutine CORE::GLOBAL::localtime redefined at /usr/share/perl5/Test/MockTime.pm line 21. [Wed Feb 12 13:16:29 2020] Installer_PerlModules.t: Prototype mismatch: sub CORE::GLOBAL::localtime (;$) vs none at /usr/share/perl5/Test/MockTime.pm line 21. [Wed Feb 12 13:16:29 2020] Installer_PerlModules.t: Subroutine CORE::GLOBAL::gmtime redefined at /usr/share/perl5/Test/MockTime.pm line 22. [Wed Feb 12 13:16:29 2020] Installer_PerlModules.t: Prototype mismatch: sub CORE::GLOBAL::gmtime (;$) vs none at /usr/share/perl5/Test/MockTime.pm line 22. t/Installer_PerlModules.t .. ok (In reply to Jonathan Druart from comment #42) > Did you investigate those warnings? No. I believe they are here on master too ? (not sure, I haven't checked in a while) (In reply to Julian Maurice from comment #43) > (In reply to Jonathan Druart from comment #42) > > Did you investigate those warnings? > > No. I believe they are here on master too ? (not sure, I haven't checked in > a while) No, they are not. Created attachment 98744 [details] [review] Bug 19735: Move Perl deps definitions into a cpanfile cpanfile is a format for describing CPAN dependencies for Perl applications. It is more concise - thus easier to read and maintain - than C4::Installer::PerlDependencies, and allows to describe requirements more accurately (using version ranges or features for instance) Additionally it can be read by tools such as cpanm or carton for an easy way to install dependencies on non-Debian-based systems. For more information on cpanfile, see http://search.cpan.org/~miyagawa/Module-CPANfile-1.1002/lib/cpanfile.pod This patch replace C4::Installer::PerlDependencies by an equivalent cpanfile and update all scripts/modules that were using PerlDependencies It also removes dead code from C4::Installer::PerlModules (some subroutines were not used at all, except in unit tests) Added dependencies: - Module::CPANfile - CPAN::Meta (dependency of Module::CPANfile, but we need a more recent version than the one Module::CPANfile requires) Test plan: 1. Go to About page, tab Perl modules and keep this browser tab open 2. Apply patch 3. Install Module::CPANfile and CPAN::Meta a. On Debian-based systems: # will install libcpan-meta-perl as a dependency sudo apt install libmodule-cpanfile-perl b. Others: # will install CPAN::Meta as a dependency sudo cpanm Module::CPANfile 4. In a new browser tab, go to About page, tab Perl modules and compare the table with the one in the previous browser tab They should be identical, except for newly added dependencies (Module::CPANfile and CPAN::Meta) 5. Do a 'standard' install a. perl Makefile.PL (select 'standard') b. make c. sudo make install d. Configure your database, web server, ... and go through the web install process 6. Verify that the cpanfile got copied into PERL_MODULE_DIR (which should be /usr/share/koha/lib) 7. Go to the about page of this fresh install and compare it with your dev install 8. Verify that debian/list-deps still works This takes a lot of time and it may not be necessary to wait until the end. If you see some Debian package names that correspond to modules in cpanfile, it means it still works (you need apt-file for this script to work) 9. Verify that koha_perl_deps.pl still works 10. prove t/Installer_pm.t t/Installer_PerlModules.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 98745 [details] [review] Bug 19735: Remove C4::Installer::PerlDependancies This patch does the actual removal of the PerlDependancies module. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 98746 [details] [review] Bug 19735: (QA follow-up) Drop references to 'usage' The 'usage' key was dropped as part of this migration to cpanfile but it was still refered to by the installed. This patch simply removes references to it. After considering how we might add it back in I decided that as it stands it wasn't a well maintained list and should be re-implimented in the future in a more consistent form if we miss it. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 98747 [details] [review] Bug 19735: Add support for max_ver This patchset adds support for extracting 'max_ver' from the cpanfile so we can use version ranges properly and report errors if we have modules installed that do not fit within that version range. Test plan: 1) Manually modify the module version of a required module in the cpanfile to have a max version greater than the version you have installed. 2) Run through the install proceedure and note the new warning that a module needs upgrade for the module in question. 3) The module should also be reported in the about page Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 98748 [details] [review] Bug 19735: Update cpanfile Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> *** Bug 9979 has been marked as a duplicate of this bug. *** Either this one or bug 24642 will need to be adjusted. Nice work everyone! Pushed to master for 20.05 Note to RMaints.. this one is up to you whether you wish to backport it.. It removes C4::Installer::PerlDependancies and as such if you're backporting future bugs that require the addition of dependencies after this bug has been pushed, you will need to manually add them to PerlDependancies at backport time. Koha_Master_D9_MDB_Latest and Koha_Master_D9 are currently failing with: koha_1 | # Failed test 'No tests run for subtest "versions_info"' koha_1 | # at t/Installer_PerlModules.t line 35. koha_1 | Can't locate object method "phases" via package "CPAN::Meta::Prereqs" at /kohadevbox/koha/C4/Installer/PerlModules.pm line 55. koha_1 | # Looks like your test exited with 2 just after 6. koha_1 | [10:05:40] t/Installer_PerlModules.t OK, I've added the Meta dependencies as a cpan installed module for Jessie for master.. I don't believe we should go to the effort of backporting this dependency for Jessie given we will be deprecating support for that OS at the release of 20.05. However, this does make me believe this enhancement should certainly NOT be backported. Enhancement not pushed to 19.11.x |