OXYGENHUB
# 72e9cfca63b5 oxygenflow / crates / flow / src / syscall_none.rs
1.1 KiB · Rust · last changed flow builds for Windows, offering the WASM tier 10 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) never offers it, and these say why.
4
5
use crate::home::Home;
6
use crate::microvm::{Outcome, Sink};
7
use anyhow::{bail, Result};
8
use flow_core::api::SecretInput;
9
use flow_core::{Job, Sandbox};
10
use std::path::Path;
11
use std::time::Duration;
12
13
pub use crate::tier::disk_dir;
14
pub(crate) use crate::tier::{lines, self_hash, FAILED};
15
16
const WHY: &str = "the syscall tier runs only on Linux";
17
18
pub fn available() -> std::result::Result<(), String> {
19
    Err(WHY.into())
20
}
21
22
pub fn probe_main() -> i32 {
23
    eprintln!("{WHY}");
24
    1
25
}
26
27
pub fn sandbox_main(_spec_path: &Path) -> i32 {
28
    eprintln!("{WHY}");
29
    125
30
}
31
32
#[allow(clippy::too_many_arguments)]
33
pub fn run(
34
    _home: &Home,
35
    _sandbox: &Sandbox,
36
    _job: &Job,
37
    _secrets: &[SecretInput],
38
    _workspace: &Path,
39
    _scratch: &Path,
40
    _timeout: Duration,
41
    _sink: &mut dyn Sink,
42
    _name: &str,
43
) -> Result<Outcome> {
44
    bail!("{WHY}")
45
}