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

Rust module support #732

Merged
merged 5 commits into from
Sep 9, 2024
Merged

Rust module support #732

merged 5 commits into from
Sep 9, 2024

Conversation

jnippula
Copy link

@jnippula jnippula commented Aug 7, 2024

Basic Rust module build support

Rust compiler setup
cmake support for px4 rust module creation
Dockerfile modifications for Rust build in CI
Submodules:

  • PX4/Nuttx adaptation library for Rust modules (rust_px4_nuttx)
    • Alloc (for String, vector, etc)
    • Basic rust logger support
    • nuttx udp socket send and recv
    • hrt_timer support
  • Simple example app (rust_module_example)

@jnippula jnippula marked this pull request as draft August 7, 2024 15:30
@jnippula jnippula force-pushed the rust-build branch 13 times, most recently from ee25b02 to c55a6f6 Compare August 13, 2024 09:55
@jnippula jnippula requested a review from jlaitine August 13, 2024 09:55
@jnippula jnippula marked this pull request as ready for review August 13, 2024 10:01
cmake/px4_add_rust_module.cmake Outdated Show resolved Hide resolved
cmake/px4_add_rust_module.cmake Outdated Show resolved Hide resolved
@jnippula jnippula force-pushed the rust-build branch 2 times, most recently from 39c092e to 00c34e5 Compare September 4, 2024 13:00
@jnippula
Copy link
Author

jnippula commented Sep 5, 2024

Now added the rust module support into the existing cmake/px4_add_module.cmake file, rust module can be configured in cmakelists file like that:

px4_add_module(
	MODULE modules__rust_module_test
	MAIN rust_module_test
	LANG Rust
	RUST_MOD
		rust_mod
	)

@jnippula
Copy link
Author

jnippula commented Sep 5, 2024

Note, that local build env does not need any Rust build support in case there is no rust module enabled in defconfig file. So no local env changes needed for those developers who don't work with rust components.

@jnippula jnippula force-pushed the rust-build branch 3 times, most recently from c57a974 to 3cf65e4 Compare September 5, 2024 08:10
@jnippula
Copy link
Author

jnippula commented Sep 5, 2024

Rust parts moved to separate repos and added as submodules

@jnippula jnippula merged commit 5d0d665 into main Sep 9, 2024
28 checks passed
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.

3 participants