rnpgp / rnp

RNP: high performance C++ OpenPGP library used by Mozilla Thunderbird
https://www.rnpgp.org
Other
199 stars 55 forks source link

botan 3 support #2062

Closed keachi closed 1 year ago

keachi commented 1 year ago

I'm sorry to provide the next bug during installation of RNP.

Description

I'm trying to install RNP on my macOS with brew as described in installation. This fails as botan is now on version 3.

Environment

macOS Ventura 13.3

$ brew info rnp
==> rnpgp/rnp/rnp: stable 0.16.3, HEAD
High-performance OpenPGP command-line tools and library
https://github.com/rnpgp/rnp
Not installed
From: https://github.com/rnpgp/homebrew-rnp/blob/HEAD/Formula/rnp.rb
License: MIT and BSD-2-Clause and BSD-3-Clause
==> Dependencies
Build: cmake ✔
Required: botan ✔, json-c ✔
==> Options
--HEAD
    Install HEAD version
$ brew info botan
==> botan: stable 3.0.0 (bottled), HEAD
Cryptographic algorithms and formats library in C++
https://botan.randombit.net/
/usr/local/Cellar/botan/3.0.0 (244 files, 21.9MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-04-24 at 16:16:47
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/botan.rb
License: BSD-2-Clause
==> Dependencies
Build: pkg-config ✔
Required: python@3.11 ✔, sqlite ✔
==> Options
--HEAD
    Install HEAD version
==> Analytics
install: 2 (30 days), 204 (90 days), 2,593 (365 days)
install-on-request: 1 (30 days), 107 (90 days), 1,281 (365 days)
build-error: 0 (30 days)
$ ls $(brew --prefix)/lib/*botan*
/usr/local/lib/libbotan-3.0.0.0.dylib
/usr/local/lib/libbotan-3.0.dylib
/usr/local/lib/libbotan-3.a
/usr/local/lib/libbotan-3.dylib

Steps to Reproduce

  1. Get a freshly installed macOS with homebrew.
  2. Follow the instructions.

Expected Behavior

The installation should work.

Actual Behavior

$ brew install rnp
==> Fetching rnpgp/rnp/rnp
==> Downloading https://github.com/rnpgp/rnp/archive/refs/tags/v0.16.3.tar.gz
Already downloaded: /Users/taaruto1/Library/Caches/Homebrew/downloads/c1f02b97ac3a5c367af195f59d324d965f967d372d5f9856e1009fa26e35c177--rnp-0.16.3.tar.gz
==> Installing rnp from rnpgp/rnp
==> cmake -S . -B build
Last 15 lines from /Users/taaruto1/Library/Logs/Homebrew/rnp/01.cmake:
-- Found BZip2: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libbz2.tbd (found version "1.0.8")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found ZLIB: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libz.tbd (found version "1.2.11")
-- Found JSON-C: /usr/local/lib/libjson-c.dylib (found suitable version "0.16", minimum required is "0.11")
CMake Error at /usr/local/Cellar/cmake/3.26.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Botan2 (missing: BOTAN2_LIBRARY BOTAN2_INCLUDE_DIR)
  (Required is at least version "2.14.0")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.26.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/Modules/FindBotan2.cmake:100 (find_package_handle_standard_args)
  src/lib/CMakeLists.txt:35 (find_package)

-- Configuring incomplete, errors occurred!

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/rnpgp/homebrew-rnp/issues

These open issues may also help:
Provide bottle(s) with rnp brew formulae https://github.com/rnpgp/homebrew-rnp/issues/33
Update formula to install rnp.dylib (or add rnp-dev). https://github.com/rnpgp/homebrew-rnp/issues/29
maxirmx commented 1 year ago

@ronaldtse @ni4 @antonsviridenko Do we have any plans for botan-3 support ? We can probably build botan-2 manually but it does not look reasonable for me

ronaldtse commented 1 year ago

It is most reasonable to support Botan 3 as soon as we can, given its first class cryptographic library status in RNP.

antonsviridenko commented 1 year ago

https://botan.randombit.net/handbook/migration_guide.html

ni4 commented 1 year ago

We definitely should support it, and this could be scheduled to the v0.18 release.

maxirmx commented 1 year ago

MacOS CI is now failing (like here https://github.com/rnpgp/rnp/actions/runs/4824540939) so we need some kind of temporary solution.

ni4 commented 1 year ago

I'll take this issue, as it would be mostly related to underlying cryptography.