Bug 232548

Summary: security/cryptopp: 7.0.0 breaks compilation of urbackup 2.3.3 and 2.3.4
Product: Ports & Packages Reporter: aldumas10
Component: Individual Port(s)Assignee: Jason E. Hale <jhale>
Status: Open ---    
Severity: Affects Only Me CC: azmawee, w.schwarzenfeld
Priority: ---    
Version: Latest   
Hardware: amd64   
OS: Any   

Description aldumas10 2018-10-22 22:23:53 UTC
I’m on FreeNAS 11.2 RC1 and unable to compile Urbackup 2.3.3 or 2.3.4. This problem only happened recently. I managed to ‘make’ urbackup successfully by reverting cryptopp from 7.0.0 to 5.6.5_4. I still get those warnings though. Here the error when I ‘make install’.

In file included from Server.cpp:44:
./md5.h:149:2: error: unknown type name ‘byte’; did you mean ‘CryptoPP::byte’?
byte digest[CryptoPP::Weak::MD5::DIGESTSIZE];
^~~~
CryptoPP::byte
/usr/local/include/cryptopp/config.h:237:23: note: ‘CryptoPP::byte’ declared here
typedef unsigned char byte;
^
In file included from Server.cpp:52:
In file included from ./utf8/utf8.h:31:
./utf8/utf8/checked.h:120:58: warning: ‘&’ within ‘|’ [-Wbitwise-op-parentheses]
*(result++) = static_cast<uint8_t>((cp >> 6) & 0x3f | 0x80);
~~~~~~^~ ~
./utf8/utf8/checked.h:120:58: note: place parentheses around the ‘&’ expression to silence this warning
*(result++) = static_cast<uint8_t>((cp >> 6) & 0x3f | 0x80);
^
( )
./utf8/utf8/checked.h:125:58: warning: ‘&’ within ‘|’ [-Wbitwise-op-parentheses]
*(result++) = static_cast<uint8_t>((cp >> 12)& 0x3f | 0x80);
~~~~~~^~ ~
./utf8/utf8/checked.h:125:58: note: place parentheses around the ‘&’ expression to silence this warning
*(result++) = static_cast<uint8_t>((cp >> 12)& 0x3f | 0x80);
^
( )
./utf8/utf8/checked.h:126:58: warning: ‘&’ within ‘|’ [-Wbitwise-op-parentheses]
*(result++) = static_cast<uint8_t>((cp >> 6) & 0x3f | 0x80);
~~~~~~^~ ~
./utf8/utf8/checked.h:126:58: note: place parentheses around the ‘&’ expression to silence this warning
*(result++) = static_cast<uint8_t>((cp >> 6) & 0x3f | 0x80);
^
( )
In file included from Server.cpp:52:
In file included from ./utf8/utf8.h:32:
./utf8/utf8/unchecked.h:48:62: warning: ‘&’ within ‘|’ [-Wbitwise-op-parentheses]
*(result++) = static_cast<uint8_t>((cp >> 6) & 0x3f | 0x80);
~~~~~~^~ ~
./utf8/utf8/unchecked.h:48:62: note: place parentheses around the ‘&’ expression to silence this warning
*(result++) = static_cast<uint8_t>((cp >> 6) & 0x3f | 0x80);
^
( )
./utf8/utf8/unchecked.h:53:62: warning: ‘&’ within ‘|’ [-Wbitwise-op-parentheses]
*(result++) = static_cast<uint8_t>((cp >> 12)& 0x3f | 0x80);
~~~~~~^~ ~
./utf8/utf8/unchecked.h:53:62: note: place parentheses around the ‘&’ expression to silence this warning
*(result++) = static_cast<uint8_t>((cp >> 12)& 0x3f | 0x80);
^
( )
./utf8/utf8/unchecked.h:54:62: warning: ‘&’ within ‘|’ [-Wbitwise-op-parentheses]
*(result++) = static_cast<uint8_t>((cp >> 6) & 0x3f | 0x80);
~~~~~~^~ ~
./utf8/utf8/unchecked.h:54:62: note: place parentheses around the ‘&’ expression to silence this warning
*(result++) = static_cast<uint8_t>((cp >> 6) & 0x3f | 0x80);
Comment 1 Jason E. Hale freebsd_committer 2018-10-23 01:46:37 UTC
I'm not sure which port you are referencing. We currently have in the FreeBSD ports tree: archivers/urbackup-client at version 2.2.6_2 and archivers/urbackup-server at version 2.2.11_3. Those are the latest releases listed on their website (https://www.urbackup.org/download.html), so I'm confused about the versions you are referencing.

When security/cryptopp was updated to 7.0.0, archivers/urbackup-client and archivers/urbackup-server were both fixed (ports r477967) to support the newer version. The byte type was moved out of the global namespace and into the Cryptopp namespace in version 6.0.0. Urbackup upstream appears to have fixed the issue in the dev branch, as well: https://github.com/uroni/urbackup_backend/commit/9ea2da2a1b1509a43ae440af7779e45401378c72.
Comment 2 aldumas10 2018-10-23 01:51:32 UTC
Available here : 

https://forums.urbackup.org/t/server-2-3-4-beta/6155/6

Use to work fine with cryptopp 5.6.5_4
Comment 3 Jason E. Hale freebsd_committer 2018-10-23 02:34:59 UTC
This is more a problem for Urbackup upstream. I patched the version in the ports tree and they still need to fix their software to work with the new CryptoPP API. 

From what I can tell, they mostly fixed it. But <source_root>/md5.h still needs patched. Easy hack: change line 149, byte digest[CryptoPP::Weak::MD5::DIGESTSIZE]; to CryptoPP::byte digest[CryptoPP::Weak::MD5::DIGESTSIZE];

You also need to make sure the output of `pkgconf --cflags-only-other libcryptopp` is appended to your CXXFLAGS (which the port does).
Comment 4 aldumas10 2018-10-24 02:39:46 UTC
I reported @urbackup with your comment Jason. Thanks!
Comment 5 Azmawee 2018-10-26 11:01:17 UTC
Also break when install from source (https://www.urbackup.org/download.html), latest version 2.2.11.
Comment 6 aldumas10 2018-10-26 12:21:51 UTC
azmawee please also report this to the urbackup forum. I have a thread there going on.

https://forums.urbackup.org/t/make-install-doesnt-compile-succesfully-for-urbackup-server-on-freenas-jail/5987
Comment 7 Walter Schwarzenfeld freebsd_triage 2019-08-11 17:00:09 UTC
Cannot reproduce the error. Could it be, this is solved in the meantime?
Comment 8 aldumas10 2019-08-22 01:35:18 UTC
Error still there on 2.4.6 beta sadly. Reported on the Urbackup forum.