tock / libtock-rs

Rust userland library for Tock
Apache License 2.0
163 stars 109 forks source link

RFC: Use stable Rust #512

Closed bradjc closed 1 year ago

bradjc commented 1 year ago

Opening this on top of #511 as an idea to switch to using stable rust. Since we don't have to chase specific nightly versions, it seems like a good idea to just use stable rust with a minimum version for specific features we want.

But, this toolchain selection seems very confusing because again rust seems like it doesn't really support cross-compiling. What we want are very separate ways to specify the toolchain for building for embedded targets from ways to specify the toolchain for running host-side tests. It remains perplexing to me that rust still doesn't really seem to take this seriously.

Specifically, I don't know how to tell cargo "use nightly, but use a nightly with miri available". Maybe it does this automatically since we are running a miri command? I don't know.

jrvanwhy commented 1 year ago

Specifically, I don't know how to tell cargo "use nightly, but use a nightly with miri available". Maybe it does this automatically since we are running a miri command? I don't know.

It won't. rustup determines the toolchain version, cargo parses the miri command. They're not the same tool, and by the time anything knows you need Miri you're already running the wrong toolchain version.

jrvanwhy commented 1 year ago

What we want are very separate ways to specify the toolchain for building for embedded targets from ways to specify the toolchain for running host-side tests. It remains perplexing to me that rust still doesn't really seem to take this seriously.

I did some digging and found the reasoning here: https://github.com/rust-lang/rustup/issues/3355. It seems the underlying issue is that because user-defined toolchain names exist, rustup's argument syntax is limiting. It may still be possible, but I don't think it's worth the effort for us to pursue it.

bradjc commented 1 year ago

I did some digging and found the reasoning here: rust-lang/rustup#3355. It seems the underlying issue is that because user-defined toolchain names exist, rustup's argument syntax is limiting. It may still be possible, but I don't think it's worth the effort for us to pursue it.

I'm not arguing with you, but these people built an entire programming language, they could figure out how to handle host-side testing needing a different compiler than a binary for an embedded system (if they wanted to).

bradjc commented 1 year ago

Improved by #513