Skip to content

Commit 6dbfc7d

Browse files
committed
Revert "Run compiler in a new thread with increased stack size"
This reverts commit 99799ee.
1 parent 6005e6a commit 6dbfc7d

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

scarb/src/ops/compile.rs

+1-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::thread;
2-
31
use anyhow::{anyhow, Result};
42
use cairo_lang_compiler::diagnostics::DiagnosticsError;
53
use indicatif::HumanDuration;
@@ -20,7 +18,7 @@ pub fn compile(packages: Vec<PackageId>, ws: &Workspace<'_>) -> Result<()> {
2018
.collect::<Vec<_>>();
2119

2220
for unit in compilation_units {
23-
compile_unit_isolated(unit, ws)?;
21+
compile_unit(unit, ws)?;
2422
}
2523

2624
let elapsed_time = HumanDuration(ws.config().elapsed_time());
@@ -32,25 +30,6 @@ pub fn compile(packages: Vec<PackageId>, ws: &Workspace<'_>) -> Result<()> {
3230
Ok(())
3331
}
3432

35-
// FIXME(mkaput): Remove this when Cairo will fix their issue upstream.
36-
// NOTE: This is untested! Compiling such large Cairo files takes horribly long time.
37-
/// Run compiler in a new thread which has significantly increased stack size.
38-
/// The Cairo compiler tends to consume too much stack space in some specific cases:
39-
/// https://github.com/starkware-libs/cairo/issues/3530.
40-
/// It does not seem to consume infinite amounts though, so we try to confine it in arbitrarily
41-
/// chosen big memory chunk.
42-
fn compile_unit_isolated(unit: CompilationUnit, ws: &Workspace<'_>) -> Result<()> {
43-
thread::scope(|s| {
44-
thread::Builder::new()
45-
.name(format!("scarb compile {}", unit.id()))
46-
.stack_size(128 * 1024 * 1024)
47-
.spawn_scoped(s, || compile_unit(unit, ws))
48-
.expect("Failed to spawn compiler thread.")
49-
.join()
50-
.expect("Compiler thread has panicked.")
51-
})
52-
}
53-
5433
fn compile_unit(unit: CompilationUnit, ws: &Workspace<'_>) -> Result<()> {
5534
let package_name = unit.main_package_id.name.clone();
5635

0 commit comments

Comments
 (0)