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

Use cargo-c instead of cmake #418

Open
nappa85 opened this issue Sep 30, 2024 · 8 comments
Open

Use cargo-c instead of cmake #418

nappa85 opened this issue Sep 30, 2024 · 8 comments
Labels
enhancement New feature or request needs info A bug report is waiting for more information

Comments

@nappa85
Copy link

nappa85 commented Sep 30, 2024

cargo-c exists exactly to ease the build of Rust programs into C libraries, it's an easier and less error-prone approach than managing the cmakefiles yourself.

@nappa85 nappa85 added the enhancement New feature or request label Sep 30, 2024
@elBoberido
Copy link
Member

We also need to support colcon via cmake and as far as I understand cargo-c, this is not easily possible. We need cmake to integrate into the C and C++ world, not to integrate C and C++ libraries into iceoryx2.

If I didn't miss anything, we are not able to use cargo-c.

@elBoberido elBoberido added the needs info A bug report is waiting for more information label Oct 29, 2024
@nappa85
Copy link
Author

nappa85 commented Oct 29, 2024 via email

@elBoberido
Copy link
Member

Does this also easily work with cross compilation and on more exotic OSes like QNX and VxWorks?

I'm a little bit hesitant to add another layer of indirection since the cmake files are not that complex and we are little bit burned by the - supposedly simple - bazel.

@nappa85
Copy link
Author

nappa85 commented Nov 1, 2024 via email

@elBoberido
Copy link
Member

It works on QNX and I think also VxWorks but I not so sure about the latter. We want to target both OSes and even more exotic ones like eMCOS which are used in safety domains.

@lu-zero
Copy link

lu-zero commented Nov 3, 2024

Does this also easily work with cross compilation and on more exotic OSes like QNX and VxWorks?

The two targets aren't currently supported since I'm taking a conservative approach since every platform has its own set of details for shared libraries.

If you have experience with any of those platform target I'd welcome a pull request to add the necessary informations:

  • if the platform uses soname to embed the library version in the library (common on unix-like elf systems)
  • which is library naming convention (e.g. lib{name}.so vs name.dll, symlinks over version minor/major)

For people with access to the platform it would take 10 minutes to prepare the patch. eMCOS isn't currently even present in the documentation so I guess its addition is very recent.

@elBoberido
Copy link
Member

eMCOS is something we recently put on our interesting project list. It is quite often used in safety critical domains, similar to VxWorks and QNX.

We also need to be conservative, since at some point everything needs to be either certified or qualified, which is very costly. Some of the dependencies we currently have will also be replaced by tailored, custum implementations due to that.

cargo-c is for sure a great project, but for us it does not add as much value as for other projects and we also do not have a complex CMake setup.

@lu-zero
Copy link

lu-zero commented Nov 10, 2024

Adding the cargo-c metadata doesn't prevent you from using your custom machinery for custom targets, but makes the life of linux distributors much easier.

If you are planning to use ferrocene, cargo-c can use that compiler as any other versions of rustc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs info A bug report is waiting for more information
Projects
None yet
Development

No branches or pull requests

3 participants