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

Patch cargo toolchain for noble #136

Merged
merged 11 commits into from
Apr 2, 2024
Merged

Patch cargo toolchain for noble #136

merged 11 commits into from
Apr 2, 2024

Conversation

Yadunund
Copy link
Member

@Yadunund Yadunund commented Mar 25, 2024

This PR allows rmw_zenoh to build on Ubuntu Noble with all dependencies resolved by rosdep, ie, users do no need to manually install cargo like we currently specify.

This is achieved by patching the zenoh-c/CMakeLists.txt file during the vendor step to drop the +stable toolchain specification. Further, we pin the version of cargo to be used as 1.75.0 on all platforms since this is the versions of cargo available via apt in Noble.

Also created a temporary rolling CI job that passes to demonstrate that the fix works. This is interim until docker image for rolling+noble is ready.

CI is working again 🎉

@Yadunund Yadunund force-pushed the yadu/noble branch 3 times, most recently from 701d9d6 to 6000d3f Compare March 25, 2024 07:11
Signed-off-by: Yadunund <[email protected]>
@Yadunund Yadunund marked this pull request as ready for review March 25, 2024 09:02
Copy link
Collaborator

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

Besides my changes inline, I think that we should consider approaching this slightly differently.

In particular, it is not whether we are on Iron or Rolling which determines whether we need to remove the ZENOHC_CARGO_CHANNEL, but rather whether we are using the toolchain from rustup, or from Ubuntu (this will also be a factor when we go to make this work on Windows).

Is there any way for us to tell whether the cargo we are using supports the various channels or not? That would be closer to what we are trying to accomplish here.

zenoh_c_vendor/CMakeLists.txt Outdated Show resolved Hide resolved
zenoh_c_vendor/CMakeLists.txt Outdated Show resolved Hide resolved
zenoh_c_vendor/CMakeLists.txt Outdated Show resolved Hide resolved
Yadunund and others added 4 commits March 26, 2024 21:31
Co-authored-by: Chris Lalancette <[email protected]>
Signed-off-by: Yadu <[email protected]>
Co-authored-by: Chris Lalancette <[email protected]>
Signed-off-by: Yadu <[email protected]>
Co-authored-by: Chris Lalancette <[email protected]>
Signed-off-by: Yadu <[email protected]>
@Yadunund
Copy link
Member Author

@clalancette thanks for the feedback. I agree with the logic proposed. I've implemented this by relying on cmake's execute_process function where I check if cargo +stable returns an error. If it does, the patch is applied.

@JEnoch
Copy link
Contributor

JEnoch commented Mar 27, 2024

eclipse-zenoh/zenoh-c#300 has been created to address this +stable flag issue in zenoh-c/CMakeLists.txt

@JEnoch
Copy link
Contributor

JEnoch commented Mar 28, 2024

eclipse-zenoh/zenoh-c#301 makes zenoh-c CMakeLists.txt to no longer use +stable by default:
https://github.com/eclipse-zenoh/zenoh-c/blob/dbc88773fdc34ec32b86e667a6369880ccbc84b8/CMakeLists.txt#L30

However this was pushed after switching Zenoh to Tokio which is currently causing some troubles

Install latest rustc.
> Note: The version of rustc that can be installed via apt is outdated.
Install latest rustc via `rustup` if building on Ubuntu Jammy.
Skip this step if building on Ubuntu Noble as `cargo` and `rustc` will be
Copy link
Member

@ruffsl ruffsl Mar 28, 2024

Choose a reason for hiding this comment

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

This is cool! When/how did that happen with rosdep? Or does Noble ship debs for rust build tools?

Copy link
Member Author

Choose a reason for hiding this comment

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

The debs are available in Jammy too but the versions are very dated so we install them via rustup to compile zenoh. Noble ships with cargo/rustc 1.75.0 which works out of the box for our use case.

@Yadunund Yadunund mentioned this pull request Mar 30, 2024
@Yadunund
Copy link
Member Author

@clalancette @JEnoch
I've taken the diff from eclipse-zenoh/zenoh-c#301 and created a local patch file such that we apply the diff from the PR when we vendor zenoh-c.
I think this a good way to benefit from changes upstream while not pinning the zenoh-c hash to a version with tokio just yet.

Copy link
Collaborator

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me to patch this for now.

@Yadunund Yadunund merged commit eac1d84 into rolling Apr 2, 2024
5 of 6 checks passed
@delete-merged-branch delete-merged-branch bot deleted the yadu/noble branch April 2, 2024 23:42
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.

4 participants