tock / libtock-rs

Rust userland library for Tock
Apache License 2.0
161 stars 108 forks source link

[RFC] How can we stabilize the library? #62

Open torfmaster opened 5 years ago

torfmaster commented 5 years ago

Use stable rust

Many crates (like cortex-m, cortex-m-rt etc.) can now be used using only stable features of Rust. As the tock kernel itself is language-agnostic it should be no problem to move libtock-rs to stable rust.

Advantages:

Disadvantages:

Define a "supported" version of the kernel

libtock-c and libtock-rs tend to diverge. Some drivers are only supported in libtock-c and some examples exist only for libtock-rs. Moreover, the abi was changed in incompatible ways. I have some suggestions (non-exhaustive) here

Stabilize the toolchain

My main tool for testing and developing libtock-rs is the run-example script. However, other boards are (accidentally) not supported. We could

I'd be interested in your opinions.

Woyten commented 5 years ago

Have you tried removing the feature flags one by one? I did, but I got stuck very early (Don't remember where exactly).

jrvanwhy commented 5 years ago

Off the top of my head, the following two things would get in the way:

torfmaster commented 5 years ago

I don't know exactly about the details, however, you can build no-std-binaries (which are probably actually libraries) using stable rust and the cortex-m-rt crate. Regarding inline assembly: We are using so little of it, we could link the few lines against an external assembly-file, if we wanted.

jrvanwhy commented 2 years ago

After https://github.com/tock/libtock-rs/pull/380 is merged and Rust 1.39.0 1.59.0 is released (which stabilizes asm! and global_asm!), libtock-rs will work on stable Rust.

There are a couple things that will still require a nightly toolchain:

  1. cargo miri
  2. Providing a global memory allocater. IIRC, this was blocked on https://github.com/rust-lang/rust/issues/66741
hudson-ayers commented 2 years ago

I think that should be Rust 1.59.0

jrvanwhy commented 2 years ago

I think that should be Rust 1.59.0

Good catch, fixed.