/
lib.rs
69 lines (62 loc) · 1.58 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
extern crate bazel_protos;
#[macro_use]
extern crate boxfuture;
extern crate bytes;
extern crate digest;
extern crate fs;
extern crate futures;
extern crate futures_timer;
extern crate grpcio;
extern crate hashing;
#[macro_use]
extern crate log;
#[cfg(test)]
extern crate mock;
extern crate protobuf;
extern crate resettable;
extern crate sha2;
#[cfg(test)]
extern crate tempdir;
#[cfg(test)]
extern crate testutil;
use bytes::Bytes;
use std::collections::{BTreeMap, BTreeSet};
use std::path::PathBuf;
pub mod local;
pub mod remote;
///
/// A process to be executed.
///
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub struct ExecuteProcessRequest {
///
/// The arguments to execute.
///
/// The first argument should be an absolute or relative path to the binary to execute.
///
/// No PATH lookup will be performed unless a PATH environment variable is specified.
///
/// No shell expansion will take place.
///
pub argv: Vec<String>,
///
/// The environment variables to set for the execution.
///
/// No other environment variables will be set (except possibly for an empty PATH variable).
///
pub env: BTreeMap<String, String>,
pub input_files: hashing::Digest,
pub output_files: BTreeSet<PathBuf>,
}
///
/// The result of running a process.
///
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct ExecuteProcessResult {
pub stdout: Bytes,
pub stderr: Bytes,
pub exit_code: i32,
// It's unclear whether this should be a Snapshot or a digest of a Directory. A Directory digest
// is handy, so let's try that out for now.
pub output_directory: hashing::Digest,
}