I'd like some instructions on what prerequisites are needed to build Hermit. The documentation only mentions running cargo build
, but that does not work for me out of the box on the rust
Docker image. I've also tried using the Dockerfile in the docker
branch here, but that doesn't even have cargo
.
$ docker run -it rust # on host
$ rustc --version # in container
rustc 1.75.0-nightly (0f44eb32f 2023-11-09)
$ git clone https://github.com/facebookexperimental/hermit
$ apt-get update
$ apt-get install libunwind-dev # based on steps in .github/workflows
$ cargo build
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
Compiling detcore v0.0.0 (/hermit/detcore)
Compiling regex-automata v0.1.10
Compiling overload v0.1.1
Compiling unwind-sys v0.1.3
Compiling time-core v0.1.2
Compiling num_threads v0.1.6
Compiling nu-ansi-term v0.46.0
Compiling time v0.3.30
Compiling tracing-log v0.1.4
Compiling tracing-serde v0.1.3
Compiling sharded-slab v0.1.7
error[E0432]: unresolved import `raw_cpuid::cpuid`
--> detcore/src/lib.rs:50:5
|
50 | use raw_cpuid::cpuid;
| ^^^^^^^^^^^-----
| | |
| | help: a similar name exists in the module (notice the capitalization): `CpuId`
| no `cpuid` in the root
|
note: found an item that was configured out
--> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/raw-cpuid-10.7.0/src/lib.rs:128:14
|
128 | macro_rules! cpuid {
| ^^^^^
error[E0432]: unresolved import `reverie::syscalls::Fork`
--> detcore/src/lib.rs:58:5
|
58 | use reverie::syscalls::Fork;
| ^^^^^^^^^^^^^^^^^^^^^^^ no `Fork` in the root
error[E0432]: unresolved import `reverie::Rdtsc`
--> detcore/src/lib.rs:68:5
|
68 | use reverie::Rdtsc;
| ^^^^^^^^^^^^^^ no `Rdtsc` in the root
|
help: consider importing one of these items instead
|
68 | use crate::Op::Rdtsc;
| ~~~~~~~~~~~~~~~~
68 | use detcore_model::schedule::Op::Rdtsc;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0432]: unresolved import `reverie::RdtscResult`
--> detcore/src/lib.rs:69:5
|
69 | use reverie::RdtscResult;
| ^^^^^^^^^^^^^^^^^^^^ no `RdtscResult` in the root
error: cannot determine resolution for the macro `cpuid`
--> detcore/src/lib.rs:640:13
|
640 | cpuid!(eax, ecx)
| ^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
Compiling foreign-types-macros v0.2.3
error[E0407]: method `handle_cpuid_event` is not a member of trait `Tool`
--> detcore/src/lib.rs:604:5
|
604 | async fn handle_cpuid_event<G: Guest<Self>>(
| ^ ------------------ help: there is an associated function with a similar name: `handle_timer_event`
| _____|
| |
605 | | &self,
606 | | guest: &mut G,
607 | | eax: u32,
... |
643 | | Ok(res)
644 | | }
| |_____^ not a member of trait `Tool`
error[E0407]: method `handle_rdtsc_event` is not a member of trait `Tool`
--> detcore/src/lib.rs:646:5
|
646 | async fn handle_rdtsc_event<G: Guest<Self>>(
| ^ ------------------ help: there is an associated function with a similar name: `handle_timer_event`
| _____|
| |
647 | | &self,
648 | | guest: &mut G,
649 | | request: Rdtsc,
... |
690 | | result
691 | | }
| |_____^ not a member of trait `Tool`
error[E0412]: cannot find type `Dup2` in crate `syscalls`
--> detcore/src/syscalls/files.rs:490:25
|
490 | call: syscalls::Dup2,
| ^^^^ help: a struct with a similar name exists: `Dup`
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:815:1
|
815 | / typed_syscall! {
816 | | pub struct Dup {
817 | | oldfd: i32,
818 | | }
819 | | }
| |_- similarly named struct `Dup` defined here
error[E0412]: cannot find type `Utime` in crate `syscalls`
--> detcore/src/syscalls/files.rs:539:25
|
539 | call: syscalls::Utime,
| ^^^^^ not found in `syscalls`
error[E0412]: cannot find type `Utimes` in crate `syscalls`
--> detcore/src/syscalls/files.rs:581:25
|
581 | call: syscalls::Utimes,
| ^^^^^^ help: a struct with a similar name exists: `Times`
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:1406:1
|
1406 | / typed_syscall! {
1407 | | pub struct Times -> libc::clock_t {
1408 | | buf: Option<AddrMut<libc::tms>>,
1409 | | }
1410 | | }
| |_- similarly named struct `Times` defined here
error[E0412]: cannot find type `Getdents` in crate `syscalls`
--> detcore/src/syscalls/files.rs:956:25
|
956 | call: syscalls::Getdents,
| ^^^^^^^^ help: a struct with a similar name exists: `Getdents64`
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2220:1
|
2220 | / typed_syscall! {
2221 | | pub struct Getdents64 {
2222 | | fd: u32,
2223 | | dirent: Option<AddrMut<libc::dirent64>>,
2224 | | count: u32,
2225 | | }
2226 | | }
| |_- similarly named struct `Getdents64` defined here
error[E0412]: cannot find type `Poll` in crate `reverie::syscalls`
--> detcore/src/syscalls/helpers.rs:333:49
|
333 | impl NonblockableSyscall for reverie::syscalls::Poll {
| ^^^^
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2829:1
|
2829 | / typed_syscall! {
2830 | | pub struct Ppoll {
2831 | | fds: Option<AddrMut<libc::pollfd>>,
2832 | | nfds: libc::nfds_t,
... |
2836 | | }
2837 | | }
| |_- similarly named struct `Ppoll` defined here
|
help: a struct with a similar name exists
|
333 | impl NonblockableSyscall for reverie::syscalls::Ppoll {
| ~~~~~
help: consider importing one of these items
|
9 + use core::task::Poll;
|
9 + use futures::task::Poll;
|
9 + use std::task::Poll;
|
9 + use tokio::macros::support::Poll;
|
help: if you import `Poll`, refer to it directly
|
333 - impl NonblockableSyscall for reverie::syscalls::Poll {
333 + impl NonblockableSyscall for Poll {
|
error[E0412]: cannot find type `Poll` in crate `reverie::syscalls`
--> detcore/src/syscalls/helpers.rs:342:48
|
342 | impl TimeoutableSyscall for reverie::syscalls::Poll {
| ^^^^
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2829:1
|
2829 | / typed_syscall! {
2830 | | pub struct Ppoll {
2831 | | fds: Option<AddrMut<libc::pollfd>>,
2832 | | nfds: libc::nfds_t,
... |
2836 | | }
2837 | | }
| |_- similarly named struct `Ppoll` defined here
|
help: a struct with a similar name exists
|
342 | impl TimeoutableSyscall for reverie::syscalls::Ppoll {
| ~~~~~
help: consider importing one of these items
|
9 + use core::task::Poll;
|
9 + use futures::task::Poll;
|
9 + use std::task::Poll;
|
9 + use tokio::macros::support::Poll;
|
help: if you import `Poll`, refer to it directly
|
342 - impl TimeoutableSyscall for reverie::syscalls::Poll {
342 + impl TimeoutableSyscall for Poll {
|
error[E0412]: cannot find type `EpollWait` in crate `reverie::syscalls`
--> detcore/src/syscalls/helpers.rs:349:49
|
349 | impl NonblockableSyscall for reverie::syscalls::EpollWait {
| ^^^^^^^^^ help: a struct with a similar name exists: `EpollPwait`
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2922:1
|
2922 | / typed_syscall! {
2923 | | pub struct EpollPwait {
2924 | | epfd: i32,
2925 | | events: Option<AddrMut<libc::epoll_event>>,
... |
2930 | | }
2931 | | }
| |_- similarly named struct `EpollPwait` defined here
error[E0412]: cannot find type `EpollWait` in crate `reverie::syscalls`
--> detcore/src/syscalls/helpers.rs:358:48
|
358 | impl TimeoutableSyscall for reverie::syscalls::EpollWait {
| ^^^^^^^^^ help: a struct with a similar name exists: `EpollPwait`
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2922:1
|
2922 | / typed_syscall! {
2923 | | pub struct EpollPwait {
2924 | | epfd: i32,
2925 | | events: Option<AddrMut<libc::epoll_event>>,
... |
2930 | | }
2931 | | }
| |_- similarly named struct `EpollPwait` defined here
error[E0412]: cannot find type `Poll` in crate `syscalls`
--> detcore/src/syscalls/io.rs:37:32
|
37 | fn print_poll(call: &syscalls::Poll) {
| ^^^^
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2829:1
|
2829 | / typed_syscall! {
2830 | | pub struct Ppoll {
2831 | | fds: Option<AddrMut<libc::pollfd>>,
2832 | | nfds: libc::nfds_t,
... |
2836 | | }
2837 | | }
| |_- similarly named struct `Ppoll` defined here
|
help: a struct with a similar name exists
|
37 | fn print_poll(call: &syscalls::Ppoll) {
| ~~~~~
help: consider importing one of these items
|
13 + use core::task::Poll;
|
13 + use futures::task::Poll;
|
13 + use std::task::Poll;
|
13 + use tokio::macros::support::Poll;
|
help: if you import `Poll`, refer to it directly
|
37 - fn print_poll(call: &syscalls::Poll) {
37 + fn print_poll(call: &Poll) {
|
error[E0412]: cannot find type `Poll` in crate `syscalls`
--> detcore/src/syscalls/io.rs:58:25
|
58 | call: syscalls::Poll,
| ^^^^
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2829:1
|
2829 | / typed_syscall! {
2830 | | pub struct Ppoll {
2831 | | fds: Option<AddrMut<libc::pollfd>>,
2832 | | nfds: libc::nfds_t,
... |
2836 | | }
2837 | | }
| |_- similarly named struct `Ppoll` defined here
|
help: a struct with a similar name exists
|
58 | call: syscalls::Ppoll,
| ~~~~~
help: consider importing one of these items
|
13 + use core::task::Poll;
|
13 + use futures::task::Poll;
|
13 + use std::task::Poll;
|
13 + use tokio::macros::support::Poll;
|
help: if you import `Poll`, refer to it directly
|
58 - call: syscalls::Poll,
58 + call: Poll,
|
error[E0412]: cannot find type `Poll` in crate `syscalls`
--> detcore/src/syscalls/io.rs:75:25
|
75 | call: syscalls::Poll,
| ^^^^
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2829:1
|
2829 | / typed_syscall! {
2830 | | pub struct Ppoll {
2831 | | fds: Option<AddrMut<libc::pollfd>>,
2832 | | nfds: libc::nfds_t,
... |
2836 | | }
2837 | | }
| |_- similarly named struct `Ppoll` defined here
|
help: a struct with a similar name exists
|
75 | call: syscalls::Ppoll,
| ~~~~~
help: consider importing one of these items
|
13 + use core::task::Poll;
|
13 + use futures::task::Poll;
|
13 + use std::task::Poll;
|
13 + use tokio::macros::support::Poll;
|
help: if you import `Poll`, refer to it directly
|
75 - call: syscalls::Poll,
75 + call: Poll,
|
error[E0412]: cannot find type `Poll` in crate `syscalls`
--> detcore/src/syscalls/io.rs:93:25
|
93 | call: syscalls::Poll,
| ^^^^
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2829:1
|
2829 | / typed_syscall! {
2830 | | pub struct Ppoll {
2831 | | fds: Option<AddrMut<libc::pollfd>>,
2832 | | nfds: libc::nfds_t,
... |
2836 | | }
2837 | | }
| |_- similarly named struct `Ppoll` defined here
|
help: a struct with a similar name exists
|
93 | call: syscalls::Ppoll,
| ~~~~~
help: consider importing one of these items
|
13 + use core::task::Poll;
|
13 + use futures::task::Poll;
|
13 + use std::task::Poll;
|
13 + use tokio::macros::support::Poll;
|
help: if you import `Poll`, refer to it directly
|
93 - call: syscalls::Poll,
93 + call: Poll,
|
error[E0412]: cannot find type `EpollWait` in crate `syscalls`
--> detcore/src/syscalls/io.rs:147:25
|
147 | call: syscalls::EpollWait,
| ^^^^^^^^^ help: a struct with a similar name exists: `EpollPwait`
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2922:1
|
2922 | / typed_syscall! {
2923 | | pub struct EpollPwait {
2924 | | epfd: i32,
2925 | | events: Option<AddrMut<libc::epoll_event>>,
... |
2930 | | }
2931 | | }
| |_- similarly named struct `EpollPwait` defined here
error[E0412]: cannot find type `EpollWait` in crate `syscalls`
--> detcore/src/syscalls/io.rs:162:25
|
162 | call: syscalls::EpollWait,
| ^^^^^^^^^ help: a struct with a similar name exists: `EpollPwait`
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2922:1
|
2922 | / typed_syscall! {
2923 | | pub struct EpollPwait {
2924 | | epfd: i32,
2925 | | events: Option<AddrMut<libc::epoll_event>>,
... |
2930 | | }
2931 | | }
| |_- similarly named struct `EpollPwait` defined here
error[E0412]: cannot find type `Alarm` in crate `syscalls`
--> detcore/src/syscalls/signal.rs:46:25
|
46 | call: syscalls::Alarm,
| ^^^^^ not found in `syscalls`
error[E0412]: cannot find type `Pause` in crate `syscalls`
--> detcore/src/syscalls/signal.rs:64:25
|
64 | call: syscalls::Pause,
| ^^^^^ not found in `syscalls`
error[E0412]: cannot find type `Time` in crate `syscalls`
--> detcore/src/syscalls/time.rs:121:25
|
121 | call: syscalls::Time,
| ^^^^
|
::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:1406:1
|
1406 | / typed_syscall! {
1407 | | pub struct Times -> libc::clock_t {
1408 | | buf: Option<AddrMut<libc::tms>>,
1409 | | }
1410 | | }
| |_- similarly named struct `Times` defined here
|
help: there is an enum variant `crate::TimerSchedule::Time` and 1 other; try using the variant's enum
|
121 | call: crate::TimerSchedule,
| ~~~~~~~~~~~~~~~~~~~~
121 | call: reverie::TimerSchedule,
| ~~~~~~~~~~~~~~~~~~~~~~
help: a struct with a similar name exists
|
121 | call: syscalls::Times,
| ~~~~~
Compiling matchers v0.1.0
Compiling scroll_derive v0.11.1
Compiling thread_local v1.1.7
error[E0609]: no field `rip` on type `user_regs_struct`
--> detcore/src/syscalls/helpers.rs:760:42
|
760 | let end_rip = NonZeroUsize::new(regs.rip.try_into().unwrap()).unwrap();
| ^^^ unknown field
|
= note: available fields are: `regs`, `sp`, `pc`, `pstate`
error[E0609]: no field `rip` on type `user_regs_struct`
--> detcore/src/tool_global.rs:1476:36
|
1476 | NonZeroUsize::new(regs.rip.try_into().unwrap()).unwrap()
| ^^^ unknown field
|
= note: available fields are: `regs`, `sp`, `pc`, `pstate`
Compiling foreign-types-shared v0.3.1
Compiling crossbeam-utils v0.8.16
Compiling unwind v0.4.1
Compiling foreign-types v0.5.0
Compiling tracing-subscriber v0.3.17
error[E0599]: no variant or associated item named `Poll` found for enum `reverie::reverie_syscalls::Syscall` in the current scope
--> detcore/src/syscalls/io.rs:105:60
|
105 | .record_or_replay_blocking(guest, Syscall::Poll(call))
| ^^^^
| |
| variant or associated item not found in `Syscall`
| help: there is a variant with a similar name: `Ppoll`
|
note: if you're trying to build a new `reverie::reverie_syscalls::Syscall`, consider using `reverie::reverie_syscalls::Syscall::from_raw` which returns `reverie::reverie_syscalls::Syscall`
--> /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:68:1
|
68 | / syscall_list! {
69 | | /// Full list of type-safe syscalls.
70 | | #[derive(Debug, Copy, Clone, Eq, PartialEq)]
71 | | #[allow(missing_docs)]
... |
494 | | }
495 | | }
| |_^
= note: this error originates in the macro `syscall_list` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no variant or associated item named `EpollWait` found for enum `reverie::reverie_syscalls::Syscall` in the current scope
--> detcore/src/syscalls/io.rs:151:60
|
151 | .record_or_replay_blocking(guest, Syscall::EpollWait(call))
| ^^^^^^^^^
| |
| variant or associated item not found in `Syscall`
| help: there is a variant with a similar name: `EpollPwait`
|
note: if you're trying to build a new `reverie::reverie_syscalls::Syscall`, consider using `reverie::reverie_syscalls::Syscall::from_raw` which returns `reverie::reverie_syscalls::Syscall`
--> /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:68:1
|
68 | / syscall_list! {
69 | | /// Full list of type-safe syscalls.
70 | | #[derive(Debug, Copy, Clone, Eq, PartialEq)]
71 | | #[allow(missing_docs)]
... |
494 | | }
495 | | }
| |_^
= note: this error originates in the macro `syscall_list` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
--> detcore/src/syscalls/misc.rs:52:31
|
52 | un.nodename = from_str(DEFAULT_HOSTNAME);
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `[u8; 65]`, found `[i8; 65]`
| |
| expected due to the type of this binding
|
= note: expected array `[u8; 65]`
found array `[i8; 65]`
error[E0308]: mismatched types
--> detcore/src/syscalls/misc.rs:53:33
|
53 | un.domainname = from_str(DEFAULT_HOSTNAME.split('.').last().unwrap_or(""));
| ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `[u8; 65]`, found `[i8; 65]`
| |
| expected due to the type of this binding
|
= note: expected array `[u8; 65]`
found array `[i8; 65]`
error[E0308]: mismatched types
--> detcore/src/syscalls/misc.rs:56:26
|
56 | un.release = from_str("5.2.0");
| ---------- ^^^^^^^^^^^^^^^^^ expected `[u8; 65]`, found `[i8; 65]`
| |
| expected due to the type of this binding
|
= note: expected array `[u8; 65]`
found array `[i8; 65]`
error[E0308]: mismatched types
--> detcore/src/syscalls/misc.rs:57:26
|
57 | un.version = from_str(&format!("#1 SMP {}", epoch.format("%a %b %d %T %Z %Y")));
| ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `[u8; 65]`, found `[i8; 65]`
| |
| expected due to the type of this binding
|
= note: expected array `[u8; 65]`
found array `[i8; 65]`
Compiling env_logger v0.8.4
Compiling scroll v0.11.0
Compiling tokio-util v0.7.10
warning: use of deprecated method `chrono::DateTime::<Tz>::timestamp_nanos`: use `timestamp_nanos_opt()` instead
--> detcore/src/tool_global.rs:859:52
|
859 | LogicalTime::from_nanos(self.cfg.epoch.timestamp_nanos() as u64),
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
warning: use of deprecated method `chrono::DateTime::<Tz>::timestamp_nanos`: use `timestamp_nanos_opt()` instead
--> detcore/src/tool_global.rs:883:40
|
883 | LogicalTime::from_nanos(dt.timestamp_nanos() as u64)
| ^^^^^^^^^^^^^^^
warning: use of deprecated method `chrono::DateTime::<Tz>::timestamp_nanos`: use `timestamp_nanos_opt()` instead
--> detcore/src/tool_global.rs:899:56
|
899 | LogicalTime::from_nanos(self.cfg.epoch.timestamp_nanos() as u64),
| ^^^^^^^^^^^^^^^
Compiling plain v0.2.3
Compiling goblin v0.5.4
Some errors have detailed explanations: E0308, E0407, E0412, E0432, E0599, E0609.
For more information about an error, try `rustc --explain E0308`.
warning: `detcore` (lib) generated 3 warnings
error: could not compile `detcore` (lib) due to 32 previous errors; 3 warnings emitted
warning: build failed, waiting for other jobs to finish...