OXYGENHUB
# e3fb0e9b5e6b oxygenflow / crates / flow / src / syscall_none.rs
1.1 KiB · Rust · last changed flow builds on Haiku: the syscall tier, guest job code and load average are Linux's only; noatime where statvfs knows it (refs #91) 7 days ago source blame history raw
1
//! The syscall tier where it cannot be: it is built from Linux's user
2
//! namespaces, Landlock, seccomp and cgroups, so a runner elsewhere (a
3
//! Windows runner, oxygenflow#83; Haiku and FreeBSD, #91, #99) never
4
//! offers it, and these say why.
5
6
use crate::home::Home;
7
use crate::microvm::{Outcome, Sink};
8
use anyhow::{bail, Result};
9
use flow_core::api::SecretInput;
10
use flow_core::{Job, Sandbox};
11
use std::path::Path;
12
use std::time::Duration;
13
14
pub use crate::tier::disk_dir;
15
pub(crate) use crate::tier::{lines, self_hash, FAILED};
16
17
const WHY: &str = "the syscall tier runs only on Linux";
18
19
pub fn available() -> std::result::Result<(), String> {
20
    Err(WHY.into())
21
}
22
23
pub fn probe_main() -> i32 {
24
    eprintln!("{WHY}");
25
    1
26
}
27
28
pub fn sandbox_main(_spec_path: &Path) -> i32 {
29
    eprintln!("{WHY}");
30
    125
31
}
32
33
#[allow(clippy::too_many_arguments)]
34
pub fn run(
35
    _home: &Home,
36
    _sandbox: &Sandbox,
37
    _job: &Job,
38
    _secrets: &[SecretInput],
39
    _workspace: &Path,
40
    _scratch: &Path,
41
    _timeout: Duration,
42
    _sink: &mut dyn Sink,
43
    _name: &str,
44
) -> Result<Outcome> {
45
    bail!("{WHY}")
46
}