Add support for Zephyr OS #629
Labels
major-change
A proposal to make a major change to rustc
major-change-accepted
A major change proposal that was accepted
T-compiler
Add this label so rfcbot knows to poll the compiler team
Proposal
In their own words:
Notably for embedded development it has achieved Bluetooth qualification making it comparable with the ESPIDF framework that is already supported within rust (see riscv32imc-esp-espidf target)
Unlike ESPIDF however, it supports a huge number of boards and SOCs from a range of manufactures are architectures. This may make offering full support impossible, if not extremely difficult. This proposal is to add the base OS level integration, starting with a few specific targets with architectures already supported by rustc.
Some support for adding Zephyr to rust has already been done by tylerwhall in his zephyr-rust repo. Many of the changes necessary to
std
have already been completed as a proof of concept.Initially I would propose adding the following targets, along with a justification for each. Whilst there are more QEMU arches supported by rust, I see these as the primary and most useful for an initial proposal.
I have already (misguidedly) created rust-lang/libc#3184 with the first round of changes, and now seek advice and guidance on if this is a feature Rust would like to see.
Tier 3 policy
Tier 3 policy:
I pledge to do my best maintaining support for Zephyr OS at and OS level, I will not be able to support targets for all possible hardware but will aim to support all QEMU capable targets as a base for others.
The proposed triples are subject to discussion, however for consistency the unknown vendor portion has been omitted.
I do not believe the targets cause any confusion.
Building flashable binaries for Zephyr requires a multi-stage compilation, which is massively helped by the Zephyr meta tools
West
, which in turn uses cmake. All these tools are fully open source.The Zephyr Project is licensed under Apache-2.0
Understood.
There may be a requirement to install West and checkout the Zephyr project in full. The majority of these are licensed under Apache-2.0, however a few are licensed under BSD-style licenses which are compatible with the Rust MIT license at a minimum (and I would assume the Apache-2.0 license given their current usage).
As previously said it's using open source tools only.
To the best of my ability to search there are no such terms present.
I'm not the reviewer here.
Again I'm not the reviewer here.
Instructions for building for Zephyr will need to be developed alongside compiler, core, and std support, as the final flashable executable needs to be manipulated to form a complete binary. This will be similar to how the
esp-rs
project is currently building images for ESPIDF.Understood.
Understood.
The inclusion of the zephyr OS should have no bearing on existing targets.
There should be no such issues here as where hardware support for features is not present (see riscv32imc not supporting hardware atomics), Zephyr already includes C software implementations.
Mentors or Reviewers
This is my first contribution to Rust and as such I do not know who would be the most appropriate reviewer to mention. As such I would very much appreciate a mentor to guide me through the process.
Process
The main points of the Major Change Process are as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.
The text was updated successfully, but these errors were encountered: