Skip to content

Commit fa47704

Browse files
feat(blockifier_test_utils): use curl and tar instead of rust crates
Signed-off-by: Dori Medini <dori@starkware.co>
1 parent 08f31d4 commit fa47704

3 files changed

Lines changed: 8 additions & 13 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/blockifier_test_utils/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@ cairo_native = []
1212
[dependencies]
1313
apollo_infra_utils = { workspace = true, features = ["testing"] }
1414
cairo-lang-starknet-classes.workspace = true
15-
flate2.workspace = true
1615
itertools.workspace = true
1716
pretty_assertions.workspace = true
18-
reqwest.workspace = true
1917
rstest.workspace = true
2018
serde_json = { workspace = true, features = ["arbitrary_precision"] }
2119
starknet-types-core.workspace = true
2220
starknet_api = { workspace = true, features = ["testing"] }
2321
strum.workspace = true
2422
strum_macros.workspace = true
25-
tar.workspace = true
2623
tempfile.workspace = true
2724
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
2825
tracing.workspace = true

crates/blockifier_test_utils/src/cairo_compile.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::io::Write;
22
use std::path::{Path, PathBuf};
3-
use std::process::{Command, Output};
3+
use std::process::{Command, Output, Stdio};
44
use std::{env, fs};
55

66
use apollo_infra_utils::cairo_compiler_version::cairo1_compiler_version;
@@ -51,15 +51,16 @@ async fn download_cairo_package(version: &String) {
5151
std::fs::create_dir_all(&directory).unwrap();
5252

5353
// Download the artifact.
54-
let client = reqwest::Client::new();
5554
let filename = "release-x86_64-unknown-linux-musl.tar.gz";
5655
let package_url =
5756
format!("https://github.com/starkware-libs/cairo/releases/download/v{version}/{filename}");
58-
let response = client.get(package_url).send().await.unwrap();
59-
assert!(response.status().is_success(), "Failed to download the package: {response:?}.");
60-
let tar_package_bytes: &[u8] = &response.bytes().await.unwrap();
61-
info!("Extracting and writing package.");
62-
tar::Archive::new(flate2::read::GzDecoder::new(tar_package_bytes)).unpack(&directory).unwrap();
57+
let curl_command =
58+
Command::new("curl").args(["-L", &package_url]).stdout(Stdio::piped()).spawn().unwrap();
59+
run_and_verify_output(
60+
Command::new("tar")
61+
.args(["-xz", "-C", directory.to_str().unwrap()])
62+
.stdin(Stdio::from(curl_command.stdout.unwrap())),
63+
);
6364
info!("Done.");
6465
}
6566

0 commit comments

Comments
 (0)