From 3921b6a5a071ec0dc9d803b0ae809a348c34f87f Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 17 Jul 2016 12:05:14 +0200 Subject: [PATCH] fix(dependencies): use working version of serde-codegen This update fixes the build on stable, and allows builds on nightly as usual. The trick is to use the latest version of serde-codegen, which keeps the syntex version internal, preventing clashes between libraries that might have different requirements. --- .travis.yml | 2 +- src/mako/Cargo.toml.mako | 13 ++++++------- src/mako/api/build.rs.mako | 10 +++------- src/mako/api/lib.rs.mako | 2 +- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index caf12d8ced..901a9790a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,5 +19,5 @@ env: global: secure: Plj5DqAQX/4+KPM+nOAZ2sCbGIsoSrHo1YggfesQnU7paR734XO/4IayWnsNO/3q6bDi4GIcn56RUZAD3xBJJBNLia2CYIickIIYORRqLWbLdbzQaxBbD670ahtzEuUSFJTRKURPwFteAnsWYgNMNzwXOVNwLS5IUBqWTcS+N0g= matrix: - - FEATURE=with-syntex + - FEATURE=with-serde-codegen - FEATURE=nightly diff --git a/src/mako/Cargo.toml.mako b/src/mako/Cargo.toml.mako index 453e5a16e1..37c80c07e8 100644 --- a/src/mako/Cargo.toml.mako +++ b/src/mako/Cargo.toml.mako @@ -32,7 +32,7 @@ mime = "^ 0.2.0" serde = "^ 0.7.5" serde_json = "^ 0.7.0" yup-oauth2 = { version = "^ 0.6.0", optional = true, default-features = false } -serde_macros = { version = "0.7.5", optional = true } +serde_macros = { version = "^ 0.7.5", optional = true } % for dep in cargo.get('dependencies', list()): ${dep} % endfor @@ -43,20 +43,19 @@ ${dep} crate_name_we_depend_on = None nightly_features = ["serde_macros", "yup-oauth2/nightly"] - default_features = ["serde_codegen", "syntex", "yup-oauth2/with-syntex"] + default_features = ["serde_codegen", "yup-oauth2/with-serde-codegen"] if make.depends_on_suffix is not None: crate_name_we_depend_on = library_to_crate_name(api_name, suffix=make.depends_on_suffix) nightly_features.append(crate_name_we_depend_on + '/nightly') - default_features.append(crate_name_we_depend_on + '/with-syntex') + default_features.append(crate_name_we_depend_on + '/with-serde-codegen') %>\ -default = ["with-syntex"] +default = ["with-serde-codegen"] nightly = [${','.join(enclose_in('"', nightly_features))}] -with-syntex = [${','.join(enclose_in('"', default_features))}] +with-serde-codegen = [${','.join(enclose_in('"', default_features))}] [build-dependencies] -syntex = { version = "= 0.32", optional = true } -serde_codegen = { version = "= 0.7.5", optional = true } +serde_codegen = { version = "^ 0.7.14", optional = true } % if make.depends_on_suffix is not None: diff --git a/src/mako/api/build.rs.mako b/src/mako/api/build.rs.mako index b217200059..0bebaf0bf0 100644 --- a/src/mako/api/build.rs.mako +++ b/src/mako/api/build.rs.mako @@ -1,7 +1,5 @@ -<%namespace name="util" file="../lib/util.mako"/>\ -#[cfg(feature = "with-syntex")] +#[cfg(feature = "with-serde-codegen")] mod inner { - extern crate syntex; extern crate serde_codegen; use std::env; @@ -13,13 +11,11 @@ mod inner { let src = Path::new("src/lib.rs.in"); let dst = Path::new(&out_dir).join("lib.rs"); - let mut registry = syntex::Registry::new(); - serde_codegen::register(&mut registry); - registry.expand("${util.crate_name()}", &src, &dst).unwrap(); + serde_codegen::expand(&src, &dst).unwrap(); } } -#[cfg(not(feature = "with-syntex"))] +#[cfg(not(feature = "with-serde-codegen"))] mod inner { pub fn main() {} } diff --git a/src/mako/api/lib.rs.mako b/src/mako/api/lib.rs.mako index 6911ce9d2f..b446a0480f 100644 --- a/src/mako/api/lib.rs.mako +++ b/src/mako/api/lib.rs.mako @@ -24,5 +24,5 @@ ${lib.docs(c)} #[cfg(feature = "nightly")] include!("lib.rs.in"); -#[cfg(feature = "with-syntex")] +#[cfg(feature = "with-serde-codegen")] include!(concat!(env!("OUT_DIR"), "/lib.rs")); \ No newline at end of file