Bug#987934: fdb: fails to build from the source

2021-05-02 Thread Sergio Durigan Junior
Control: tags -1 + patch

On Sunday, May 02 2021, Andrej Shadura wrote:

> Dear Maintainer,
>
> While rebuilding your package from the source, I received this error:
>
> [ 79%] Building CXX object 
> src/fdb5/CMakeFiles/fdb-hammer.dir/tools/fdb-hammer.cc.o
> cd /<>/obj-x86_64-linux-gnu/src/fdb5 && /usr/bin/c++  
> -I/<>/src -I/<>/obj-x86_64-linux-gnu/src 
> -I/usr/include/metkit -I/us
> r/include/x86_64-linux-gnu/eckit 
> -I/usr/include/x86_64-linux-gnu/eckit/option -g -O2 
> -ffile-prefix-map=/<>=. -fstack-protector-strong -Wformat -Werr
> or=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -pipe -O3 -DNDEBUG 
> -fPIE -std=gnu++11 -o CMakeFiles/fdb-hammer.dir/tools/fdb-hammer.cc.o -c 
> /<>/s
> rc/fdb5/tools/fdb-hammer.cc
> /<>/src/fdb5/tools/fdb-hammer.cc:25:10: fatal error: 
> metkit/grib/GribHandle.h: No such file or directory
>25 | #include "metkit/grib/GribHandle.h"
>   |  ^~
> compilation terminated.
> make[3]: *** [src/fdb5/CMakeFiles/fdb-hammer.dir/build.make:85: 
> src/fdb5/CMakeFiles/fdb-hammer.dir/tools/fdb-hammer.cc.o] Error 1
> make[3]: Leaving directory '/<>/obj-x86_64-linux-gnu'
> make[2]: *** [CMakeFiles/Makefile2:1428: 
> src/fdb5/CMakeFiles/fdb-hammer.dir/all] Error 2
>
> The complete build log is attached to the bug report.

Hi,

The following patch fixes the FTBFS for me.  I've also opened an MR
against the salsa project here:

  https://salsa.debian.org/science-team/fdb/-/merge_requests/1

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
https://sergiodj.net/

diff --git a/debian/changelog b/debian/changelog
index be94e04..43b0a96 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+fdb (5.7.0-6) UNRELEASED; urgency=medium
+
+  * d/p/adjust-metkit-changes.patch: Adjust code to reflect metkit changes.
+Fix FTBFS. (Closes: #987934)
+
+ -- Sergio Durigan Junior   Sun, 02 May 2021 18:45:20 -0400
+
 fdb (5.7.0-5) unstable; urgency=medium
 
   * Add debian/watch file
diff --git a/debian/patches/adjust-metkit-changes.patch b/debian/patches/adjust-metkit-changes.patch
new file mode 100644
index 000..966eb8f
--- /dev/null
+++ b/debian/patches/adjust-metkit-changes.patch
@@ -0,0 +1,38 @@
+From: Emanuele Danovaro 
+Date: Sun, 2 May 2021 18:42:19 -0400
+Subject: METK-80 to reflect changes in metkit
+
+Origin: backported, https://github.com/ecmwf/fdb/commit/09c914a4c7c8336781dacdd9224bd9fd530974f4
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=987934
+Last-Updated: 2021-05-02
+---
+ src/fdb5/tools/fdb-hammer.cc | 9 -
+ 1 file changed, 9 deletions(-)
+
+diff --git a/src/fdb5/tools/fdb-hammer.cc b/src/fdb5/tools/fdb-hammer.cc
+index 3298da9..efcfebc 100644
+--- a/src/fdb5/tools/fdb-hammer.cc
 b/src/fdb5/tools/fdb-hammer.cc
+@@ -22,8 +22,6 @@
+ #include "eckit/option/SimpleOption.h"
+ #include "eckit/option/VectorOption.h"
+ 
+-#include "metkit/grib/GribHandle.h"
+-
+ #include "fdb5/grib/GribArchiver.h"
+ #include "fdb5/io/HandleGatherer.h"
+ #include "fdb5/tools/FDBTool.h"
+@@ -106,13 +104,6 @@ void FDBWrite::executeWrite(const eckit::option::CmdArgs ) {
+ codes_handle* handle = codes_handle_new_from_file(nullptr, fin, PRODUCT_GRIB, );
+ ASSERT(handle);
+ 
+-/*long value;
+-metkit::grib::GribHandle gh(*handle);
+-ASSERT(gh.hasKey("number"));
+-ASSERT(gh.hasKey("step"));
+-ASSERT(gh.hasKey("level"));
+-ASSERT(gh.hasKey("expver"));*/
+-
+ size_t nsteps = args.getLong("nsteps");
+ size_t nensembles = args.getLong("nensembles", 1);
+ size_t nlevels = args.getLong("nlevels");
diff --git a/debian/patches/series b/debian/patches/series
index 0a55278..29b3703 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 soversion.patch
+adjust-metkit-changes.patch


signature.asc
Description: PGP signature


Bug#987934: fdb: fails to build from the source

2021-05-02 Thread Andrej Shadura
Source: fdb
Version: 5.7.0-5
Severity: serious
Tags: ftbfs
Justification: fails to build from source (but built successfully in the past)
User: andre...@debian.org
Usertags: rebuild-ftbfs

Dear Maintainer,

While rebuilding your package from the source, I received this error:

[ 79%] Building CXX object 
src/fdb5/CMakeFiles/fdb-hammer.dir/tools/fdb-hammer.cc.o
cd /<>/obj-x86_64-linux-gnu/src/fdb5 && /usr/bin/c++  
-I/<>/src -I/<>/obj-x86_64-linux-gnu/src 
-I/usr/include/metkit -I/us
r/include/x86_64-linux-gnu/eckit 
-I/usr/include/x86_64-linux-gnu/eckit/option -g -O2 
-ffile-prefix-map=/<>=. -fstack-protector-strong -Wformat -Werr
or=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -pipe -O3 -DNDEBUG -fPIE 
-std=gnu++11 -o CMakeFiles/fdb-hammer.dir/tools/fdb-hammer.cc.o -c 
/<>/s
rc/fdb5/tools/fdb-hammer.cc
/<>/src/fdb5/tools/fdb-hammer.cc:25:10: fatal error: 
metkit/grib/GribHandle.h: No such file or directory
   25 | #include "metkit/grib/GribHandle.h"
  |  ^~
compilation terminated.
make[3]: *** [src/fdb5/CMakeFiles/fdb-hammer.dir/build.make:85: 
src/fdb5/CMakeFiles/fdb-hammer.dir/tools/fdb-hammer.cc.o] Error 1
make[3]: Leaving directory '/<>/obj-x86_64-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:1428: 
src/fdb5/CMakeFiles/fdb-hammer.dir/all] Error 2

The complete build log is attached to the bug report.

-- 
Cheers,
  Andrej


fdb_amd64-2021-05-01T21:35:38Z.gz
Description: application/gzip