walaj/SeqLib

Build failure with newer libjsoncpp

LocutusOfBorg opened this issue · 4 comments

Hello, with the new libjsoncpp 1.9.4 looks like the package fails to build from source:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include/htslib -I/usr/include/fml -I/usr/include/jsoncpp -Wno-sign-compare -Wdate-time -D_FORTIFY_SOURCE=2 -g -Wno-unknown-pragmas -g -O2 -fdebug-prefix-map=/libseqlib-1.1.2+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -c RefGenome.cpp -o libseqlib_la-RefGenome.o >/dev/null 2>&1
ReadFilter.cpp: In constructor 'SeqLib::Filter::ReadFilterCollection::ReadFilterCollection(const string&, const SeqLib::BamHeader&)':
ReadFilter.cpp:181:18: warning: 'Reader' is deprecated: Use CharReader and CharReaderBuilder instead. [-Wdeprecated-declarations]
  181 |     Json::Reader reader;
      |                  ^~~~~~
In file included from /usr/include/jsoncpp/json/json.h:11,
                 from ../SeqLib/ReadFilter.h:10,
                 from ReadFilter.cpp:1:
/usr/include/jsoncpp/json/reader.h:37:63: note: declared here
   37 |     "Use CharReader and CharReaderBuilder instead.") JSON_API Reader {
      |                                                               ^~~~~~
ReadFilter.cpp:181:18: warning: 'Json::Reader::Reader()' is deprecated: Use CharReader and CharReaderBuilder instead [-Wdeprecated-declarations]
  181 |     Json::Reader reader;
      |                  ^~~~~~
In file included from /usr/include/jsoncpp/json/json.h:11,
                 from ../SeqLib/ReadFilter.h:10,
                 from ReadFilter.cpp:1:
/usr/include/jsoncpp/json/reader.h:56:3: note: declared here
   56 |   Reader();
      |   ^~~~~~
ReadFilter.cpp:196:41: error: conversion from 'void' to non-scalar type 'Json::Value' requested
  196 |     Json::Value glob = root.removeMember("global");
      |                        ~~~~~~~~~~~~~~~~~^~~~~~~~~~
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include/htslib -I/usr/include/fml -I/usr/include/jsoncpp -Wno-sign-compare -Wdate-time -D_FORTIFY_SOURCE=2 -g -Wno-unknown-pragmas -g -O2 -fdebug-prefix-map=/libseqlib-1.1.2+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -c BamWriter.cpp -o libseqlib_la-BamWriter.o >/dev/null 2>&1

I don't know, if we can just discard the return value of removeMember (because it now returns void), or some more code changes are needed

An answer to this question (either by accepting the proposed patch or by stating that its not possible to do it this way) would be extremely helpful. If the patch might get accepted it would be great to include it into the new release tag (which I was asking for in pull request #53
Kind regards, Andreas.

Hello, ping?

walaj commented

Thanks for your patience (very busy month at the hospital) -- I completed this merge request and updated to the new Json CharReader. I also just removed the bundled Json in favor of using the system library version.