Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Botan 3.0.0 recipe and make it compatible with Conan 2.x #18079

Merged

Conversation

lieser
Copy link
Contributor

@lieser lieser commented Jun 27, 2023

Specify library name and version: botan/3.0.0

Replaces inactive PR #17364.


@CLAassistant
Copy link

CLAassistant commented Jun 27, 2023

CLA assistant check
All committers have signed the CLA.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

Hooks produced the following warnings for commit 9aaf6bb
botan/2.17.0
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.17.17.0.dylib, libbotan-2.17.dylib, libbotan-2.dylib
botan/2.16.0
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.16.dylib, libbotan-2.dylib, libbotan-2.16.16.0.dylib
botan/2.14.0
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.dylib, libbotan-2.13.dylib, libbotan-2.13.14.0.dylib
botan/2.17.2
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.17.17.2.dylib, libbotan-2.17.dylib, libbotan-2.dylib
botan/2.18.2
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.dylib, libbotan-2.18.18.2.dylib, libbotan-2.18.dylib
botan/2.18.1
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.dylib, libbotan-2.18.18.1.dylib, libbotan-2.18.dylib
botan/2.19.2
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.dylib, libbotan-2.19.19.2.dylib, libbotan-2.19.dylib
botan/2.19.3
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.19.19.3.dylib, libbotan-2.dylib, libbotan-2.19.dylib

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

Hooks produced the following warnings for commit a3426d9
botan/2.19.1
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.19.19.1.dylib, libbotan-2.dylib, libbotan-2.19.dylib
botan/2.19.2
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.dylib, libbotan-2.19.19.2.dylib, libbotan-2.19.dylib
botan/2.18.2
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.dylib, libbotan-2.18.18.2.dylib, libbotan-2.18.dylib
botan/2.19.3
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.19.19.3.dylib, libbotan-2.dylib, libbotan-2.19.dylib

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

Hooks produced the following warnings for commit 3cdcbac
botan/2.17.3
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.17.dylib, libbotan-2.17.17.3.dylib, libbotan-2.dylib
botan/2.19.3
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.19.19.3.dylib, libbotan-2.dylib, libbotan-2.19.dylib
botan/2.19.1
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.19.19.1.dylib, libbotan-2.dylib, libbotan-2.19.dylib
botan/2.18.2
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libbotan-2.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libbotan-2.dylib, libbotan-2.18.18.2.dylib, libbotan-2.18.dylib

@trns1997
Copy link
Contributor

trns1997 commented Jul 4, 2023

@lieser quick note, I just faced a problem where the CXXFLAGS defined in my profile file under the [env] tags is not used or parsed. Could you look into it? I will see on my end whats going on in further detail tomorrow :) .

@lieser
Copy link
Contributor Author

lieser commented Jul 5, 2023

I just faced a problem where the CXXFLAGS defined in my profile file under the [env] tags is not used or parsed.

@trns1997 Note that [env] is deprecated and as far as I know does not work in Conan 2. Try using [buildenv] instead. https://docs.conan.io/1/reference/profiles.html#buildenv

@lieser
Copy link
Contributor Author

lieser commented Jul 5, 2023

@memsharded Currently the CI fails with This commit cannot be built. Probably because all compilers in the CI are to old to build Botan 3.0.0.

Does that mean it will not be possible to add Botan 3.0.0 until the CI gets updated, or Botan is somehow made compatible with at least one compiler?

There is a potential chance to make GCC 11.1 compatible, as GCC 11 has C++ 20 support. But unsure if it will be worth the effort to try working around the bugs in GCC 11.1 that affect Botan.


Another question is regarding the new compiler.cppstd setting now given in the Conan 2 profile.

How should a library like Botan with a custom build system that has a hard coded C++ language setting behave?

  • Simply ignore it? (like it is done with the current recipe)
  • In the validate() method check that compiler.cppstd is at least the hard coded version or higher?
  • In the configure() method delete it with self.settings.rm_safe("compiler.cppstd") so it does not affect the package_id?

@trns1997
Copy link
Contributor

trns1997 commented Jul 5, 2023

@lieser quick note, I just faced a problem where the CXXFLAGS defined in my profile file under the [env] tags is not used or parsed. Could you look into it? I will see on my end whats going on in further detail tomorrow :) .

hey @lieser, I just figured out why it no works for us. Basically we used to pass the CXXFLAGS via the [env] tags in profiles when using Conan 1.55.0 but in the conanfile.py we explicitly fetch the cxxflags via the [conf] tag. So I just updated the profile and passed the cxxflags via tools.build:cxxflags

@reneme reneme force-pushed the 17247-botan-upgrade-conanfile-2.0 branch from 41ecbfe to 3060781 Compare January 15, 2024 08:17
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@reneme
Copy link
Contributor

reneme commented Jan 15, 2024

@uilianries I think, I addressed your recent comments and the pipeline is green. I'd appreciate another look. :)

Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some notes:

  • Tested locally with the docker image conanio/gcc11-ubuntu16.04 and it does not work because we have 11.1 installed
  • Tested locally with the docker image conanio/gcc12-ubuntu16.04 and it does not work because it requires glibc >= 2.25 because it uses getentropy
  • Tested locally with the docker image conanio/gcc12-ubuntu18.04 with Conan 2.0.17 and worked for static library build.

Comment on lines 182 to 183
miss_boost_required_comp = any(getattr(self.options['boost'], 'without_{}'.format(boost_comp), True) for boost_comp in self._required_boost_components)
if self.options['boost'].header_only or self.options['boost'].shared or self.options['boost'].magic_autolink or miss_boost_required_comp:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to build locally and it does not work when boost is required:

$ conan create all --version=3.2.0 -s compiler.cppstd=20 --build=missing -pr gcc12.profile 

======== Exporting recipe to the cache ========
botan/3.2.0: Exporting package recipe: /home/conan/project/all/conanfile.py
botan/3.2.0: exports: File 'conandata.yml' found. Exporting it...
botan/3.2.0: Calling export_sources()
botan/3.2.0: Copied 1 '.yml' file: conandata.yml
botan/3.2.0: Copied 1 '.py' file: conanfile.py
botan/3.2.0: Exported to cache folder: /home/conan/.conan2/p/botan759963310d11c/e
botan/3.2.0: Exported: botan/3.2.0#9b62638872488502e0160f97996e959f (2024-01-15 15:43:57 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=12
os=Linux
[options]
botan/3.2.0:with_boost=True
botan/3.2.0:with_bzip2=True
botan/3.2.0:with_sqlite3=True
botan/3.2.0:with_zlib=True

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=12
os=Linux


======== Computing dependency graph ========
bzip2/1.0.8: Not found in local cache, looking in remotes...
bzip2/1.0.8: Checking remote: conancenter
bzip2/1.0.8: Downloaded recipe revision 457c272f7da34cb9c67456dd217d36c4
zlib/1.3: Not found in local cache, looking in remotes...
zlib/1.3: Checking remote: conancenter
zlib/1.3: Downloaded recipe revision 06023034579559bb64357db3a53f88a4
sqlite3/3.38.5: Not found in local cache, looking in remotes...
sqlite3/3.38.5: Checking remote: conancenter
sqlite3/3.38.5: Downloaded recipe revision 4b875d4249cdfb4c1235e6b3ea6c18e7
boost/1.83.0: Not found in local cache, looking in remotes...
boost/1.83.0: Checking remote: conancenter
boost/1.83.0: Downloaded recipe revision 658a6b1d7aa62a019cbba3f4ae363cb7
libbacktrace/cci.20210118: Not found in local cache, looking in remotes...
libbacktrace/cci.20210118: Checking remote: conancenter
libbacktrace/cci.20210118: Downloaded recipe revision ec1aa63bbc10145c6a299e68e711670c
b2/4.10.1: Not found in local cache, looking in remotes...
b2/4.10.1: Checking remote: conancenter
b2/4.10.1: Downloaded recipe revision 1b290403d8648c79f468f5a6496f829a
Graph root
    cli
Requirements
    boost/1.83.0#658a6b1d7aa62a019cbba3f4ae363cb7 - Downloaded (conancenter)
    botan/3.2.0#9b62638872488502e0160f97996e959f - Cache
    bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Downloaded (conancenter)
    libbacktrace/cci.20210118#ec1aa63bbc10145c6a299e68e711670c - Downloaded (conancenter)
    sqlite3/3.38.5#4b875d4249cdfb4c1235e6b3ea6c18e7 - Downloaded (conancenter)
    zlib/1.3#06023034579559bb64357db3a53f88a4 - Downloaded (conancenter)
Build requirements
    b2/4.10.1#1b290403d8648c79f468f5a6496f829a - Downloaded (conancenter)
Resolved version ranges
    zlib/[>=1.2.11 <2]: zlib/1.3

======== Computing necessary packages ========
boost/1.83.0: Checking 9 compatible configurations
boost/1.83.0: Compatible configurations not found in cache, checking servers
boost/1.83.0: '1f4d8d9bfb906fd36e9471d4ce2424cf0278c2ce': compiler.cppstd=11
boost/1.83.0: 'f331bab124723d370f6d6c8b733ba3ff9df40985': compiler.cppstd=gnu11
boost/1.83.0: '0444dbb02c7c03e0924add655328614c4069992c': compiler.cppstd=14
boost/1.83.0: '53fadd80e75df07d899e7a29532a2fc59cd7ab23': compiler.cppstd=gnu14
boost/1.83.0: '21c1ffdf955757b3eaf1428692e72e91c15d8446': compiler.cppstd=17
boost/1.83.0: 'ab3b66987b0ff007c45a5b90708ec0b68208653b': compiler.cppstd=gnu17
boost/1.83.0: 'b7691adcb83380a1f2a05c4982136fd2dcb71ab7': compiler.cppstd=gnu20
boost/1.83.0: 'b4575a8b8adc07f0f83596aa71fc38363b522735': compiler.cppstd=23
boost/1.83.0: '1d726159589d984732e608f539092dd02c6b8583': compiler.cppstd=gnu23
ERROR: botan/3.2.0: Error in validate() method, line 181
	miss_boost_required_comp = any(getattr(self.options['boost'], 'without_{}'.format(boost_comp), True) for boost_comp in self._required_boost_components)
while calling '<genexpr>', line 181
	miss_boost_required_comp = any(getattr(self.options['boost'], 'without_{}'.format(boost_comp), True) for boost_comp in self._required_boost_components)
	ConanException: option 'without_coroutine' doesn't exist
Possible options are []

So, doing a quick check, in Conan 2.x you should use self.dependencies["boost"].options instead. Could you please update and check it?

@reneme
Copy link
Contributor

reneme commented Jan 31, 2024

Thanks, @uilianries for spotting this issue. I was able to reproduce and fix it with your suggestion. 👍

Regarding the build on conanio/gcc12-ubuntu16.04: Botan expects certain features on Linux by default. Most notably: getrandom and explicit_bzero. Both could be disabled by passing --without-os-features=getrandom,explicit_bzero to Botan's ./configure.py. However, the conan recipe currently does not expose this configuration flag. Nevertheless, I hacked this up locally and confirmed that it would compile.

There are many more switches in Botan's ./configure.py that are not exposed in the recipe, for simplicity. We could, however, add a generic option -o additional_configure_flags=... (name is debatable). That would allow users to circumvent the recipe and directly manipulate their build configuration. Frankly, I'm not sure that is something we would want to do, though... What do you think?

@conan-center-bot

This comment has been minimized.

@uilianries
Copy link
Member

uilianries commented Jan 31, 2024

@reneme Thank you for checking. It's a shame we still can not run a newer docker image with a newer compiler to solve this problem. I would prefer not building a package, but distributing only the recipe in case not possible right now in CCI. I see some problems like, Botan is going forward with new features, and we are trying to backport things, which makes even harder to maintain this recipe.

About the option, you have a good observation about using the option, but I'm no inclined to accept a so generic feature, because it would result in a fragility not tested by us. Like, users start to use a configuration that does not work and report us as an issue, but in the end, it's a bug in the upstream. Maybe, using the conan configuration tools.build:cxxflags could be an option, but only for local building, because right now we don't support custom config per recipe (yet, but we should in months).

My current suggestion is checking glibc version (it could be platform.libc_ver()) and raise ConanInvalidConfiguration if it does not fit. Sad, but not first case in CCI. Hope we can update those images in some months, using Ubuntu 20.04 or 22.04 (16.04 is close to be EOL)

@reneme
Copy link
Contributor

reneme commented Jan 31, 2024

My current suggestion is checking glibc version (it could be platform.libc_ver()) and raise ConanInvalidConfiguration if it does not fit.

Alternatively, we could disable certain features via Botan's ./configure.py --disable-os-features= depending on what version is reported by platform.libc_ver(). I.e. instead of the generic -o additional_configure_flags=, the recipe would be smart enough to disable things as needed automatically.

Though, that would mean that consumers of the binaries compiled in your CI won't benefit from those features, either. Right, @uilianries? But, given that you are planning to update the build images soon, we could remove this workaround again soon.

This can (and should) be removed once CCI's CI images are
updated with a newer glibc.
@reneme
Copy link
Contributor

reneme commented Feb 1, 2024

As discussed yesterday, I added a workaround that allows compiling Botan 3.x with a glibc older than 2.25. This disables certain OS features that the library just takes for granted starting in 3.x.

If the workaround is triggered, it prints a self.output.warning(). I hope CCI doesn't build with core:warnings_as_errors, @uilianries?

@conan-center-bot

This comment has been minimized.

Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, only few comments. I'll build locally with Boost to check how is working.

recipes/botan/all/conanfile.py Outdated Show resolved Hide resolved
recipes/botan/all/conanfile.py Outdated Show resolved Hide resolved
recipes/botan/all/conanfile.py Outdated Show resolved Hide resolved
@uilianries
Copy link
Member

It's working on Mac: https://gist.github.com/uilianries/399359d2327602bcfe8ea5ed4183f0ab 🟢

Co-authored-by: Uilian Ries <uilianries@gmail.com>
Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 29 (8caf736ddaf3e1d86d93a2fcbc1087d6984ebb59):

  • botan/2.17.3:
    All packages built successfully! (All logs)

  • botan/2.18.2:
    All packages built successfully! (All logs)

  • botan/2.19.1:
    All packages built successfully! (All logs)

  • botan/2.19.3:
    All packages built successfully! (All logs)

  • botan/2.19.2:
    All packages built successfully! (All logs)

  • botan/3.2.0:
    All packages built successfully! (All logs)

  • botan/3.1.1:
    All packages built successfully! (All logs)

  • botan/3.0.0:
    All packages built successfully! (All logs)

  • botan/3.1.0:
    All packages built successfully! (All logs)


Conan v2 pipeline ✔️

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

All green in build 31 (8caf736ddaf3e1d86d93a2fcbc1087d6984ebb59):

  • botan/2.18.2:
    All packages built successfully! (All logs)

  • botan/2.17.3:
    All packages built successfully! (All logs)

  • botan/2.19.2:
    All packages built successfully! (All logs)

  • botan/2.19.1:
    All packages built successfully! (All logs)

  • botan/2.19.3:
    All packages built successfully! (All logs)

  • botan/3.2.0:
    All packages built successfully! (All logs)

  • botan/3.0.0:
    All packages built successfully! (All logs)

  • botan/3.1.1:
    All packages built successfully! (All logs)

  • botan/3.1.0:
    All packages built successfully! (All logs)

@reneme
Copy link
Contributor

reneme commented Feb 8, 2024

@RubenRBS @jcar87 Could we get your review on this, please? 😃

@conan-center-bot conan-center-bot merged commit 8f62df8 into conan-io:master Feb 16, 2024
53 checks passed
@reneme
Copy link
Contributor

reneme commented Feb 16, 2024

🥳

Thank you all for the effort that went into this!

@reneme reneme deleted the 17247-botan-upgrade-conanfile-2.0 branch February 16, 2024 10:01
@ericLemanissier ericLemanissier mentioned this pull request Feb 21, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[request] botan/2.19.3 - Upgrade conanfile to 2.x format [package] botan/2.19.3 Unknown -fPIC flag