Skip to content

Commit

Permalink
Merge pull request #22 from nix-community/death-to-varlink
Browse files Browse the repository at this point in the history
Remove varlink and bring back the native server/client socket serialization
  • Loading branch information
Profpatsch authored Mar 28, 2021
2 parents c1aa221 + 6e417ef commit fee4ffa
Show file tree
Hide file tree
Showing 37 changed files with 1,763 additions and 2,195 deletions.
222 changes: 82 additions & 140 deletions Cargo.lock

Large diffs are not rendered by default.

278 changes: 126 additions & 152 deletions Cargo.nix

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "lorri"
# lorri uses a MAJOR.MINOR versioning scheme, see MAINTAINERS.md for details.
# Cargo requires MAJOR.MINOR.PATCH. So we translate lorri's versioning scheme
# to MAJOR.MINOR.0, i.e. the PATCH part is always zero.
version = "1.3.1" # Format: MAJOR.MINOR.0
version = "1.4.0" # Format: MAJOR.MINOR.0
authors = [
"Graham Christensen <[email protected]>",
"Profpatsch <[email protected]>"
Expand All @@ -21,6 +21,9 @@ crossbeam-channel = "0.3.8"
nix = "0.20.0"
regex = "1.4.3"
tempfile = "3.1.0"
anyhow = "1.0"
thiserror = "1.0"

# TODO: update to 0.3
structopt.version = "0.2"
structopt.default-features = false
Expand All @@ -38,11 +41,12 @@ structopt.features = [
slog = "2.7.0"
slog-scope = "4.3.0"
slog-term = "2.5.0"
fastrand = "1.4.0"
# serialization
serde = "1.0.88"
serde_derive = "1.0.88"
serde_json = "1.0.38"
varlink = "10.0.0"
bincode = "1.3.2"
# nice-to-have
ctrlc = { version = "3.1.8", features = ["termination"] }
directories = "3.0.1"
Expand All @@ -62,6 +66,3 @@ proptest.features = [
# "fork",
# "timeout"
]

[build-dependencies]
varlink_generator = "9.0.0"
7 changes: 0 additions & 7 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,4 @@ pub const RUN_TIME_CLOSURE: &str = "{runtime_closure}";
.as_bytes(),
)
.unwrap();

for v in &[
"src/org.nixos.lorri.varlink",
"src/org.nixos.lorri.internal.varlink",
] {
varlink_generator::cargo_build_tosource(v, /*rustfmt */ true);
}
}
25 changes: 25 additions & 0 deletions nix/carnix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/src/cfg.rs b/src/cfg.rs
index 56f76a0..54a49b0 100644
--- a/src/cfg.rs
+++ b/src/cfg.rs
@@ -40,6 +40,7 @@ pub fn to_nix(w: &mut Write, target: &[Cfg]) -> Result<(), Error> {

fn to_nix_op(w: &mut Write, op: CfgOp, target: &[Cfg]) -> Result<(), Error> {
let mut is_first = true;
+ eprintln!("{:#?}", target);
for cfg in target {
if !is_first {
match op {
@@ -60,7 +61,11 @@ fn to_nix_op(w: &mut Write, op: CfgOp, target: &[Cfg]) -> Result<(), Error> {
"target_os" => cfg_value(w, "kernel", value)?,
"target_env" => cfg_value(w, "abi", value)?,
"target_arch" => cfg_value(w, "cpu", value)?,
- _ => return Err(CarnixError::CouldNotTranslateTarget.into())
+ _ => {
+ eprintln!("target: {}", key);
+ eprintln!("Do not understand this config op key: {}", key);
+ write!(w, "true")?;
+ }
}
},
Cfg::Cfg(ref value) => cfg_value(w, "kernel", value)?,
Loading

0 comments on commit fee4ffa

Please sign in to comment.