On 2017-11-14 15:13:59, DAM wrote:
Show quoted text> На 14 ноем. 2017, вт 10:26:16, SREZIC написа:
> > Most of the embed tests fail on my debian/stretch smoker:
> >
> > ...
> > # Creating test database at dbd-firebird-test.fdb
> > Unsuccessful execution caused by a system error that precludes
> > successful execution of subsequent statements
> > -Unable to complete network request to host "localhost".
> > -Failed to establish a connection. at
> > /home/cpansand/.cpan/build/2017111406/DBD-Firebird-1.25-
> > 0/blib/lib/DBD/FirebirdEmbedded.pm line 125.
>
> Yeah. This is because for the embedded access to work with firebird 3,
> the embedded engine (libEngine12.s0) needs to be available. It is in
> the firebird3.0-server-core. An attempt to load it is made by
> libfbclient2 when direct-file access is made, and if that fails (when
> libEngine12.so is not found), the request is transformed to a TCP one
> to localhost, which rightfully fails, because there is no firebird
> server listening (and even if there were firebird server listening,
> the request would still fail, since the firebird server doesn't
> normaly have file-level access to the database file DBD-Firebird tries
> to access).
>
> You can workaround this in the smoker by installing firebird3.0-
> server-core.
>
> I am open to any ideas how to express this dependency in META, or how
> to test for it in MakeFile.PL, so that the tests are skipped.
It is not possible to specify system-level dependencies in META. The solution for my smokers is the module CPAN::Plugin::Sysdeps (a CPAN plugin capable of installing system dependencies for CPAN modules), which I will change like this:
diff --git a/lib/CPAN/Plugin/Sysdeps/Mapping.pm b/lib/CPAN/Plugin/Sysdeps/Mapping.pm
index bc65958..7b056e9 100644
--- a/lib/CPAN/Plugin/Sysdeps/Mapping.pm
+++ b/lib/CPAN/Plugin/Sysdeps/Mapping.pm
@@ -692,7 +692,10 @@ sub mapping {
[os_freebsd,
[package => 'firebird25-server']],
[like_debian,
- [package => 'firebird-dev']],
+ [linuxdistrocodename => [qw(squeeze wheezy jessie precise trusty xenial)],
+ [package => 'firebird-dev']],
+ [package => [qw(firebird-dev firebird3.0-server-core)]] # for stretch (and newer?)
+ ],
[like_fedora,
[package => 'firebird-devel']],
],
With this change the tests pass on the debian/stretch smoker.
But! I found another problem: the tests seem to create the directory /tmp/firebird and a file fb_init in it. If the test is executed by different users on the same machine, then the 2nd one will see a failure. Probably it's better to use a directory name with a userid attached, or even better, a temporary directory created by File::Temp::tempdir.
Regards,
Slaven