-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
add microsoft/bond 9.0.0 #2379
add microsoft/bond 9.0.0 #2379
Conversation
Failure in build 2 (
|
Some configurations of 'bond/9.0.0' failed in build 4 (
|
Some configurations of 'bond/9.0.0' failed in build 5 (
|
def source(self): | ||
self.run("git clone https://github.com/microsoft/bond.git") | ||
self.run("git checkout fe6f582ce4beb65644d9338536066e07d80a0289", cwd='bond') | ||
self.run("git submodule update --init --recursive", cwd='bond') | ||
tools.replace_in_file("bond/CMakeLists.txt", | ||
"project (bond)", | ||
'''project (bond) | ||
message("BOOST_ROOT=$ENV{BOOST_ROOT}")''') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please package release 9.0.1: https://github.com/microsoft/bond/releases/tag/9.0.1
Then, you can use conandata.yml
+ export_source a CMakeLists.txt
file, as all other recipes do.
recipes/bond/all/conanfile.py
Outdated
default_options = { | ||
"shared": False, | ||
"fPIC": True} | ||
build_requires = "boost/1.71.0@conan/stable" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build_requires = "boost/1.71.0@conan/stable" | |
requires = "boost/1.73..0" |
A require
is really necessary.
If boost is shared, then the library must be installed too.
self.cpp_info.includedirs = ['include'] | ||
self.cpp_info.libdirs = ['lib/bond'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the library installed in the lib
folder?
self.cpp_info.includedirs = ['include'] | |
self.cpp_info.libdirs = ['lib/bond'] | |
self.cpp_info.libdirs.append(os.path.join("lib", "bond")) |
target_link_libraries(example ${CONAN_LIBS}) | ||
|
||
# CTest is a testing tool that can be used to test your project. | ||
# enable_testing() | ||
# add_test(NAME example | ||
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin | ||
# COMMAND example) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target_link_libraries(example ${CONAN_LIBS}) | |
# CTest is a testing tool that can be used to test your project. | |
# enable_testing() | |
# add_test(NAME example | |
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin | |
# COMMAND example) | |
target_link_libraries(example ${CONAN_LIBS}) |
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is | ||
# in "test_package" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is | |
# in "test_package" |
if not tools.cross_building(self): | ||
os.chdir("bin") | ||
self.run(".%sexample" % os.sep) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not tools.cross_building(self): | |
os.chdir("bin") | |
self.run(".%sexample" % os.sep) | |
if not tools.cross_building(self.settings): | |
bin_path = os.path.join("bin", "example") | |
self.run(bin_path, run_environment=True) |
#include <bond/core/bond_const_enum.h> | ||
|
||
int main() { | ||
std::cout << "bond is installed successfully" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please call at least one bond function (not using a define or header-only function).
That way we can be sure the library is tested properly.
"fPIC": True} | ||
build_requires = "boost/1.71.0@conan/stable" | ||
generators = "cmake" | ||
exports_sources = ["FindBond.cmake"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file (and export a conan wrapper CMakeLists.txt
file instead).
As a consumer of this recipe, when using the cmake_find_package
generator, conan will genere a FindBond.cmake
script automatically.
self.run("chmod +rx *", cwd=f'{self.package_folder}/bin') | ||
self.copy("FindBond.cmake", ".", ".") | ||
|
||
def package_info(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apply this change only if bond creates BondConfig.cmake
or FindBond.cmake
files.
def package_info(self): | |
def package_info(self): | |
self.cpp_info.names["cmake_find_package"] = "Bond" | |
self.cpp_info.names["cmake_find_package_multi"] = "Bond" |
Some configurations of 'bond/9.0.0' failed in build 6 (
|
@@ -0,0 +1,9 @@ | |||
# find_path(BOND_INCLUDE_DIR NAMES bond PATHS ${CONAN_INCLUDE_DIRS_BOND}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove this file. Conan should be able to generate the file by https://docs.conan.io/en/latest/integrations/build_system/cmake/cmake_find_package_generator.html
|
||
class BondConan(ConanFile): | ||
name = "bond" | ||
version = "9.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "9.0.0" |
The version should be consumed from conandata.yml: https://docs.conan.io/en/latest/reference/config_files/conandata.yml.html
class BondConan(ConanFile): | ||
name = "bond" | ||
version = "9.0.0" | ||
license = "MIT License" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license = "MIT License" | |
license = "MIT" |
Use the short-name form https://spdx.org/licenses/MIT
name = "bond" | ||
version = "9.0.0" | ||
license = "MIT License" | ||
homepage = "https://github.com/microsoft/bond.git" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
homepage = "https://github.com/microsoft/bond.git" | |
homepage = "https://github.com/microsoft/bond" |
homepage = "https://github.com/microsoft/bond.git" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
description = "Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services." | ||
topics = ("bond", "microsoft") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
topics = ("bond", "microsoft") | |
topics = ("bond", "microsoft", "serialization", "cross-language", "schematized-data") |
|
||
def configure_cmake(self): | ||
if platform.system() == "Linux": | ||
self.run("curl -sSL https://get.haskellstack.org/ | sh", ignore_errors=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need haskell? Downloading here is not allowed, but instead you can have a Conan package for haskell.
cmake.install() | ||
if platform.system() == 'Linux': | ||
self.run("chmod +rx *", cwd=f'{self.package_folder}/bin') | ||
self.copy("FindBond.cmake", ".", ".") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.copy("FindBond.cmake", ".", ".") |
Not allowed. Use cmake_find_package
generator instead.
if platform.system() == 'Linux': | ||
self.run("chmod +rx *", cwd=f'{self.package_folder}/bin') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if platform.system() == 'Linux': | |
self.run("chmod +rx *", cwd=f'{self.package_folder}/bin') | |
if tools.os_info.is_linux: | |
self.run("chmod +rx *", cwd=f'{self.package_folder}/bin') |
Use os.chmod instead. Is there an executable here?
def package_info(self): | ||
self.cpp_info.includedirs = ['include'] | ||
self.cpp_info.libdirs = ['lib/bond'] | ||
self.cpp_info.libs = ["bond"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.cpp_info.libs = ["bond"] | |
self.cpp_info.libs = ["bond"] | |
self.cpp_info.builddirs.append(os.path.join("lib", "cmake", "bond")) | |
self.cpp_info.build_modules.append(os.path.join("lib", "cmake", "bond", "Bond.cmake")) |
The cmake file offered by author contains some macros. Conan can't re-create it, so the best approach is copying it to your package.
https://github.com/microsoft/bond/blob/master/cmake/Bond.cmake
cmake = self.configure_cmake() | ||
cmake.build() | ||
|
||
def package(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def package(self): | |
def package(self): | |
self.copy("LICENSE", dst="licenses", src="bond") | |
self.copy("Bond.cmake", dst=os.path.join("lib", "cmake", "bond"), src=os.path.join("bond", "cmake)) |
Don't forget the license
Bond.cmake seems be useful.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This pull request has been automatically closed because it has not had recent activity. Thank you for your contributions. |
Specify library name and version: lib/1.0
conan-center hook activated.