use a thread in the build script of serde_codegen to allow env vars to control the stack size

This commit is contained in:
Oliver Schneider 2016-08-09 13:08:16 +02:00
parent d120539310
commit 8bd7acc9fc
No known key found for this signature in database
GPG Key ID: 56D6EEA0FC67AC46
3 changed files with 11 additions and 8 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "serde_codegen"
version = "0.8.0"
version = "0.8.1"
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
license = "MIT/Apache-2.0"
description = "Macros to auto-generate implementations for the serde framework"

View File

@ -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()
}
}

View File

@ -1,6 +1,6 @@
[package]
name = "serde_macros"
version = "0.8.0"
version = "0.8.1"
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
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 }