facebookexperimental / facebookexperimental/hermit
Support for rustc stable
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
Currently, Hermit and Reverie both require Rust nightly features. This can be easily seen with the following ripgrep calls (first reverie, second hermit):
```
austin@GANON:~/src/reverie$ rg -t rust '#!\[feature'
experimental/reverie-sabre/src/lib.rs
9:#![feature(ffi_returns_twice)]
reverie-ptrace/src/lib.rs
32:#![feature(internal_output_capture)]
tests/standalone/parallel_tasks.rs
9:#![feature(get_mut_unchecked)]
10:#![feature(thread_id_value)]
```
```
austin@GANON:~/src/hermit$ rg -t rust '#!\[feature'
tests/rust/mem_race.rs
9:#![feature(get_mut_unchecked)]
10:#![feature(thread_id_value)]
11:#![feature(atomic_mut_ptr)]
detcore/src/lib.rs
11:#![feature(async_closure)]
12:#![feature(map_first_last)]
13:#![feature(nonzero_ops)]
detcore/tests/parallelism/mod.rs
9:#![feature(get_mut_unchecked)]
10:#![feature(thread_id_value)]
11:#![feature(atomic_mut_ptr)]
detcore/tests/testutils/src/lib.rs
11:#![feature(trace_macros)]
```
---
Rust nightly generally requires extra contortions in order to support in most package managers; infamously, some people even trick the compiler into allowing these features on the stable branch [using evil, dark magic](https://github.com/search?q=repo%3ANixOS%2Fnixpkgs+RUSTC_BOOTSTRAP+language%3ANix&type=code&l=Nix). In fact, I have gotten a working build of Hermit inside Nixpkgs (nixos/nixpkgs#212278), but I am uneasy about using such evil magic and people will *probably* get upset about it.
Therefore I am filing this bug as a general "meta issue" to keep track of the question: would it be possible to use Hermit with a stable Rust compiler? And if it can be done, what's needed to do so, and what's blocking it from happening? If there's *no* chance of supporting stable Rust, that should also be clarified, but in my experience a lot of Nightly features come down to "this is significantly easier than the workaround."
Some of these definitely *look* like conveniences e.g. `map_first_last` or `atomic_mut_ptr` (I believe these can be worked around with some copy/pasting or unsafe magic), while others come across as more fundamental such as `ffi_returns_twice`; but maybe it's nothing some good old fashioned assembly programming can't handle.
Please note this isn't a critical requirement or anything or something time sensitive; it's not like I'm literally stuck without this. But I figured it would be nice to get the conversation rolling.
Contributor guide
Assessment
This issue has not been assessed yet.