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

init try to bring iceoryx into CCI #5541

Merged
merged 12 commits into from
Jul 14, 2021
Merged

init try to bring iceoryx into CCI #5541

merged 12 commits into from
Jul 14, 2021

Conversation

dotChris90
Copy link
Contributor

Specify library name and version: iceoryx/1.0.0

Iceoryx https://iceoryx.io/v1.0.0/ is a new, modern and speeding fast way to do IPC on embedded devices - several other projects currently use it as their dependency like cyclone dds https://projects.eclipse.org/proposals/eclipse-cyclone-dds and eCAL https://continental.github.io/ecal/ - currently by cloning .... i would like to change this. Maybe also new projects will follow when bring them to CCI.


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes (mostly - except this "line is too long" .... tested with pycodestyle command line tool)
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@conan-center-bot

This comment has been minimized.

@dotChris90
Copy link
Contributor Author

very very stupid question here : we are running in a docker container or sth like that right? so <sys/acl.h" not present? just asking to understand the error better. ^^'

@SSE4
Copy link
Contributor

SSE4 commented May 17, 2021

very very stupid question here : we are running in a docker container or sth like that right? so <sys/acl.h" not present? just asking to understand the error better. ^^'

yes, it's docker container

@dotChris90
Copy link
Contributor Author

dotChris90 commented May 17, 2021

Some more question related to the error "missing <sys/acl.h> here :

  • i know this error is caused since we are running inside container and for that reason the package libacl1-dev is not present inside the filesystem of container
  • i tried to "overcome" this error by using the system_requirements method and validating that the header sys/acl.h is present on target system (like e.g. gtk/system package)
  • the conan hooks already print me "hey not allowed" on my local system
  • my question now is "do we have to create first a acl/system" package and bring to the CCI and after require this package when on target os = linux?
  • dont get me wrong : i would create this acl/system package on my own and make PR (i dont want to say "hey conan people do for me")
  • and i want to understand the process here : libacl1-dev (so sys/acl.h) is part of the sys folder , so i feel they are a system requirement and not a conan package requirement
  • one other question is : the CCI does not validating cross builds right? system_requirements just validating for the build system and not for the target system (so if sysroot dont contain acl - you cant do much here)
  • thanks for your patient and "enlightment" ^^

@uilianries
Copy link
Member

my question now is "do we have to create first a acl/system" package and bring to the CCI and after require this package when on target os = linux?

Yes. But this PR will be blocked, we usually don't release partial packages. We will merge acl first, then unblock iceoryx.

dont get me wrong : i would create this acl/system package on my own and make PR (i dont want to say "hey conan people do for me")

It would be great!

and i want to understand the process here : libacl1-dev (so sys/acl.h) is part of the sys folder , so i feel they are a system requirement and not a conan package requirement

I didn't check your package, but the thing is, if you need a requirement only when building, like headers or executable tools, it's a build requirement, which is much better in terms of system package (you don't want to see apt or whatever running when installing a simple Conan package).

one other question is : the CCI does not validating cross builds right? system_requirements just validating for the build system and not for the target system (so if sysroot dont contain acl - you cant do much here)

Yes. CCI doesn't do it because only native build (x64) generates more 100 packages per build. Now imagining adding cross building support or other archs ... resources, cloud, time, ...

thanks for your patient and "enlightment" ^^

No, thank you for contributing!

@uilianries
Copy link
Member

About your test package files, reduce to a simple and small file. The idea about test package is, of course, testing the package, not running an entire unit test from the project. We just need to validate linkage, if the library and headers are there. Some extra info about test package here.

self._patch_sources()

self.cmake = CMake(self)
self.cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared

CMake helper does it, it's magic: https://docs.conan.io/en/latest/reference/build_helpers/cmake.html?highlight=build_shared_libs#definitions

@dotChris90
Copy link
Contributor Author

@uilianries thanks for the information here. i was looking a little bit deeper into the problem. Yes you absolutely right. The "libacl" is absolute nothing belong to the system. my bad here. It's a lib like any other and for that reason i would suggest i bring the "libacl" first into CCI. Benefit would be that iceoryx can target systems that doesnt have acl in their sysroot. also nice.

i would not stop the PR but simple let it open until acl is part of the CCI. thanks again @uilianries for your support and explaination here.

@conan-center-bot

This comment has been minimized.

project(examples)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

Choose a reason for hiding this comment

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

Regarding this comment: #5541 (comment)

If we only want to test linkage then only these examples are sufficient:

  • icedelivery
  • icedelivery_in_c
  • singleprocess for roudi daemon build

All other example code can be removed.

class IceoryxConan(ConanFile):

name = "iceoryx"
license = " Apache-2.0"

Choose a reason for hiding this comment

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

Please remove whitespaces

@dotChris90 dotChris90 mentioned this pull request May 18, 2021
4 tasks
@dotChris90 dotChris90 mentioned this pull request May 28, 2021
4 tasks
@dotChris90
Copy link
Contributor Author

A small question before i do the next push ^^' i noticed that the project was just able to build when the libcxx == libstdc++11 for gcc6, gcc7, gcc8 on linux. it effected not just linking but also the compilation.

I saw that other recipes like

'Using Botan with GCC >= 5 on Linux requires "compiler.libcxx=libstdc++11"')
also dealing with such things by raising invalid configuration.

My question now - is this "allowed practise" in Conan Center or is there an alternative which is prefered?

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@dotChris90
Copy link
Contributor Author

@SSE4 @uilianries is there a way to try out MAC OS build local? i have a VM with Linux, a Windows OS and so validate local Linux and Windows - but how about MAC OS? is there a Container image? or some other trick?

Copy link
Contributor

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

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

Hi, @dotChris90 . I'm not sure if you have something pending before reviewing this recipe. It's not clear to me from your last comments.

So just very high-level comments:

  • It's not needed to make it work for all the configurations. Sometimes it is better to merge a first working recipe and then improve it and make it work for other architectures.
  • On the test_package I want to ask if all the files are needed/used. At least I see one README.md that can be removed.

@dotChris90
Copy link
Contributor Author

@jgsogo thanks for asking - i was hoping to make the recipe test_packages runnable inside the container but seems not easy because shared memory reason. but maybe you are right - my last local trials didnt show success. plus i was trying different ways to make recipse running for libstdc++ and not just libstdc++11 - but until now no succes.

Maybe i simple "open" the review and do improvements in the next PRs. ....

@dotChris90
Copy link
Contributor Author

the other question : i would like to test linkage of multiple artifacts to be sure i met also the "systemlibs" and requirements between the artifacts.

The Readme - yes agree - can be removed. :)

@conan-center-bot

This comment has been minimized.

@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.

@dotChris90 Thank you for your contribution, please, take a look on my review.

class IceoryxConan(ConanFile):

name = "iceoryx"
version = "1.0.0"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
version = "1.0.0"

Keep the recipe generic. The user and CI should pass the version according the conandata.yml

"toml_config": [True, False]
}
default_options = {
"shared": False,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"shared": False,
"shared": False,

No fPIC as option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that is a good point - if i remember well i raised an issue on iceoryx and discussed with them. but seems they already set this in their CMAKE-Files via POSITION_INDEPENDENT_CODE - and I was not 100% sure if it is a "must" for CCI - since the hookups didnt show red lines ^^' so my basic questions here is : is it a must if the library itself / the project already set everything in their CMakefiles? That is now sth i will follow Conan community wishes.

Copy link
Contributor

@madebr madebr Jul 13, 2021

Choose a reason for hiding this comment

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

fPIC is only a must when the library is supposed to be used in a shared library or really required by some platform.
It looks like POSITION_INDEPENDENT_CODE is used all over the code: https://github.com/eclipse-iceoryx/iceoryx/search?p=1&q=POSITION_INDEPENDENT_CODE
It is possible to patch it out, but I don't think it's worth the effort.

Copy link
Contributor

Choose a reason for hiding this comment

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

Usually we do

# Don't force PIC
tools.replace_in_file(os.path.join(self._source_subfolder, "cmake", "CompileOptions.cmake"),
"POSITION_INDEPENDENT_CODE ON", "")
but the number of files....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@prince-chrismc i will give it a try - i never saw this so far - but cool it exist.

if self.options.toml_config:
tools.rename(
os.path.join(self._pkg_etc, "roudi_config_example.toml"),
os.path.join(self._pkg_bin, "roudi_config_example.toml")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
os.path.join(self._pkg_bin, "roudi_config_example.toml")
os.path.join(self._pkg_bin, "roudi_config_example.toml")

Is it really needed? The file name is example. If is really necessary, please, move to self.package_folder/res, which is the used for configuration files in the package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmm actually again a good question - i would like to keep it and will move to res folder because : i think iceoryx is mostly used for embedded area and the component "roudi" is a executable. It could be deployed with the "deploy" generator of conan. (Actually we also do this in projects - the -g "deploy" functionality is pretty cool). and here when deploying a default configuration file would be cool. - i think i simple rename it to roudi_config.toml.

@@ -0,0 +1,318 @@
# icedelivery
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove the readme files

@@ -0,0 +1,168 @@
# icedelivery in C
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove the readme files

@conan-center-bot
Copy link
Collaborator

All green in build 11 (5778d8f2bbc4eb1cddda52c06c8cd575bc7bdc3d):

  • iceoryx/1.0.0@:
    All packages built successfully! (All logs)

Copy link
Contributor

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

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

IMO it is mostly good to merge. Great work! It can be improved later if needed, but people can start to use it and give feedback...

def _pkg_cmake(self):
return os.path.join(
self.package_folder,
"lib/cmake"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"lib/cmake"
"lib", "cmake"

self.cpp_info.names["cmake_find_package"] = "iceoryx"
self.cpp_info.names["cmake_find_multi_package"] = "iceoryx"
# platform component
self.cpp_info.components["platform"].name = "platform"
Copy link
Contributor

Choose a reason for hiding this comment

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

The components are a little on the generic side

Perhaps something like?

Suggested change
self.cpp_info.components["platform"].name = "platform"
self.cpp_info.components["iceoryx_platform"].name = "platform"

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, it would be nice to fix it, and not use global name for all generators.

Comment on lines +188 to +190
self.cpp_info.components["utils"].build_modules["cmake_find_package"] = [
os.path.join(self._module_subfolder, "conan-official-iceoryx_utils-targets.cmake")
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we not follow the usual template with one file per project?

It's a lot less code bloat

self.cpp_info.components["openmeshcore"].build_modules["cmake_find_package"] = [self._module_file_rel_path]

iox-cpp-publisher iox-cpp-publisher-untyped
PROPERTIES
CXX_STANDARD_REQUIRED ON
POSITION_INDEPENDENT_CODE ON
Copy link
Contributor

Choose a reason for hiding this comment

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

Not required for executables AFAIK

Suggested change
POSITION_INDEPENDENT_CODE ON

def validate(self):
os = self.settings.os
compiler = self.settings.compiler
version = tools.Version(self.settings.compiler.version)
Copy link
Contributor

Choose a reason for hiding this comment

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

For my own tracking purposes conan-io/conan#8002

Comment on lines +24 to +32
add_executable(iox-cpp-publisher ./iox_publisher.cpp)
target_link_libraries(iox-cpp-publisher
iceoryx_posh::iceoryx_posh
)

add_executable(iox-cpp-publisher-untyped ./iox_publisher_untyped.cpp)
target_link_libraries(iox-cpp-publisher-untyped
iceoryx_posh::iceoryx_posh
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are both required? they seem to be testing the same part of the library... I am undering if the test_package could be trimmed a little bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@prince-chrismc i will "shrink" them again - but probably you are right. the main thing is the C++ target can be found and the C target can be found

@dotChris90
Copy link
Contributor Author

@prince-chrismc i will bring your suggestions into the code and let it rebuild. thanks for the comments.

@conan-center-bot conan-center-bot merged commit 05fefbd into conan-io:master Jul 14, 2021
@dotChris90
Copy link
Contributor Author

@prince-chrismc - i will pay back my depth in a separate PR ....

@prince-chrismc
Copy link
Contributor

@prince-chrismc - i will pay back my depth in a separate PR ....

I honestly would have been less picky if I saw it was so close to being merged... any future PRs are always welcomed!

AndreyMlashkin pushed a commit to AndreyMlashkin/conan-center-index that referenced this pull request Jul 19, 2021
* init try to bring iceoryx into CCI

* according to FAQs

* add cmakewrapper and remove patch

* add dependency acl

* reduced tests for linkage

* adding more validation

* included atomic and force libstdc++11 on clang too

* acl just required by linux

* allow windows and force C++14 in test

* rt lib just for linux

* just support Visual Studio compiler 16 and higher

* corrected smalles changes. config now in res folder
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.

9 participants