summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2021-10-25 00:19:45 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2021-10-25 00:19:45 +0200
commit34ac18d20c13a78914d447fee83204811a27b1e4 (patch)
tree56763d4ea46927105fcc6a71e03d5bd75a6947a6
parenta1a185370da27f2cc3df84d3a8d7141f9ce7db16 (diff)
downloadrebel-34ac18d20c13a78914d447fee83204811a27b1e4.tar
rebel-34ac18d20c13a78914d447fee83204811a27b1e4.zip
Move runner into separate crate
-rw-r--r--Cargo.lock28
-rw-r--r--Cargo.toml10
-rw-r--r--crates/runner/Cargo.toml23
-rw-r--r--crates/runner/src/init.rs (renamed from src/runner/container/init.rs)0
-rw-r--r--crates/runner/src/jobserver.rs (renamed from src/runner/container/jobserver.rs)0
-rw-r--r--crates/runner/src/lib.rs (renamed from src/runner/container/mod.rs)1
-rw-r--r--crates/runner/src/ns.rs (renamed from src/runner/container/ns.rs)0
-rw-r--r--crates/runner/src/paths.rs (renamed from src/paths.rs)0
-rw-r--r--crates/runner/src/tar.rs (renamed from src/runner/container/tar.rs)0
-rw-r--r--crates/runner/src/task.rs (renamed from src/runner/container/task.rs)0
-rw-r--r--crates/runner/src/util/cjson.rs (renamed from src/runner/container/util/cjson.rs)0
-rw-r--r--crates/runner/src/util/clone.rs (renamed from src/runner/container/util/clone.rs)0
-rw-r--r--crates/runner/src/util/fs.rs (renamed from src/runner/container/util/fs.rs)0
-rw-r--r--crates/runner/src/util/mod.rs (renamed from src/runner/container/util/mod.rs)0
-rw-r--r--crates/runner/src/util/unix.rs (renamed from src/runner/container/util/unix.rs)0
-rw-r--r--src/context.rs2
-rw-r--r--src/executor.rs4
-rw-r--r--src/main.rs6
-rw-r--r--src/runner/mod.rs3
19 files changed, 50 insertions, 27 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 9cee169..05182fd 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -741,26 +741,18 @@ dependencies = [
name = "rebel"
version = "0.1.0"
dependencies = [
- "blake3",
- "capctl",
"clap",
- "digest 0.9.0",
"enum-kinds",
"handlebars",
"indoc",
"ipc-channel",
"lazy_static",
- "libc",
- "nix",
- "olpc-cjson",
"rebel-common",
+ "rebel-runner",
"regex",
"scoped-tls-hkt",
"serde",
- "serde_json",
"serde_yaml",
- "tar",
- "tee_readwrite",
"walkdir",
]
@@ -773,6 +765,24 @@ dependencies = [
]
[[package]]
+name = "rebel-runner"
+version = "0.1.0"
+dependencies = [
+ "blake3",
+ "capctl",
+ "digest 0.9.0",
+ "ipc-channel",
+ "libc",
+ "nix",
+ "olpc-cjson",
+ "rebel-common",
+ "serde",
+ "serde_json",
+ "tar",
+ "tee_readwrite",
+]
+
+[[package]]
name = "redox_syscall"
version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 6024b79..921d917 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,26 +11,18 @@ edition = "2018"
[dependencies]
common = { path = "crates/common", package = "rebel-common" }
+runner = { path = "crates/runner", package = "rebel-runner" }
-blake3 = { version = "1.0.0", features = ["traits-preview"] }
-capctl = "0.2.0"
clap = "3.0.0-beta.2"
-digest = "0.9.0"
enum-kinds = "0.5.1"
handlebars = "4.1.3"
indoc = "1.0.3"
ipc-channel = { git = "https://github.com/servo/ipc-channel.git" }
lazy_static = "1.4.0"
-libc = "0.2.84"
-nix = "0.23.0"
-olpc-cjson = "0.1.0"
regex = "1.5.4"
scoped-tls-hkt = "0.1.2"
serde = { version = "1", features = ["derive"] }
-serde_json = "1.0.62"
serde_yaml = "0.8"
-tar = "0.4.32"
-tee_readwrite = "0.1.0"
walkdir = "2"
[profile.dev.package."*"]
diff --git a/crates/runner/Cargo.toml b/crates/runner/Cargo.toml
new file mode 100644
index 0000000..b69e51e
--- /dev/null
+++ b/crates/runner/Cargo.toml
@@ -0,0 +1,23 @@
+[package]
+name = "rebel-runner"
+version = "0.1.0"
+authors = ["Matthias Schiffer <mschiffer@universe-factory.net>"]
+license = "MIT"
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+common = { path = "../common", package = "rebel-common" }
+
+blake3 = { version = "1.0.0", features = ["traits-preview"] }
+capctl = "0.2.0"
+digest = "0.9.0"
+ipc-channel = { git = "https://github.com/servo/ipc-channel.git" }
+libc = "0.2.84"
+nix = "0.23.0"
+olpc-cjson = "0.1.0"
+serde = { version = "1", features = ["derive"] }
+serde_json = "1.0.62"
+tar = "0.4.32"
+tee_readwrite = "0.1.0"
diff --git a/src/runner/container/init.rs b/crates/runner/src/init.rs
index 783faf4..783faf4 100644
--- a/src/runner/container/init.rs
+++ b/crates/runner/src/init.rs
diff --git a/src/runner/container/jobserver.rs b/crates/runner/src/jobserver.rs
index 3b6c856..3b6c856 100644
--- a/src/runner/container/jobserver.rs
+++ b/crates/runner/src/jobserver.rs
diff --git a/src/runner/container/mod.rs b/crates/runner/src/lib.rs
index 375b7ed..658a833 100644
--- a/src/runner/container/mod.rs
+++ b/crates/runner/src/lib.rs
@@ -1,6 +1,7 @@
mod init;
mod jobserver;
mod ns;
+pub mod paths;
mod tar;
mod task;
mod util;
diff --git a/src/runner/container/ns.rs b/crates/runner/src/ns.rs
index a075931..a075931 100644
--- a/src/runner/container/ns.rs
+++ b/crates/runner/src/ns.rs
diff --git a/src/paths.rs b/crates/runner/src/paths.rs
index 632f030..632f030 100644
--- a/src/paths.rs
+++ b/crates/runner/src/paths.rs
diff --git a/src/runner/container/tar.rs b/crates/runner/src/tar.rs
index 9306775..9306775 100644
--- a/src/runner/container/tar.rs
+++ b/crates/runner/src/tar.rs
diff --git a/src/runner/container/task.rs b/crates/runner/src/task.rs
index 296c1a0..296c1a0 100644
--- a/src/runner/container/task.rs
+++ b/crates/runner/src/task.rs
diff --git a/src/runner/container/util/cjson.rs b/crates/runner/src/util/cjson.rs
index 5990943..5990943 100644
--- a/src/runner/container/util/cjson.rs
+++ b/crates/runner/src/util/cjson.rs
diff --git a/src/runner/container/util/clone.rs b/crates/runner/src/util/clone.rs
index 4835b53..4835b53 100644
--- a/src/runner/container/util/clone.rs
+++ b/crates/runner/src/util/clone.rs
diff --git a/src/runner/container/util/fs.rs b/crates/runner/src/util/fs.rs
index 099a339..099a339 100644
--- a/src/runner/container/util/fs.rs
+++ b/crates/runner/src/util/fs.rs
diff --git a/src/runner/container/util/mod.rs b/crates/runner/src/util/mod.rs
index eff589d..eff589d 100644
--- a/src/runner/container/util/mod.rs
+++ b/crates/runner/src/util/mod.rs
diff --git a/src/runner/container/util/unix.rs b/crates/runner/src/util/unix.rs
index 48db764..48db764 100644
--- a/src/runner/container/util/unix.rs
+++ b/crates/runner/src/util/unix.rs
diff --git a/src/context.rs b/src/context.rs
index 8953f0d..7a46e8d 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -17,10 +17,10 @@ use common::{
error::{self, Contextualizable},
types::TaskID,
};
+use runner::paths;
use crate::{
args::{self, arg, Arg, ArgMapping, ArgType, PlatformRelation, TaskArgs},
- paths,
task::*,
};
diff --git a/src/executor.rs b/src/executor.rs
index 9828543..1d6ee44 100644
--- a/src/executor.rs
+++ b/src/executor.rs
@@ -4,11 +4,11 @@ use indoc::indoc;
use ipc_channel::ipc;
use common::{error::*, string_hash::*, types::*};
+use runner::{paths, Runner};
use crate::{
context::{Context, TaskRef},
- paths, resolve,
- runner::Runner,
+ resolve,
task::*,
template::TemplateEngine,
};
diff --git a/src/main.rs b/src/main.rs
index aff055a..4a045be 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,15 +1,15 @@
mod args;
mod context;
mod executor;
-mod paths;
mod recipe;
mod resolve;
-mod runner;
mod task;
mod template;
use clap::Parser;
+use runner::Runner;
+
#[derive(Parser)]
#[clap(version = clap::crate_version!())]
struct Opts {
@@ -20,7 +20,7 @@ struct Opts {
fn main() {
let opts: Opts = Opts::parse();
- let runner = unsafe { runner::container::Runner::new() }.unwrap();
+ let runner = unsafe { Runner::new() }.unwrap();
let ctx = context::Context::new(recipe::read_recipes("examples").unwrap());
diff --git a/src/runner/mod.rs b/src/runner/mod.rs
deleted file mode 100644
index b88045a..0000000
--- a/src/runner/mod.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-pub mod container;
-
-pub use container::Runner;