rnp icon indicating copy to clipboard operation
rnp copied to clipboard

0.18.0 fails to compile with -DCRYPTO_BACKEND=BOTAN3 and experimental feature ENABLE_PQC_DBG_LOG: src/lib/logging.h:104:25: error: expected ';' before '{' token

Open juippis opened this issue 6 months ago • 2 comments

/var/tmp/portage/dev-util/librnp-0.18.0/work/rnp-0.18.0/src/lib/crypto/exdsa_ecdhkem.h:122:53: warning: 'Botan::Curve25519_PrivateKey' is deprecated: Use X25519_PrivateKey [-Wdeprecated-declarations]
  122 |     Botan::Curve25519_PrivateKey botan_key_x25519() const;
      |                                                     ^~~~~
/usr/include/botan-3/botan/curve25519.h:18:69: note: declared here
   18 | BOTAN_DEPRECATED("Use X25519_PrivateKey") typedef X25519_PrivateKey Curve25519_PrivateKey;
      |                                                                     ^~~~~~~~~~~~~~~~~~~~~
In file included from /var/tmp/portage/dev-util/librnp-0.18.0/work/rnp-0.18.0/src/lib/utils.h:31,
                 from /var/tmp/portage/dev-util/librnp-0.18.0/work/rnp-0.18.0/src/lib/crypto/ec.h:35,
                 from /var/tmp/portage/dev-util/librnp-0.18.0/work/rnp-0.18.0/src/lib/crypto/common.h:37:
/var/tmp/portage/dev-util/librnp-0.18.0/work/rnp-0.18.0/src/librepgp/stream-write.cpp: In function 'rnp_result_t encrypted_add_recipient(rnp_ctx_t&, pgp_dest_t&, rnp::Key*, const rnp::secure_bytes&, pgp_pkesk_version_t)':
/var/tmp/portage/dev-util/librnp-0.18.0/work/rnp-0.18.0/src/lib/logging.h:104:25: error: expected ';' before '{' token
  104 |         if (vec.empty() {                                   \
      |                         ^

Find the full build.log attached.

Note that it doesn't seem to matter what values I put into the new options, -DENABLE_PQC and -DENABLE_CRYPTO_REFRESH. Even if I disable them the build fails to this same thing.

librnp-0.18.0:20250602-131527.log

juippis avatar Jun 02 '25 13:06 juippis

This is definitely an error in logging code, however it may only happen if ENABLE_PQC_DBG_LOG is defined. Why do you need it, given that it's just a debug output of experimental feature?

ni4 avatar Jun 02 '25 18:06 ni4

Oh, it counts when it's defined. I tried putting it off and thought it'd be enough to completely disable it :) I have a bad habit of listing all visible configure flags one way or another, even though I've never understood CMake very well.

Indeed removing the extra PGC* options while keeping -DENABLE_PQC=on does make 0.18.0 compile!

juippis avatar Jun 02 '25 19:06 juippis

Let's close this as problem is resolved.

ni4 avatar Nov 21 '25 15:11 ni4