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

Bring in Rust support through the external module #78306

Merged
merged 6 commits into from
Sep 26, 2024

Conversation

d3zd3z
Copy link
Collaborator

@d3zd3z d3zd3z commented Sep 11, 2024

As discussed in the 2024-09-11 TSC, this PR brings in the work on the zephyr-collab branch with that work on an external module.

With this module. The tests and samples from the rust module will be tested by CI.

@zephyrbot
Copy link
Collaborator

zephyrbot commented Sep 11, 2024

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
zephyr-lang-rust N/A zephyrproject-rtos/zephyr-lang-rust@d2734f4 (main) N/A

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest manifest-zephyr-lang-rust DNM This PR should not be merged (Do Not Merge) labels Sep 11, 2024
@d3zd3z d3zd3z force-pushed the r/module branch 2 times, most recently from a3cb3a3 to 35c7dcb Compare September 12, 2024 14:06
@pdgendt pdgendt added the area: Rust Issues affecting Rust support in Zephyr label Sep 19, 2024
@d3zd3z d3zd3z changed the base branch from collab-rust to main September 23, 2024 15:16
Add zephyr-lang-rust as an optional module.  This module brings in
support for writing applications in Zephyr using the Rust programming
language.

At this point, the integration supports:

- Building applications with Rust support.
- CI testing of samples and tests from the rust module (twister
  functionality already present).

Still to do is adding documentation to the Zephyr docs with an overview
of Rust support as well as the generation of the rustdoc docs.

Signed-off-by: David Brown <david.brown@linaro.org>
Although the Cmake rules for Rust leave all build files in the build
directory, sometimes tools such as IDEs can leave a few files in the
source tree.  Ignore these to make sure they don't get committed.

Signed-off-by: David Brown <david.brown@linaro.org>
Although the Cmake rules to build Rust applications keeps the target
directory inside of the build directory, some IDE tools may generate a
target directory while editing the code.  Ignore these so they never get
checked in.

Signed-off-by: David Brown <david.brown@linaro.org>
Indicate that this the lang-rust module (modules/lang/rust) is
maintained.

Signed-off-by: David Brown <david.brown@linaro.org>
This is a little complicated.  We currently just jump directly to rust's
panic, so we aren't likely to actually need these unwind tables.  But, they
would be needed if we ever reall paniced.  As of the time of this change,
the tables seem to just be 24 bytes of ROM space.

Signed-off-by: David Brown <david.brown@linaro.org>
@d3zd3z d3zd3z requested review from nashif, erwango and teburd September 23, 2024 21:42
@d3zd3z d3zd3z marked this pull request as ready for review September 23, 2024 21:42
@d3zd3z d3zd3z removed the DNM This PR should not be merged (Do Not Merge) label Sep 23, 2024
@zephyrbot zephyrbot added area: Architectures area: ARM ARM (32-bit) Architecture labels Sep 25, 2024
@zephyrbot zephyrbot requested a review from bbolen September 25, 2024 05:02
@zephyrbot zephyrbot added the DNM This PR should not be merged (Do Not Merge) label Sep 25, 2024
@d3zd3z
Copy link
Collaborator Author

d3zd3z commented Sep 25, 2024

I've incorporated #78901 here as it is needed to build any rust code that can possibly panic. It only affects some Cortex-M targets.

@carlescufi carlescufi removed the DNM This PR should not be merged (Do Not Merge) label Sep 25, 2024
teburd
teburd previously approved these changes Sep 25, 2024
In order to be able to ifdef based on `CONFIG_RUST`, the config must be
defined in the main repo (because the rust module is optional).  Add
this as a placeholder.  If the module is not availabe, the symbol will
be present, and always disabled.  The module will provide a full
definition for the Kconfig.

Signed-off-by: David Brown <david.brown@linaro.org>
@zephyrbot zephyrbot added the DNM This PR should not be merged (Do Not Merge) label Sep 25, 2024
@d3zd3z d3zd3z removed the DNM This PR should not be merged (Do Not Merge) label Sep 25, 2024
@nashif nashif merged commit bd46e8d into zephyrproject-rtos:main Sep 26, 2024
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants