Skip to content

Commit 0ce2dae

Browse files
committed
Allow up to 128MB stack size for build.rs
1 parent 6e2129e commit 0ce2dae

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

html5ever/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "html5ever"
4-
version = "0.22.2"
4+
version = "0.22.3"
55
authors = [ "The html5ever Project Developers" ]
66
license = "MIT / Apache-2.0"
77
repository = "https://github.com/servo/html5ever"

html5ever/build.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,22 @@ extern crate proc_macro2;
1313

1414
use std::env;
1515
use std::path::Path;
16+
use std::thread::Builder;
1617

1718
#[path = "macros/match_token.rs"]
1819
mod match_token;
1920

2021
fn main() {
2122
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
2223

23-
let rules_rs = Path::new(&manifest_dir).join("src/tree_builder/rules.rs");
24-
match_token::expand(
25-
&rules_rs,
26-
&Path::new(&env::var("OUT_DIR").unwrap()).join("rules.rs"));
24+
let input = Path::new(&manifest_dir).join("src/tree_builder/rules.rs");
25+
let output = Path::new(&env::var("OUT_DIR").unwrap()).join("rules.rs");
26+
println!("cargo:rerun-if-changed={}", input.display());
2727

28-
println!("cargo:rerun-if-changed={}", rules_rs.display());
28+
// We have stack overflows on Servo's CI.
29+
let handle = Builder::new().stack_size(128 * 1024 * 1024).spawn(move || {
30+
match_token::expand(&input, &output);
31+
}).unwrap();
32+
33+
handle.join().unwrap();
2934
}

0 commit comments

Comments
 (0)