This question about Installation of Foswiki: Task filed

Perl dependencies: DBI version not detected on Debian 8.8

We're running Foswiki 2.1.4 on Debian 8.8. For some reason it seems that it cannot identify the DBI version on our installation, although it is able to detect the correct path. We have made some tests with a perl script that uses DBI and it runs perfectly on the same server.

This is an excerpt from System/PerlDependencyReport

CPAN:DBI DBI Unknown version installed for
Optional Foswiki Page Cache. Also install one DBD:: module DBI version 0 installed
Location: /usr/lib/x86_64-linux-gnu/perl5/5.20/DBI.pm

And these are the versions of the perl and DBI packages on our system:
$ dpkg -l libdbi-perl perl
Name         Version            Architecture
libdbi-perl  1.631-3+b1         amd64
perl         5.20.2-3+deb8u7    amd64

Finally, this problem is also preventing us from installing some extensions that depend on DBI. For example, the dependency report of SqlPlugin is consistent with the perl dependency report:

Installing SqlPlugin

Loading package installer

Dependency Report for SqlPlugin ...

INSTALLED
  • Text::ParseWords version 3.29 installed

MISSING
  • DBI version >= 1 required -- installed version is 0 - Required.

-- RafaelVarela - 11 Jul 2017

This is a bug in how we detect the VERSION string in the module, so this needs a task filed. We search for a string instead of actually loading the module. Note that missing dependencies should not actually stop the installation of extensions. It will complain, but the extension is still installed. As long as the module loads okay when the extension runs, it should work fine.

-- GeorgeClark - 11 Jul 2017

The following patch (updated) appears to fix the issue.
diff --git a/core/lib/Foswiki/Configure/Dependency.pm b/core/lib/Foswiki/Configure/Dependency.pm
index 00dfa38..e6b478a 100644
--- a/core/lib/Foswiki/Configure/Dependency.pm
+++ b/core/lib/Foswiki/Configure/Dependency.pm
@@ -814,7 +814,7 @@ sub extractModuleVersion {
                     $mod_version = $1;
                 }
                 if (
-/^\s*(?:our\s+)?\$(?:\w*::)*(RELEASE|VERSION)\s*=(?!~)\s*(.*);/
+/\s*(?:our\s+)?\$(?:\w*::)*(RELEASE|VERSION)\s*=(?!~)\s*(.*);/
                   )
                 {
                     eval( "\$mod_" . lc($1) . " = $2;" );
@@ -825,7 +825,7 @@ sub extractModuleVersion {
                 }
                 next;
             }
-            next unless (/^\s*(?:our\s+)?\$(?:\w*::)*VERSION\s*=\s*(.*?);/);
+            next unless (/\s*(?:our\s+)?\$(?:\w*::)*VERSION\s*=\s*(?:qv\()?(.*?)(?:\))?;/);
             eval("\$mod_version = $1;");
 
     # die "Failed to eval $1 from $_ in $file at line $. $@\n" if( $@ ); # DEBUG

The bug is triggered because DBI.pm uses an unusual VERSION string:
our $XS_VERSION = our $VERSION = "1.636"; 
The patch removes the start-of-line anchors for the "our $VERSION" test.

-- GeorgeClark - 11 Jul 2017

NO... Doesn't work. It fixes our test cases, but causes an error in the dependency report. This needs more work.

-- GeorgeClark - 11 Jul 2017

Okay. Now hopefully fixed. The above patch has been updated. The PostgreSQL module - DBD::Pg also uses an unusual version string. our $VERSION = qv('3.5.1');

-- GeorgeClark - 11 Jul 2017

Yes, you are right, this issue doest not prevent the installation of the extension.

I've applied to our server the patch in Tasks.Item14431 and now it detects the DBI version:
CPAN:DBI    DBI 1.631 installed for
Optional Foswiki Page Cache. Also install one DBD:: module
Location: /usr/lib/x86_64-linux-gnu/perl5/5.20/DBI.pm 

Thank you very much!

-- RafaelVarela - 12 Jul 2017
 

QuestionForm edit

Subject Installation of Foswiki
Extension
Version Foswiki 2.1.4
Status Task filed
Related Topics Tasks.Item14431
Topic revision: r4 - 12 Jul 2017, RafaelVarela
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy