From 8bd7acc9fc4ec3f9f80f5a8bd52393547fe48908 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 9 Aug 2016 13:08:16 +0200 Subject: [PATCH] use a thread in the build script of serde_codegen to allow env vars to control the stack size --- serde_codegen/Cargo.toml | 2 +- serde_codegen/build.rs | 13 ++++++++----- serde_macros/Cargo.toml | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/serde_codegen/Cargo.toml b/serde_codegen/Cargo.toml index c0db8f97..8784c3de 100644 --- a/serde_codegen/Cargo.toml +++ b/serde_codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_codegen" -version = "0.8.0" +version = "0.8.1" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "Macros to auto-generate implementations for the serde framework" diff --git a/serde_codegen/build.rs b/serde_codegen/build.rs index 3e15a0a5..9ff828f2 100644 --- a/serde_codegen/build.rs +++ b/serde_codegen/build.rs @@ -4,14 +4,17 @@ mod inner { use std::env; use std::path::Path; + use std::thread::spawn; pub fn main() { - let out_dir = env::var_os("OUT_DIR").unwrap(); + // put everything into a thread, so users can use `RUST_MIN_STACK` to increase the amount of stack + spawn(|| { + let out_dir = env::var_os("OUT_DIR").unwrap(); - let src = Path::new("src/lib.rs.in"); - let dst = Path::new(&out_dir).join("lib.rs"); - - quasi_codegen::expand(&src, &dst).unwrap(); + let src = Path::new("src/lib.rs.in"); + let dst = Path::new(&out_dir).join("lib.rs"); + quasi_codegen::expand(&src, &dst).unwrap(); + }).join().unwrap() } } diff --git a/serde_macros/Cargo.toml b/serde_macros/Cargo.toml index 4791f416..0506d53b 100644 --- a/serde_macros/Cargo.toml +++ b/serde_macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_macros" -version = "0.8.0" +version = "0.8.1" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "Macros to auto-generate implementations for the serde framework" @@ -28,7 +28,7 @@ skeptic = { version = "^0.6.0", optional = true } [dependencies] clippy = { version = "^0.*", optional = true } -serde_codegen = { version = "=0.8.0", default-features = false, features = ["unstable"] } +serde_codegen = { version = "=0.8.1", default-features = false, features = ["unstable"] } skeptic = { version = "^0.6.0", optional = true } serde_json = { version = "0.8.0", optional = true }