-
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 aws-cdi-sdk 2.2.0 #7407
add aws-cdi-sdk 2.2.0 #7407
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@SSE4 this is not blocked any more |
recipes/aws-cdi-sdk/all/conanfile.py
Outdated
self.options["aws-sdk-cpp"].monitoring = True | ||
self.options["aws-sdk-cpp"].shared = True | ||
self.options["aws-libfabric"].shared = 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.
These can be overridden by consumers so if these are requirements then they should be moved to a validate method
recipes/aws-cdi-sdk/all/conanfile.py
Outdated
# build aws-cpp-sdk-cdi | ||
cmake = self._configure_cmake() | ||
cmake.build() | ||
cmake.install() |
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.
This should be called in the package method
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.
see below
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.
Doing install in build
breaks the following use case:
conan create . aws-cdi-sdk/2.2.0@
conan create . aws-cdi-sdk/2.2.0@ -kb
So you need to pass a CMAKE_INSTALL_PREFIX
variable to cmake and add the --prefix=
argument to autotools.
recipes/aws-cdi-sdk/all/conanfile.py
Outdated
autotools = self._configure_autotools() | ||
with tools.chdir(self._source_subfolder): | ||
vars = autotools.vars | ||
# configure autotools to find aws-cpp-sdk-cdi |
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 explain why this is required? I do not understand why it's being build twice 😕
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.
The package contains two components:
- a AWS SDK plugin under the
aws-cpp-sdk-cdi
subfolder which is built with cmake - the library itself which is built with make
The library depends on the plugin and that's why I need to install it here and tell the library where to find it
recipes/aws-cdi-sdk/all/conanfile.py
Outdated
|
||
def validate(self): | ||
if self.settings.os != "Linux": | ||
raise ConanInvalidConfiguration("The aws-cdi-sdk con only be built on Linux.") |
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.
Windows could be supported. https://github.com/aws/aws-cdi-sdk/blob/mainline/INSTALL_GUIDE_WINDOWS.md#build-the-aws-cdi-sdk
raise ConanInvalidConfiguration("The aws-cdi-sdk con only be built on Linux.") | |
raise ConanInvalidConfiguration("This recipe currently only supports Linux. Feel free to contribute other platforms!") |
-# Ensure that the location of the AWS SDK source code tree was specified unless explicitly opted out. Define and augment | ||
-# some variables needed for building and linking to the AWS SDK. | ||
-ifeq ($(require_aws_sdk),yes) |
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.
This does not seem required to build the library 🤔 can you explain what this patch is for please?
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.
the original package builds libfabric and the AWS SDK itself and here I remove that part
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.
I think you can reduce the patch size by surrounding the disabled parts with e.g. ifeq('1','0')
and endif
.
See https://www.gnu.org/software/make/manual/html_node/Conditionals.html#Conditionals
It makes porting the patch to newer releases easier, I think.
recipes/aws-cdi-sdk/all/conanfile.py
Outdated
if self._cmake: | ||
return self._cmake | ||
self._cmake = CMake(self) | ||
self._cmake.definitions["CPP_STANDARD"] = self._cmake.definitions.get("CONAN_CMAKE_CXX_STANDARD", "11") |
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.
I would have expected this to come from the users profile/settings
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.
Excellent start!
I'd love to point you to our docs, https://github.com/conan-io/conan-center-index/blob/master/docs/how_to_add_packages.md#cmake for some examples
also #3951 which is not official but a great summary of what we've been following...
I fear your patches might be too large for us to accept since they will be very difficult to maintain
This comment has been minimized.
This comment has been minimized.
The way the original package is built is by downloading the AWS SDK, copying the |
recipes/aws-cdi-sdk/all/conanfile.py
Outdated
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) | ||
|
||
def package_info(self): | ||
self.cpp_info.libs = self.collect_libs() |
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.
Looking at the logs I only saw one lib being build/installed
self.cpp_info.libs = self.collect_libs() | |
self.cpp_info.libs = ["aws-cpp-sdk-cdi"] |
recipes/aws-cdi-sdk/all/conanfile.py
Outdated
self.cpp_info.libs = self.collect_libs() | ||
if self.settings.os == "Linux": | ||
self.cpp_info.defines = ["_LINUX"] | ||
self.cpp_info.requires = ["aws-sdk-cpp::monitoring", "aws-libfabric::aws-libfabric"] |
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.
--- a/aws-cpp-sdk-cdi/CMakeLists.txt | ||
+++ b/aws-cpp-sdk-cdi/CMakeLists.txt | ||
@@ -1,4 +1,39 @@ | ||
-add_project(aws-cpp-sdk-cdi "C++ SDK for the AWS cdi service" aws-cpp-sdk-core) |
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.
Maybe the find_package
could be called from the wrapper?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
recipes/aws-cdi-sdk/all/conanfile.py
Outdated
default_options = { | ||
"aws-libfabric:shared": True, | ||
"aws-sdk-cpp:shared": 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.
Don't do that. Force these values in configure()
, then check in validate()
.
recipes/aws-cdi-sdk/all/conanfile.py
Outdated
cppSdk.set_property("cmake_file_name", "aws-cpp-sdk-cdi") | ||
cppSdk.set_property("cmake_target_name", "aws-cpp-sdk-cdi") | ||
cppSdk.set_property("pkg_config_name", "aws-cpp-sdk-cdi") | ||
|
||
# TODO: to remove in conan v2 once cmake_find_package_* generators removed | ||
# TODO: Remove the namespace on CMake targets | ||
cppSdk.names["cmake_find_package"] = "aws-cpp-sdk-cdi" | ||
cppSdk.names["cmake_find_package_multi"] = "aws-cpp-sdk-cdi" | ||
cppSdk.names["pkg_config"] = "aws-cpp-sdk-cdi" |
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.
it's not consistent. CMakeDeps
provides aws-cpp-sdk-cdi
imported target, and cmake_find_package*
aws-cdi-sdk::aws-cpp-sdk-cdi
.
What is the correct imported target upstream?
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.
I've set both to be AWS::aws-cpp-sdk-cdi
similar to the aws-sdk-cpp package.
I couldn't anything existing practice upstream.
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 you don't know how to deduce imported targets from upstream CMakeLists (not always obvious), you can inspect packaged files locally:
- comment out the deletion of cmake files during packaging.
- inspect
lib/cmake/aws-cpp-sdk-cdi/aws-cpp-sdk-cdi-targets.cmake
in package folder and grepadd_library
to see imported targets names, and therefore deducecmake_target_name
of each component.
From what I can see in build log, cmake_file_name
is aws-cpp-sdk-cdi
:
-- Installing: /home/conan/w/BuildSingleReference/.conan/data/aws-cdi-sdk/2.2.0/_/_/package/7e1489d0a9b824ecd6e0f2c6473d3bdf325c0375/lib/cmake/aws-cpp-sdk-cdi/aws-cpp-sdk-cdi-targets.cmake
-- Installing: /home/conan/w/BuildSingleReference/.conan/data/aws-cdi-sdk/2.2.0/_/_/package/7e1489d0a9b824ecd6e0f2c6473d3bdf325c0375/lib/cmake/aws-cpp-sdk-cdi/aws-cpp-sdk-cdi-targets-release.cmake
-- Installing: /home/conan/w/BuildSingleReference/.conan/data/aws-cdi-sdk/2.2.0/_/_/package/7e1489d0a9b824ecd6e0f2c6473d3bdf325c0375/lib/cmake/aws-cpp-sdk-cdi/aws-cpp-sdk-cdi-config.cmake
-- Installing: /home/conan/w/BuildSingleReference/.conan/data/aws-cdi-sdk/2.2.0/_/_/package/7e1489d0a9b824ecd6e0f2c6473d3bdf325c0375/lib/cmake/aws-cpp-sdk-cdi/aws-cpp-sdk-cdi-config-version.cmake
And by the way, I forgot to say that cmake_file_name
property at component level doesn't make sense for conan.
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.
Thanks for your comment. aws-cpp-sdk-cdi
is the C++ component. The main C component is named aws-cdi-sdk
and doesn't have upstream cmake files installed.
I've removed file name properties from components but I don't see any other problem with the current package info. I'd be glad if you can suggest what is the correct info in your opinion.
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.
I see. Very confusing build system: why do they mix CMakeLists to build aws-cpp-sdk-cdi & raw Makefile to build aws-cdi-sdk?
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.
I guess different people worked on each component
recipes/aws-cdi-sdk/all/conanfile.py
Outdated
cSdk.set_property("cmake_file_name", "aws-cdi-sdk") | ||
cSdk.set_property("cmake_target_name", "aws-cdi-sdk") | ||
cSdk.set_property("pkg_config_name", "aws-cdi-sdk") | ||
|
||
# TODO: to remove in conan v2 once cmake_find_package_* generators removed | ||
# TODO: Remove the namespace on CMake targets | ||
cSdk.names["cmake_find_package"] = "aws-cdi-sdk" | ||
cSdk.names["cmake_find_package_multi"] = "aws-cdi-sdk" | ||
cSdk.names["pkg_config"] = "aws-cdi-sdk" |
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.
Same comment than #7407 (comment)
This comment has been minimized.
This comment has been minimized.
recipes/aws-cdi-sdk/all/conanfile.py
Outdated
self.cpp_info.names["cmake_find_package"] = "AWS" | ||
self.cpp_info.names["cmake_find_package_multi"] = "AWS" | ||
self.cpp_info.filenames["cmake_find_package"] = "aws-cdi-sdk" | ||
self.cpp_info.filenames["cmake_find_package_multi"] = "aws-cdi-sdk" | ||
|
||
cppSdk = self.cpp_info.components["aws-cpp-sdk-cdi"] | ||
cppSdk.libs = ["aws-cpp-sdk-cdi"] | ||
|
||
cppSdk.requires = ["aws-sdk-cpp::monitoring", "aws-libfabric::aws-libfabric"] | ||
|
||
cppSdk.set_property("cmake_file_name", "aws-cpp-sdk-cdi") | ||
cppSdk.set_property("cmake_target_name", "AWS::aws-cpp-sdk-cdi") | ||
cppSdk.set_property("pkg_config_name", "aws-cpp-sdk-cdi") | ||
|
||
# TODO: to remove in conan v2 once cmake_find_package_* generators removed | ||
# TODO: Remove the namespace on CMake targets | ||
cppSdk.names["cmake_find_package"] = "aws-cpp-sdk-cdi" | ||
cppSdk.names["cmake_find_package_multi"] = "aws-cpp-sdk-cdi" | ||
cppSdk.names["pkg_config"] = "aws-cpp-sdk-cdi" | ||
|
||
cSdk = self.cpp_info.components["cdisdk"] | ||
cSdk.libs = ["cdisdk"] | ||
cSdk.requires = ["aws-cpp-sdk-cdi"] | ||
if self.settings.os == "Linux": | ||
cSdk.defines = ["_LINUX"] | ||
|
||
cSdk.set_property("cmake_file_name", "aws-cdi-sdk") | ||
cSdk.set_property("cmake_target_name", "AWS::aws-cdi-sdk") | ||
cSdk.set_property("pkg_config_name", "aws-cdi-sdk") | ||
|
||
# TODO: to remove in conan v2 once cmake_find_package_* generators removed | ||
# TODO: Remove the namespace on CMake targets | ||
cSdk.names["cmake_find_package"] = "aws-cdi-sdk" | ||
cSdk.names["cmake_find_package_multi"] = "aws-cdi-sdk" | ||
cSdk.names["pkg_config"] = "aws-cdi-sdk" | ||
|
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.
still wrong and inconsistent. See #7407 (comment)
This comment has been minimized.
This comment has been minimized.
Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
All green in build 2 (
|
Specify library name and version: aws-cdi-sdk/2.2.0
conan-center hook activated.