Bug#810017: pis4: FTBFS with perl 5.22

2016-01-05 Thread gregor herrmann
Control: tag -1 + confirmed patch upstream
Control: severity -1 serious
# it's a FTBFS

On Tue, 05 Jan 2016 18:27:31 +0200, Graham Inggs wrote:

> Source: psi4
> Version: 1:0.3-4
> Severity: important
> 
> After upgrading to perl 5.22, psi4 FTBFS with the following message:
> 
> [100%] Autodoc options c-side
> cd /build/psi4-0.3/builddir/doc/sphinxman && /usr/bin/cmake -E
> make_directory source/autodir_options_c
> cd /build/psi4-0.3/builddir/doc/sphinxman && /usr/bin/perl
> /build/psi4-0.3/doc/sphinxman/document_options_c.pl
> /build/psi4-0.3/doc/sphinxman
> Can't use 'defined(%hash)' (Maybe you should just omit the defined()?)
> at /build/psi4-0.3/doc/sphinxman/document_options_c.pl line 150.
> doc/sphinxman/CMakeFiles/sphinxman.dir/build.make:106: recipe for
> target 'doc/sphinxman/source/autodoc_abbr_options_c.rst' failed
> make[5]: *** [doc/sphinxman/source/autodoc_abbr_options_c.rst] Error 255
> make[5]: Leaving directory '/build/psi4-0.3/builddir'
> 
> 
> I know nothing about perl, so I tried the suggestion and omitted defined():
> 
> 
> --- a/doc/sphinxman/document_options_c.pl
> +++ b/doc/sphinxman/document_options_c.pl
> @@ -147,7 +147,7 @@
>@OrderedSubsection = @{$ModuleSubsections{$Module}};
>   }
>   foreach my $Subsection (@OrderedSubsection) {
> -   if (defined(%{$hash{$Module}{$Subsection}})) {
> +   if (%{$hash{$Module}{$Subsection}}) {
>   if($Subsection){
>   if ($print_description) {
>   my $Secdivider = "_" x (length($Subsection)-1);
> 

That's usually ok.
 
> This resulted in a slightly different failure:
> 
> 
> [ 98%] Autodoc options c-side
> cd /«PKGBUILDDIR»/builddir/doc/sphinxman && /usr/bin/cmake -E
> make_directory source/autodir_options_c
> cd /«PKGBUILDDIR»/builddir/doc/sphinxman && /usr/bin/perl
> /«PKGBUILDDIR»/doc/sphinxman/document_options_c.pl
> /«PKGBUILDDIR»/doc/sphinxman
> Can't use an undefined value as a HASH reference at
> /«PKGBUILDDIR»/doc/sphinxman/document_options_c.pl line 150.

But apparently not in this case :)

/*
While I try to build the package, a quick note from IRC for upstream:

  I'd say https://bugs.debian.org/810017 was just asking for it: 
  
https://sources.debian.net/src/psi4/1:0.3-4/doc/sphinxman/document_options_c.pl/#L6
*/

Ok, after some debugging (and guessing what the code tries to do,
which is not very obviuous to me):

The second error arises when
$Module = 'SCF' and $Subsection = 'Parallel Runtime', and indeed,
Data::Dumper'ing %hash shows:

$VAR35 = 'SCF';
$VAR36 = {
   'DFSCF Algorithm ' => {

and all kind of other "subsections" but no "Parallel Runtime".


What works (as in: the build finishes and there are no errors or
warnings in this part) and is maybe not completely off and against
the author's intentions is to test for the existence of the specific
"subsection" hash key with:

-   if (defined(%{$hash{$Module}{$Subsection}})) {
+   if (exists($hash{$Module}{$Subsection})) {

(Discussing this with upstream to make sure it does what it's
supposed to might be a good idea. And to fix this for everybody not
just for Debian of course. But for now it might be better than a
failing build.)


Cheers,
gregor

-- 
 .''`.  Homepage https://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
 : :' : Debian GNU/Linux user, admin, and developer -  https://www.debian.org/
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: Leonard Cohen: Love Itself


signature.asc
Description: Digital Signature


Bug#810017: pis4: FTBFS with perl 5.22

2016-01-05 Thread Graham Inggs
Source: psi4
Version: 1:0.3-4
Severity: important

After upgrading to perl 5.22, psi4 FTBFS with the following message:

[100%] Autodoc options c-side
cd /build/psi4-0.3/builddir/doc/sphinxman && /usr/bin/cmake -E
make_directory source/autodir_options_c
cd /build/psi4-0.3/builddir/doc/sphinxman && /usr/bin/perl
/build/psi4-0.3/doc/sphinxman/document_options_c.pl
/build/psi4-0.3/doc/sphinxman
Can't use 'defined(%hash)' (Maybe you should just omit the defined()?)
at /build/psi4-0.3/doc/sphinxman/document_options_c.pl line 150.
doc/sphinxman/CMakeFiles/sphinxman.dir/build.make:106: recipe for
target 'doc/sphinxman/source/autodoc_abbr_options_c.rst' failed
make[5]: *** [doc/sphinxman/source/autodoc_abbr_options_c.rst] Error 255
make[5]: Leaving directory '/build/psi4-0.3/builddir'


I know nothing about perl, so I tried the suggestion and omitted defined():


--- a/doc/sphinxman/document_options_c.pl
+++ b/doc/sphinxman/document_options_c.pl
@@ -147,7 +147,7 @@
   @OrderedSubsection = @{$ModuleSubsections{$Module}};
  }
  foreach my $Subsection (@OrderedSubsection) {
-   if (defined(%{$hash{$Module}{$Subsection}})) {
+   if (%{$hash{$Module}{$Subsection}}) {
  if($Subsection){
  if ($print_description) {
  my $Secdivider = "_" x (length($Subsection)-1);


This resulted in a slightly different failure:


[ 98%] Autodoc options c-side
cd /«PKGBUILDDIR»/builddir/doc/sphinxman && /usr/bin/cmake -E
make_directory source/autodir_options_c
cd /«PKGBUILDDIR»/builddir/doc/sphinxman && /usr/bin/perl
/«PKGBUILDDIR»/doc/sphinxman/document_options_c.pl
/«PKGBUILDDIR»/doc/sphinxman
Can't use an undefined value as a HASH reference at
/«PKGBUILDDIR»/doc/sphinxman/document_options_c.pl line 150.
Auto-documenting options in module globals
Auto-documenting options in module adc
Auto-documenting options in module ccdensity
Auto-documenting options in module ccenergy
Auto-documenting options in module cceom
Auto-documenting options in module cchbar
Auto-documenting options in module cclambda
Auto-documenting options in module ccresponse
Auto-documenting options in module ccsort
Auto-documenting options in module cctriples
Auto-documenting options in module cfour
Auto-documenting options in module cphf
Auto-documenting options in module dcft
Auto-documenting options in module detci
Auto-documenting options in module dfmp2
Auto-documenting options in module dfocc
Auto-documenting options in module dmrg
Auto-documenting options in module findif
Auto-documenting options in module fisapt
Auto-documenting options in module fnocc
Auto-documenting options in module libfrag
Auto-documenting options in module lmp2
Auto-documenting options in module mcscf
Auto-documenting options in module mints
Auto-documenting options in module mrcc
Auto-documenting options in module occ
Auto-documenting options in module optking
Auto-documenting options in module psimrcc
Auto-documenting options in module sapt
Auto-documenting options in module scf
make[5]: *** [doc/sphinxman/source/autodoc_abbr_options_c.rst] Error 25
doc/sphinxman/CMakeFiles/sphinxman.dir/build.make:102: recipe for
target 'doc/sphinxman/source/autodoc_abbr_options_c.rst' failed
make[5]: Leaving directory '/«PKGBUILDDIR»/builddir'