#1054124 dh-ada-library: dh_ada_library output causes /usr/share/ada/packaging.mk:81: *** missing separator error

Package:
dh-ada-library
Source:
dh-ada-library
Description:
Debian helper for Ada libraries
Submitter:
Daniel Gröber
Date:
2024-01-25 16:12:03 UTC
Severity:
normal
#1054124#5
Date:
2023-10-17 13:17:49 UTC
From:
To:
Hi Nicolas,

on my bookworm system importing dh-ada-library's packaging.mk is
causing a make error. AFAICT due to `dh_ada_library --export-versions`
including some copyright output in DEB_GNAT_VERSION:

```
$ dh_ada_library --export-versions
DEB_ADA_SOURCE_DIR:=usr/share/ada/adainclude
DEB_LIB_DIR:=usr/lib/x86_64-linux-gnu
DEB_ADA_LIB_INFO_DIR:=usr/lib/x86_64-linux-gnu/ada/adalib
DEB_GNAT_PROJECT_DIR:=usr/share/gpr
DEB_GNAT_VERSION:=GNATMAKE 10.2.1 20210110
Copyright (C) 1995-2020, Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

I'm not sure what changed to break this, ghdl has been using
dh-ada-library for a while now and this wasn't a problem before.

Thanks,
--Daniel

#1054124#10
Date:
2023-11-27 09:46:11 UTC
From:
To:
Hi Nicolas,

This bug is still blocking my work on ghdl, did you have a chance to look
into it?

Looking at the code:

    my $deb_gnat_version = `gnatmake --version` or error $!;
    $deb_gnat_version =~ s/[^\n]* (\d+)\.\d+\.\d+\n.*/$1/s;

I don't really know perl but my understanding is that =~ is only a match
predicate and doesn't do any replacement. Since the regex below uses a
capture group without using the resulting $1 I wonder if what's missing is
`$deb_gnat_version = $1`?

I don't really see how this could have ever worked tho so I'm still
perplexxed how ada/packaging.mk managed to not blow up previously unless
gnatmake output changed?

Thanks,
--Daniel

#1054124#15
Date:
2024-01-24 18:39:44 UTC
From:
To:
Hello.

I failed to reproduce your issue with
 debhelper      13.11.10
 dh-ada-library 8.6
 gnat-10        10.5.0-2
That is, the output is
 DEB_GNAT_VERSION:=10

Can you reproduce the issue?
Which version of the 'gnat' package is involved, if any?

Also, in which source tree/commit are you executing dh_ada_library?
One could imagine a problem while parsing debian/control.