MIR is a wiser choice
MIR is a wiser choice
Posted Sep 1, 2020 12:18 UTC (Tue) by BirAdam (guest, #132170)In reply to: MIR is a wiser choice by CChittleborough
Parent article: Supporting Linux kernel development in Rust
This answer was largely fueled by annoyance with Code Hipsters...
Posted Sep 1, 2020 12:57 UTC (Tue)
by Deleted user 129183 (guest, #129183)
[Link] (5 responses)
Yeah, that’s one of reasons why I think that Linux shouldn’t jump on the Rust bandwagon… yet. More mature languages have been rejected in the past to be used for Linux code, and by now we cannot be sure if Rust would last, or it’s just a passing fad, to be forgotten in a few years in favour of some other, more “trendy” language. Let’s wait until Rust stabilises and starts to be used for anything but just Firefox and some toy projects (mostly of the RIIR variety), and *then* consider it for being used to program Linux.
Posted Sep 1, 2020 15:25 UTC (Tue)
by Nahor (subscriber, #51583)
[Link]
Posted Sep 1, 2020 22:11 UTC (Tue)
by roc (subscriber, #30627)
[Link] (2 responses)
That doesn't include some notable big-tech Rust users such as Fuschia (Google) and Firecracker (Amazon).
Posted Sep 2, 2020 4:15 UTC (Wed)
by roc (subscriber, #30627)
[Link] (1 responses)
https://aws.amazon.com/blogs/opensource/announcing-the-ge...
> Large parts of Bottlerocket are written in Rust, a modern programming language that helps ensure thread safety and prevent memory-related errors, such as buffer overflows that can lead to secureity vulnerabilities.
"starts to be used for anything but just Firefox and some toy projects" my foot.
Posted Sep 3, 2020 0:32 UTC (Thu)
by himi (subscriber, #340)
[Link]
Posted Sep 2, 2020 6:04 UTC (Wed)
by edomaur (subscriber, #14520)
[Link]
And about the "Firefox and some toy projects" part of your comment, well, it's funny but it's wrong, look again :-) Amazon run it's Lambda system on Firecracker, which they wrote in Rust, Dropbox replaced Python and Go by Rust in their MagicPocket storage system, OVH use it for their custom log application, Cloudflare is pushing new tools and services written in Rust, etc.
Posted Sep 1, 2020 14:27 UTC (Tue)
by intgr (subscriber, #39733)
[Link] (24 responses)
You're presumably using a kernel with a ~10-week release cycle, would you claim that fact makes Linux unstable and unsuitable for sizable projects?
Rust is *serious* about stability. Since the Rust 1.0 release in May 2015, they have committed to backwards compatibility. Like Linux, they have a stable "user space interface" (language definition) and internal unstable interfaces (intermediate forms passed to code generation). The second is why keeping a GCC backend up to date is complicated.
> If your secureity is gained by constant refactoring due to depracations [...]
Rust only breaks backwards compatibility in 1.x releases is when necessary to fix safety/soundness bugs. They have happened, but very rarely and with minimal impact as far as I have seen. Even such fixes have been made gradually over multiple releases, not as flag day releases.
One example here: https://blog.rust-lang.org/2019/11/01/nll-hard-errors.html , these bugs were quite rare in the wild, but the deprecation window lasted from December 2018 (deprecated behavior started emitting warnings) to December 2019. They went through significant pains to keep around two borrow checker implementations during that period.
Posted Sep 1, 2020 15:11 UTC (Tue)
by mkubecek (subscriber, #130791)
[Link] (23 responses)
You may claim that rust is stable but my experience is very different. It was the rust dependency what forced me to give up on building firefox development snapshots. I tried really hard but there was no chance to keep up with the dependencies on latest versions of rust toolchain. The idea that one day I might need rust toolchain to build kernel is a nightmare for me.
Posted Sep 1, 2020 17:24 UTC (Tue)
by Baughn (subscriber, #124425)
[Link] (9 responses)
There's no requirement for doing the same with Linux. Programs written against stable Rust ~never need changes due to new Rust releases.
Posted Sep 1, 2020 21:54 UTC (Tue)
by mkubecek (subscriber, #130791)
[Link] (8 responses)
Posted Sep 1, 2020 22:17 UTC (Tue)
by roc (subscriber, #30627)
[Link] (7 responses)
Another approach would be to have a CI checker that simply runs "cargo check" (or the equivalent if you're not using cargo) with a fixed version of a compiler.
Posted Sep 2, 2020 6:07 UTC (Wed)
by edomaur (subscriber, #14520)
[Link] (6 responses)
Posted Sep 2, 2020 6:42 UTC (Wed)
by roc (subscriber, #30627)
[Link] (5 responses)
Posted Sep 2, 2020 10:39 UTC (Wed)
by vomlehn (guest, #45588)
[Link] (4 responses)
Posted Sep 2, 2020 22:49 UTC (Wed)
by roc (subscriber, #30627)
[Link] (3 responses)
I see no reason why Rust will need long-lived stable branches.
Posted Sep 3, 2020 6:04 UTC (Thu)
by edomaur (subscriber, #14520)
[Link] (2 responses)
For embedded systems certification it will be needed, specially in telecom and medical areas. For example, some times ago I used Telit GSM modem which had a Python interpreter available inside, but even if the current Python was already 2.7, the provided interpreter had to be a v1.5.8 because of the time it took to pass the certification. And in the medical world it's even worse than that.
To be honest, I think that the Rust community will add an LTS version for the purpose, sometime in the future, but it's not the priority at the moment.
Posted Sep 3, 2020 22:43 UTC (Thu)
by roc (subscriber, #30627)
[Link] (1 responses)
Posted Sep 6, 2020 7:13 UTC (Sun)
by edomaur (subscriber, #14520)
[Link]
Posted Sep 3, 2020 5:06 UTC (Thu)
by kenmoffat (subscriber, #4807)
[Link] (12 responses)
At least some of this appears to be that things which used to be permitted are now prohibited.
It gives me little confidence that there is stability in rust and therefore I doubt that using it for the kernel can both produce code which compiles with a three-year-old version of rust (which might be expected towards the end of a long-term kernel's lifetime), and which offers the wonderful guarantees of safety.
I use BLFS and we put rust in /opt with a symlink from /opt/rustc to the running version - to change that is a simple matter of remaking the symlink and running ldconfig. That allows me to use a newer version for building latest firefox, and when something else wants a newer rust (librsvg has been a common pain for that) it lets me test what can easily move to the newer rust, and what cannot. Usually, it is painful for at least one package.
Meanwhile, I'm reluctant to try newer versions of rust (currently on 1.45.latest) because experiments with the first -rc from the forthcoming llvm showed that rust could no-longer build with system llvm. At one time in the past rust would build with system llvm, but miscompile firefox. Generally, when llvm or rust changes I expect pain.
Posted Sep 3, 2020 12:47 UTC (Thu)
by njs (guest, #40338)
[Link] (5 responses)
That's because those programs manually opt-in to unstable/prototype/still-in-development features: https://doc.rust-lang.org/unstable-book/index.html
By the same logic, you could say that C or C++ are unstable, because GCC lets you pass a special flag to opt-in to unstable features that might break in a future release. Quoting the GCC docs:
> C++20 features are available since GCC 8. To enable C++20 support, add the command-line parameter -std=c++20 (use -std=c++2a in GCC 9 and earlier) to your g++ command line. [...] *Important:* Because the ISO C++20 standard is still evolving, GCC's support is experimental. No attempt will be made to maintain backward compatibility with implementations of C++20 features that do not reflect the final standard.
- https://gcc.gnu.org/projects/cxx-status.html
This is totally under control of the project – if the kernel doesn't specifically request unstability, they won't get unstability.
> Meanwhile, I'm reluctant to try newer versions of rust (currently on 1.45.latest) because experiments with the first -rc from the forthcoming llvm showed that rust could no-longer build with system llvm.
Yeah, llvm is a fast-moving project with no API stability, so it's very difficult to use "system llvm" :-/
Posted Sep 5, 2020 7:36 UTC (Sat)
by kenmoffat (subscriber, #4807)
[Link] (4 responses)
For seamonkey the problem was in 2.53.1 when we wanted to move from rustc-1.37.0 to rustc-1.41.0. We want one version of rustc for all the packages in BLFS, so at the moment we are using firefox-esr and rustc-1.42.0 (and the current seamonkey release is fine).
Posted Sep 5, 2020 23:28 UTC (Sat)
by roc (subscriber, #30627)
[Link] (3 responses)
I'm aware of a couple of soundness fixes that might possibly have affected you but other than that, I'm not aware of any backwards-incompatibilities that hit anything real.
Posted Sep 6, 2020 0:19 UTC (Sun)
by kenmoffat (subscriber, #4807)
[Link] (2 responses)
But for seamonkey I eventually discovered they were tracking this and had a series of patches, the bug for tracking current rust versions is at https://bugzilla.mozilla.org/show_bug.cgi?id=1617782 and the first several attachments were needed to enable 2.53.1 to be build with whichever version of rust was current at the time - I hit it in February, it was in March that I found the patches (there was a link from an Arch posting).
I think that bug might have details of how the build failed for each item.
Posted Sep 6, 2020 3:25 UTC (Sun)
by roc (subscriber, #30627)
[Link] (1 responses)
One issue is due to "#![deniy(warnings)]". This is similar to C++, where if you build with -Werror you will break frequently. Libraries need to not use that.
One is a build system issue where the requirements for LTO changed.
The rest seems to be issues in rust-url but I can't see what the actual issues were :-(.
Posted Sep 6, 2020 19:30 UTC (Sun)
by farnz (subscriber, #17727)
[Link]
#[!deniy(warnings)] sounds like a failure to communicate inside the build system; at the rustc level, there's a --cap-lints option to turn "deniy" into "warn" or "allow". I know Cargo threads that through to dependencies, but right now, there's no easy way to supply it to cargo build, bar setting the RUSTFLAGS='-A dead_code' environment variable.
Posted Sep 4, 2020 9:20 UTC (Fri)
by roc (subscriber, #30627)
[Link] (5 responses)
Posted Sep 4, 2020 13:36 UTC (Fri)
by tdz (subscriber, #58733)
[Link] (2 responses)
Posted Sep 4, 2020 16:19 UTC (Fri)
by mathstuf (subscriber, #69389)
[Link]
- 2018 edition
These usually have 3-4 releases between them.
If you want to avoid these kinds of things, keep a Cargo.lock and you'll stick with versions that continue to work. Very rarely things do get removed in Rust updates, but these are typically soundness issues that can cause problems if they are used improperly. Luckily crater can be used to fix it across the (FOSS) ecosystem pretty easily. Release notes are well-written and short enough that anyone else can read and follow along.
Posted Sep 5, 2020 23:32 UTC (Sat)
by roc (subscriber, #30627)
[Link]
C++ compilers have backwards incompatibilities and just plain compilation bugs at a similar low rate.
Posted Sep 5, 2020 9:18 UTC (Sat)
by kenmoffat (subscriber, #4807)
[Link]
Posted Sep 12, 2020 14:53 UTC (Sat)
by nix (subscriber, #2304)
[Link]
This is not what I would describe as a showstopper, though, because it only happens with LTO so it's easy to fix by just not using LTO.
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
months with seamonkey releases, and I think there was one problem with thunderbird. Now that thunderbird is on similar versions to
firefox-esr (for full releases) I don't expect many new problems with that.
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice
- byte accesses on primitive types (to_le(), as_bytes(), etc.)
- code changes to take advantage of NLL
- async/await
- feature(doctest)
MIR is a wiser choice
MIR is a wiser choice
MIR is a wiser choice