mpeppler / DBD-Sybase

Sybase driver for perl's DBI module
8 stars 3 forks source link

Impossible to install DBD::Sybase over carton #135

Open KalessinD opened 2 months ago

KalessinD commented 2 months ago

Hi!

Seems that there is no way to use carton (see module Carton) to install this package. I didn't find any solution to overpass question to choose mode (see checkChainedAutoCommit method in makefile.PL).

This makefile doesn't support any cpan/cpanm/carton environment variables to pass default anwsers or to switch off the interactive mode.

Could you please to support any possible solution to pass an answer without interactive mode?

Thanks in advance.

P.S.

The current error message in carton log:

By default DBD::Sybase 1.05 and later use the 'CHAINED' mode (where available)
when 'AutoCommit' is turned off. Versions 1.04 and older instead managed
the transactions explicitly with a 'BEGIN TRAN' before the first DML
statement. Using the 'CHAINED' mode is preferable as it is the way that
Sybase implements AutoCommit handling for both its ODBC and JDBC drivers.

Use 'CHAINED' mode by default (Y/N) [Y]: -> FAIL Timed out (> 60s). Use --verbose to retry.
-> N/A
-> FAIL No MYMETA file is found after configure. Your toolchain is too old?
-> FAIL Configure failed for DBD-Sybase-1.24. See /home/dchernenko/.cpanm/work/1713377911.67154/build.log for details.
-> FAIL Installing the dependencies failed: Module 'DBD::Sybase' is not installed
-> FAIL Bailing out the installation for /home/dchernenko/ipchain/hg-dev-stand/rais/REPO/core.api/.
mpeppler commented 2 months ago

I can't say I've ever heard of Carton - I was raised on Makefile.PL and later CPAN.pm.... I'll have to take a look and see what would need to be done to allow Carton to be used.

PS - I'll happily consider a patch :-)

KalessinD commented 2 months ago

Thank you for so fast answer.

So, here is my quick proposal to fix this issue:

--- Makefile.PL 2024-04-18 17:45:11.774142917 +0300
+++ Makefile.PL 2024-04-18 17:49:37.682150578 +0300
@@ -513,2 +513,7 @@
   my $ans;
+
+  if ( not defined($chained) && ($ENV{PERL_MM_USE_DEFAULT} || $ENV{NONINTERACTIVE_TESTING}) ) {
+    $chained = 'CHAINED'; # set the default value
+  }
+
   if ( defined($chained) ) {

You can read about these environments in man cpan or here.

KalessinD commented 2 months ago

I see that you have other questions in makefile.PL.

So, it would be great to have the same applied patch for them too.

KalessinD commented 2 months ago

JIC, to install prl packages via carton

  1. install carton itself
    $ apt-get install carton
  2. create cpanfile
    $ cat cpanfile
    requires 'DBD::Sybase';
  3. install module
    $ carton install

It should be install into the "local" directory next to the cpanfile