-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathfix-stackoverflow.patch
36 lines (35 loc) · 1.13 KB
/
fix-stackoverflow.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff --git a/cli/build.rs b/cli/build.rs
index ecfc19dc0..6e4c519a4 100644
--- a/cli/build.rs
+++ b/cli/build.rs
@@ -489,15 +489,22 @@ fn main() {
let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
let o = PathBuf::from(env::var_os("OUT_DIR").unwrap());
- let compiler_snapshot_path = o.join("COMPILER_SNAPSHOT.bin");
- ts::create_compiler_snapshot(compiler_snapshot_path, &c);
-
- #[cfg(not(feature = "hmr"))]
- {
- let cli_snapshot_path = o.join("CLI_SNAPSHOT.bin");
- create_cli_snapshot(cli_snapshot_path);
- }
-
+ let thread = std::thread::Builder::new().stack_size(8 * 1024 * 1024);
+ thread
+ .spawn(move || {
+ let compiler_snapshot_path = o.join("COMPILER_SNAPSHOT.bin");
+ ts::create_compiler_snapshot(compiler_snapshot_path, &c);
+
+ #[cfg(not(feature = "hmr"))]
+ {
+ let cli_snapshot_path = o.join("CLI_SNAPSHOT.bin");
+ create_cli_snapshot(cli_snapshot_path);
+ }
+ })
+ .unwrap()
+ .join()
+ .unwrap();
+ println!("cargo:rustc-link-arg=-Wl,-z,stack-size=0x800000");
#[cfg(target_os = "windows")]
{
let mut res = winres::WindowsResource::new();