monotone-1.1-25.fc29 fails to build in F29: g++ -I. -I/usr/include/botan-1.10 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -Wall -W -Wno-unused -c -o src/pcrewrap.o src/pcrewrap.cc src/pcrewrap.cc: In destructor 'pcre::regex_cache_manager::~regex_cache_manager()': src/pcrewrap.cc:107:64: error: invalid const_cast from type 'const real_pcre*' to type 'pcre_t*' {aka 'real_pcre8_or_16*'} pcre_free(const_cast<pcre_t *>(iter->second.first)); ^ A difference between passing and failing build root is at <https://apps.fedoraproject.org/koschei/build/4366391>. This could be caused by upgrading pcre or gcc.
The issue that monotone uses PCRE's internal real_pcre type in src/pcrewrap.hh: // This is a sensible C++ wrapper interface around the bare C API exported // by pcre.h. Note that pcre.h is a very "noisy" header in terms of macro // definitions and so we don't actually expose it here. Unfortunately, this // means we have to hope this pair of forward declarations will not change... struct real_pcre; struct pcre_extra; and later then in src/pcrewrap.cc. PCRE 8.42 changed the real_pcre into real_pcre8_or_16 in 8.42 version. Application should use public pcre typedef instead, but monotone decided not to use it because it wanted pcre for C++ namespace. The "hope this pair of forward declarations will not change" worry was fulfilled. It's necessary to adapt monotone to this change.
Created attachment 1432584 [details] Fix
Thanks for the patch. Successful build: https://koji.fedoraproject.org/koji/buildinfo?buildID=1084062