From 1809961f94572ee7d47fc4451792283ec59de308 Mon Sep 17 00:00:00 2001 From: NikVolf Date: Mon, 1 Aug 2016 19:53:53 +0200 Subject: [PATCH] drying hypervisor --- Cargo.lock | 2 -- ethcore/Cargo.toml | 2 -- ethcore/build.rs | 8 ++++---- ipc/hypervisor/Cargo.toml | 1 - ipc/hypervisor/build.rs | 26 ++------------------------ ipc/hypervisor/src/service.rs | 2 +- 6 files changed, 7 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cbc2c25de..7fda431f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,6 @@ dependencies = [ "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -346,7 +345,6 @@ dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "nanomsg 0.5.1 (git+https://github.com/ethcore/nanomsg.rs.git)", "semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 07fbccf55..7bde3525f 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -8,7 +8,6 @@ authors = ["Ethcore "] build = "build.rs" [build-dependencies] -syntex = "*" "ethcore-ipc-codegen" = { path = "../ipc/codegen" } [dependencies] @@ -35,7 +34,6 @@ ethcore-ipc = { path = "../ipc/rpc" } ethstore = { path = "../ethstore" } ethcore-ipc-nano = { path = "../ipc/nano" } - [dependencies.hyper] git = "https://github.com/ethcore/hyper" default-features = false diff --git a/ethcore/build.rs b/ethcore/build.rs index 584e7973e..2e07cbc2f 100644 --- a/ethcore/build.rs +++ b/ethcore/build.rs @@ -14,10 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -extern crate ethcore_ipc_codegen as codegen; +extern crate ethcore_ipc_codegen; fn main() { - codegen::derive_binary("src/types/mod.rs.in"); - codegen::derive_ipc("src/client/traits.rs"); - codegen::derive_ipc("src/client/chain_notify.rs"); + ethcore_ipc_codegen::derive_binary("src/types/mod.rs.in").unwrap(); + ethcore_ipc_codegen::derive_ipc("src/client/traits.rs").unwrap(); + ethcore_ipc_codegen::derive_ipc("src/client/chain_notify.rs").unwrap(); } diff --git a/ipc/hypervisor/Cargo.toml b/ipc/hypervisor/Cargo.toml index 54edac7ec..a4c462bd0 100644 --- a/ipc/hypervisor/Cargo.toml +++ b/ipc/hypervisor/Cargo.toml @@ -15,5 +15,4 @@ semver = "0.2" log = "0.3" [build-dependencies] -syntex = "*" ethcore-ipc-codegen = { path = "../codegen" } diff --git a/ipc/hypervisor/build.rs b/ipc/hypervisor/build.rs index 75ccd2e8c..391ac648d 100644 --- a/ipc/hypervisor/build.rs +++ b/ipc/hypervisor/build.rs @@ -14,30 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -extern crate syntex; -extern crate ethcore_ipc_codegen as codegen; - -use std::env; -use std::path::Path; +extern crate ethcore_ipc_codegen; fn main() { - let out_dir = env::var_os("OUT_DIR").unwrap(); - - // ipc pass - { - let src = Path::new("src/service.rs.in"); - let dst = Path::new(&out_dir).join("hypervisor_service_ipc.rs"); - let mut registry = syntex::Registry::new(); - codegen::register(&mut registry); - registry.expand("", &src, &dst).unwrap(); - } - - // serialization pass - { - let src = Path::new(&out_dir).join("hypervisor_service_ipc.rs"); - let dst = Path::new(&out_dir).join("hypervisor_service_cg.rs"); - let mut registry = syntex::Registry::new(); - codegen::register(&mut registry); - registry.expand("", &src, &dst).unwrap(); - } + ethcore_ipc_codegen::derive_ipc("src/service.rs.in").unwrap(); } diff --git a/ipc/hypervisor/src/service.rs b/ipc/hypervisor/src/service.rs index 75830d213..ffc83dc7c 100644 --- a/ipc/hypervisor/src/service.rs +++ b/ipc/hypervisor/src/service.rs @@ -17,4 +17,4 @@ //! Parity interprocess hypervisor IPC service #![allow(dead_code, unused_assignments, unused_variables)] // codegen issues -include!(concat!(env!("OUT_DIR"), "/hypervisor_service_cg.rs")); +include!(concat!(env!("OUT_DIR"), "/service.rs.in"));